From bf3e81522bcc4357e3cde2119d1ba8bcc10c5a49 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 27 Sep 2014 14:42:00 +1200 Subject: [PATCH] Fix self disguises for player --- .../disguise/utilities/PacketsManager.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index 0f3bb47c..5b554f89 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -772,10 +772,12 @@ public class PacketsManager { packets = new PacketContainer[] { event.getPacket() }; } for (PacketContainer packet : packets) { - if (packet.equals(event.getPacket())) { - packet = packet.deepClone(); + if (packet.getType() != PacketType.Play.Server.PLAYER_INFO) { + if (packet.equals(event.getPacket())) { + packet = packet.shallowClone(); + } + packet.getIntegers().write(0, DisguiseAPI.getSelfDisguiseId()); } - packet.getIntegers().write(0, DisguiseAPI.getSelfDisguiseId()); try { ProtocolLibrary.getProtocolManager().sendServerPacket(observer, packet, false); } catch (InvocationTargetException e) { @@ -793,7 +795,7 @@ public class PacketsManager { e.printStackTrace(); } } - }); + }, 2); } if (event.getPacketType() == PacketType.Play.Server.ENTITY_METADATA) { event.setPacket(event.getPacket().deepClone());