From 1c056089bcd8a43bbfb118ad190e24f9142b2b13 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 7 Jul 2013 03:42:25 +1200 Subject: [PATCH] Auctally grab the datawatcher --- src/me/libraryaddict/disguise/LibsDisguises.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/me/libraryaddict/disguise/LibsDisguises.java b/src/me/libraryaddict/disguise/LibsDisguises.java index 41cde33e..dd5cae30 100644 --- a/src/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/me/libraryaddict/disguise/LibsDisguises.java @@ -71,12 +71,10 @@ public class LibsDisguises extends JavaPlugin implements Listener { if (disguise.getType().isMisc() && entity.getType().isAlive()) event.setCancelled(true); } else if (event.getPacketID() == Packets.Server.ENTITY_METADATA) { - event.setPacket(new PacketContainer(event.getPacketID())); StructureModifier mods = event.getPacket().getModifier(); - mods.write(0, entity.getEntityId()); - mods.write(1, - disguise.getWatcher() - .convert((List) event.getPacket().getModifier().read(1))); + event.setPacket(new PacketContainer(event.getPacketID())); + mods.write(0, mods.read(0)); + mods.write(1, disguise.getWatcher().convert((List) mods.read(1))); } else if (event.getPacketID() == Packets.Server.NAMED_ENTITY_SPAWN) { if (disguise.getType().isPlayer()) { StructureModifier mods = event.getPacket().getModifier();