Auctally grab the datawatcher

This commit is contained in:
Andrew 2013-07-07 03:42:25 +12:00
parent 5db33ffcf6
commit 1c056089bc

View File

@ -71,12 +71,10 @@ public class LibsDisguises extends JavaPlugin implements Listener {
if (disguise.getType().isMisc() && entity.getType().isAlive()) if (disguise.getType().isMisc() && entity.getType().isAlive())
event.setCancelled(true); event.setCancelled(true);
} else if (event.getPacketID() == Packets.Server.ENTITY_METADATA) { } else if (event.getPacketID() == Packets.Server.ENTITY_METADATA) {
event.setPacket(new PacketContainer(event.getPacketID()));
StructureModifier<Object> mods = event.getPacket().getModifier(); StructureModifier<Object> mods = event.getPacket().getModifier();
mods.write(0, entity.getEntityId()); event.setPacket(new PacketContainer(event.getPacketID()));
mods.write(1, mods.write(0, mods.read(0));
disguise.getWatcher() mods.write(1, disguise.getWatcher().convert((List<WatchableObject>) mods.read(1)));
.convert((List<WatchableObject>) event.getPacket().getModifier().read(1)));
} else if (event.getPacketID() == Packets.Server.NAMED_ENTITY_SPAWN) { } else if (event.getPacketID() == Packets.Server.NAMED_ENTITY_SPAWN) {
if (disguise.getType().isPlayer()) { if (disguise.getType().isPlayer()) {
StructureModifier<Object> mods = event.getPacket().getModifier(); StructureModifier<Object> mods = event.getPacket().getModifier();