From db57916af47b331ca06dd7fbb000762c70734c51 Mon Sep 17 00:00:00 2001 From: Matsv Date: Tue, 20 Mar 2018 11:28:44 +0100 Subject: [PATCH] Handle PacketMultiBlockChange correctly --- .../protocolsnapshotto1_12_2/packets/WorldPackets.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/WorldPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/WorldPackets.java index 2aef10478..3a5b72af2 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/WorldPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocolsnapshotto1_12_2/packets/WorldPackets.java @@ -105,17 +105,15 @@ public class WorldPackets { handler(new PacketHandler() { @Override public void handle(PacketWrapper wrapper) throws Exception { - BlockStorage storage = wrapper.user().get(BlockStorage.class); int chunkX = wrapper.get(Type.INT, 0); - int chunkZ = wrapper.get(Type.INT, 0); + int chunkZ = wrapper.get(Type.INT, 1); // Convert ids for (BlockChangeRecord record : wrapper.get(Type.BLOCK_CHANGE_RECORD_ARRAY, 0)) { int newBlock = toNewId(record.getBlockId()); Position position = new Position( (long) (record.getHorizontal() >> 4 & 15) + (chunkX * 16), (long) record.getY(), - (long) ((record.getHorizontal() & 15) + (chunkZ * 16))); - + (long) (record.getHorizontal() & 15) + (chunkZ * 16)); record.setBlockId(checkStorage(wrapper.user(), position, newBlock)); } }