From 616c9474ce9b242982d826baa1047ec3800aedfd Mon Sep 17 00:00:00 2001 From: Myles Date: Thu, 14 Dec 2017 18:45:29 +0000 Subject: [PATCH] Better fallback for block mismatch --- .../protocolsnapshotto1_12_2/packets/WorldPackets.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 0eb2d5787..0b82b74e6 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 @@ -110,7 +110,7 @@ public class WorldPackets { // TODO: This packet has changed handler(new PacketHandler() { @Override - public void handle(PacketWrapper wrapper) throws Exception { + public void handle(PacketWrapper wrapper) { wrapper.cancel(); } }); @@ -122,7 +122,11 @@ public class WorldPackets { if (MappingData.oldToNewBlocks.containsKey(oldId)) { return MappingData.oldToNewBlocks.get(oldId); } else { - System.out.println("Missing block " + oldId); + if (MappingData.oldToNewBlocks.containsKey((oldId >> 4) << 4)) { + System.out.println("Missing block " + oldId); + return MappingData.oldToNewBlocks.get((oldId >> 4) << 4); + } + System.out.println("Missing block completely " + oldId); // Default stone return 1; }