From 8c2a5eeb003a6c3263531f8accde2882567a79b2 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 18 Nov 2019 17:37:52 +1300 Subject: [PATCH] Clear old equip packet --- .../packets/packethandlers/PacketHandlerEquipment.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java index 3c86718e..2b9e36cb 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/packets/packethandlers/PacketHandlerEquipment.java @@ -40,12 +40,13 @@ public class PacketHandlerEquipment implements IPacketHandler { public void handle(Disguise disguise, PacketContainer sentPacket, LibsPackets packets, Player observer, Entity entity) { if (packetsHandler.isCancelMeta(disguise, observer)) { + packets.clear(); + PacketContainer equipPacket = sentPacket.shallowClone(); packets.addPacket(equipPacket); - equipPacket.getModifier() - .write(2, ReflectionManager.getNmsItem(new ItemStack(Material.AIR))); + equipPacket.getModifier().write(2, ReflectionManager.getNmsItem(new ItemStack(Material.AIR))); return; }