From 78b9e5d8330486e4a75b9027a922023319efcf5b Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Fri, 20 Jul 2018 10:26:56 -0300 Subject: [PATCH] Fix biomes --- .../protocol1_13to1_12_2/packets/WorldPackets.java | 9 +++++++++ .../protocol1_13to1_12_2/types/Chunk1_13Type.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java index 055957a56..32468ab5e 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/packets/WorldPackets.java @@ -171,6 +171,15 @@ public class WorldPackets { } } + // Rewrite biome id 255 to plains + if (chunk.isBiomeData()) { + for (int i = 0; i < 256; i++) { + int data = chunk.getBiomeData()[i] & 0xFF; + if (data == 255) + chunk.getBiomeData()[i] = 1; + } + } + // Rewrite BlockEntities to normal blocks BlockEntityProvider provider = Via.getManager().getProviders().get(BlockEntityProvider.class); for (CompoundTag tag : chunk.getBlockEntities()) { diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java index c7c5d93c2..f5941f5be 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/types/Chunk1_13Type.java @@ -101,7 +101,7 @@ public class Chunk1_13Type extends PartialType { // Write biome data if (chunk.isBiomeData()) { for (byte value : chunk.getBiomeData()) { - output.writeInt(0); // This is a temporary workaround, we'll look into fixing this soon :) + output.writeInt(value & 0xFF); // This is a temporary workaround, we'll look into fixing this soon :) } }