diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/WorldPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/WorldPackets.java index 285e9d9bb..081ca09d7 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/WorldPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_15to1_14_4/packets/WorldPackets.java @@ -86,19 +86,19 @@ public class WorldPackets { if (chunk.isGroundUp()) { int[] biomeData = chunk.getBiomeData(); int[] newBiomeData = new int[1024]; - // Now in 4x4x4 areas (x, then z, then y) - // Set the x/z data - int i = 0; - for (int z = 1; z <= 16; z += 4) { - for (int x = 1; x <= 16; x += 4) { - int biome = biomeData[(x * z) - 1]; - // Extend it on the y axis - for (int y = 0; y < 1024; y += 16) { - newBiomeData[i + y] = biome; - } - i++; + // Now in 4x4x4 areas - take the biome of each "middle" + for (int i = 0; i < 4; ++i) { + for (int j = 0; j < 4; ++j) { + int x = (j << 2) + 2; + int z = (i << 2) + 2; + int oldIndex = (z << 4 | x); + newBiomeData[i << 2 | j] = biomeData[oldIndex]; } } + // ... and copy it to the new y layers + for (int i = 1; i < 64; ++i) { + System.arraycopy(newBiomeData, 0, newBiomeData, i * 16, 16); + } chunk.setBiomeData(newBiomeData); }