diff --git a/src/main/java/net/minestom/server/instance/DynamicChunk.java b/src/main/java/net/minestom/server/instance/DynamicChunk.java index 0e171e162..a6bf60385 100644 --- a/src/main/java/net/minestom/server/instance/DynamicChunk.java +++ b/src/main/java/net/minestom/server/instance/DynamicChunk.java @@ -68,8 +68,8 @@ public class DynamicChunk extends Chunk { public DynamicChunk(@Nullable Biome[] biomes, int chunkX, int chunkZ) { this(biomes, chunkX, chunkZ, - new PaletteStorage(6, 2), - new PaletteStorage(6, 2)); + new PaletteStorage(15, 2), + new PaletteStorage(15, 2)); } @Override diff --git a/src/main/java/net/minestom/server/instance/palette/PaletteStorage.java b/src/main/java/net/minestom/server/instance/palette/PaletteStorage.java index 861eaf919..6097eefd1 100644 --- a/src/main/java/net/minestom/server/instance/palette/PaletteStorage.java +++ b/src/main/java/net/minestom/server/instance/palette/PaletteStorage.java @@ -224,8 +224,9 @@ public class PaletteStorage implements PublicCloneable { * * @param newBitsPerEntry the new bits per entry count */ - private synchronized void resize(int newBitsPerEntry) { + private void resize(int newBitsPerEntry) { newBitsPerEntry = fixBitsPerEntry(newBitsPerEntry); + PaletteStorage paletteStorageCache = new PaletteStorage(newBitsPerEntry, bitsIncrement); paletteStorageCache.paletteBlockMaps = paletteBlockMaps; paletteStorageCache.blockPaletteMaps = blockPaletteMaps; @@ -239,13 +240,12 @@ public class PaletteStorage implements PublicCloneable { } } - this.bitsPerEntry = newBitsPerEntry; + this.bitsPerEntry = paletteStorageCache.bitsPerEntry; this.valuesPerLong = paletteStorageCache.valuesPerLong; this.hasPalette = paletteStorageCache.hasPalette; this.sectionBlocks = paletteStorageCache.sectionBlocks; - } /**