From 91687339bf4ba7111d0aab1e5c208e72c5789004 Mon Sep 17 00:00:00 2001 From: KennyTV <28825609+KennyTV@users.noreply.github.com> Date: Thu, 4 Apr 2019 20:28:02 +0200 Subject: [PATCH] Actually fix book opening --- .../protocol1_14to1_13_2/packets/InventoryPackets.java | 1 - .../protocols/protocol1_9to1_8/packets/PlayerPackets.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/packets/InventoryPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/packets/InventoryPackets.java index 281c3afbc..5a713153e 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/packets/InventoryPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_14to1_13_2/packets/InventoryPackets.java @@ -178,7 +178,6 @@ public class InventoryPackets { wrapper.write(Type.VAR_INT, 0); wrapper.write(Type.BOOLEAN, false); } else if (channel.equals("minecraft:book_open") || channel.equals("book_open")) { - wrapper.read(Type.REMAINING_BYTES); int hand = wrapper.read(Type.VAR_INT); wrapper.clearPacket(); wrapper.setId(0x2C); diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/PlayerPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/PlayerPackets.java index e373ab035..fe1f5d036 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/PlayerPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_9to1_8/packets/PlayerPackets.java @@ -293,7 +293,7 @@ public class PlayerPackets { public void handle(PacketWrapper wrapper) throws Exception { String name = wrapper.get(Type.STRING, 0); if (name.equalsIgnoreCase("MC|BOpen")) { - wrapper.passthrough(Type.REMAINING_BYTES); // This is so ugly, :( + wrapper.read(Type.REMAINING_BYTES); // Not used anymore wrapper.write(Type.VAR_INT, 0); } if (name.equalsIgnoreCase("MC|TrList")) {