Skip to content

Commit

Permalink
Updated weapon "bobbing" fix to 1.17 and 1.18
Browse files Browse the repository at this point in the history
  • Loading branch information
CJCrafter committed Jan 8, 2022
1 parent 1a5922c commit 8d03ad2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class OutSetSlotBobFix extends PacketHandler implements Listener {

static {
Class<?> packetClass = ReflectionUtil.getPacketClass("PacketPlayOutSetSlot");
windowField = ReflectionUtil.getField(packetClass, int.class, 0);
slotField = ReflectionUtil.getField(packetClass, int.class, 1);
windowField = ReflectionUtil.getField(packetClass, int.class, 0, true);
slotField = ReflectionUtil.getField(packetClass, int.class, ReflectionUtil.getMCVersion() >= 17 ? 2 : 1, true);
itemField = ReflectionUtil.getField(packetClass, ReflectionUtil.getNMSClass("world.item", "ItemStack"));
}

Expand Down

0 comments on commit 8d03ad2

Please sign in to comment.