From 4c5719b16575f6010e029d1e4270b0c1274662dc Mon Sep 17 00:00:00 2001 From: bobtwinkles Date: Sun, 23 Mar 2014 17:58:52 -0400 Subject: [PATCH] Read correct packet lengths for HeldItemChange --- source/Craft.Net.Networking/Packets.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/Craft.Net.Networking/Packets.cs b/source/Craft.Net.Networking/Packets.cs index 1fc30e40..f6be0819 100644 --- a/source/Craft.Net.Networking/Packets.cs +++ b/source/Craft.Net.Networking/Packets.cs @@ -677,7 +677,10 @@ public HeldItemPacket(sbyte slot) public NetworkMode ReadPacket(MinecraftStream stream, NetworkMode mode, PacketDirection direction) { - Slot = stream.ReadInt16(); + if (direction == PacketDirection.Clientbound) + Slot = stream.ReadInt8(); + else + Slot = stream.ReadInt16(); return mode; }