From 7fb0ac8fd02b5c9c9683739f4ae6638f6c99253c Mon Sep 17 00:00:00 2001 From: themode Date: Mon, 3 Jan 2022 22:07:54 +0100 Subject: [PATCH] Better resize loop --- .../net/minestom/server/instance/palette/PaletteImpl.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/minestom/server/instance/palette/PaletteImpl.java b/src/main/java/net/minestom/server/instance/palette/PaletteImpl.java index 8c74d8ff6..cd4dad54c 100644 --- a/src/main/java/net/minestom/server/instance/palette/PaletteImpl.java +++ b/src/main/java/net/minestom/server/instance/palette/PaletteImpl.java @@ -3,7 +3,6 @@ package net.minestom.server.instance.palette; import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap; import it.unimi.dsi.fastutil.ints.IntArrayList; import net.minestom.server.MinecraftServer; -import net.minestom.server.instance.Chunk; import net.minestom.server.utils.binary.BinaryWriter; import org.jetbrains.annotations.NotNull; @@ -215,9 +214,9 @@ final class PaletteImpl implements Palette, Cloneable { private void resize(int newBitsPerEntry) { newBitsPerEntry = fixBitsPerEntry(newBitsPerEntry); PaletteImpl palette = new PaletteImpl(dimension, maxBitsPerEntry, newBitsPerEntry, bitsIncrement); - for (int y = 0; y < Chunk.CHUNK_SECTION_SIZE; y++) { - for (int x = 0; x < Chunk.CHUNK_SIZE_X; x++) { - for (int z = 0; z < Chunk.CHUNK_SIZE_Z; z++) { + for (int y = 0; y < dimension; y++) { + for (int x = 0; x < dimension; x++) { + for (int z = 0; z < dimension; z++) { palette.set(x, y, z, get(x, y, z)); } }