From fa348fbc23b9e8bba26f01ed03a5e1506976fd5e Mon Sep 17 00:00:00 2001 From: Myles Date: Mon, 14 Nov 2016 22:17:23 +0000 Subject: [PATCH] Fix villager trading on 1.11 #534 --- .../protocol1_11to1_10/packets/InventoryPackets.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_11to1_10/packets/InventoryPackets.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_11to1_10/packets/InventoryPackets.java index d8dfab8e0..109275db4 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_11to1_10/packets/InventoryPackets.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_11to1_10/packets/InventoryPackets.java @@ -81,14 +81,14 @@ public class InventoryPackets { if (wrapper.get(Type.STRING, 0).equalsIgnoreCase("MC|TrList")) { wrapper.passthrough(Type.INT); // Passthrough Window ID - int size = wrapper.passthrough(Type.BYTE); + int size = wrapper.passthrough(Type.UNSIGNED_BYTE) for (int i = 0; i < size; i++) { - ItemRewriter.toClient(wrapper.read(Type.ITEM)); // Input Item - ItemRewriter.toClient(wrapper.read(Type.ITEM)); // Output Item + ItemRewriter.toClient(wrapper.passthrough(Type.ITEM)); // Input Item + ItemRewriter.toClient(wrapper.passthrough(Type.ITEM)); // Output Item boolean secondItem = wrapper.passthrough(Type.BOOLEAN); // Has second item if (secondItem) - ItemRewriter.toClient(wrapper.read(Type.ITEM)); // Second Item + ItemRewriter.toClient(wrapper.passthrough(Type.ITEM)); // Second Item wrapper.passthrough(Type.BOOLEAN); // Trade disabled wrapper.passthrough(Type.INT); // Number of tools uses