Skip to content

Commit

Permalink
fix open_book and show_book, fixes #1997
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 6, 2019
1 parent 6506f75 commit 321d2e9
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.denizenscript.denizen.nms.helpers;

import io.netty.buffer.Unpooled;
import com.denizenscript.denizen.nms.NMSHandler;
import com.denizenscript.denizen.nms.impl.jnbt.CompoundTag_v1_14_R1;
import com.denizenscript.denizen.nms.interfaces.PacketHelper;
Expand Down Expand Up @@ -203,9 +202,7 @@ public void resetEquipment(Player player, LivingEntity entity) {

@Override
public void openBook(Player player, EquipmentSlot hand) {
PacketDataSerializer serializer = new PacketDataSerializer(Unpooled.buffer());
serializer.a(hand == EquipmentSlot.OFF_HAND ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND);
sendPacket(player, new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.c, serializer));
sendPacket(player, new PacketPlayOutOpenBook(hand == EquipmentSlot.OFF_HAND ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND));
}

@Override
Expand Down

0 comments on commit 321d2e9

Please sign in to comment.