From 0c305a8151fd1b17fd18cb264c142d8dc90feca4 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Fri, 23 May 2014 14:03:02 +1200 Subject: [PATCH] Fixed isRightClicking being slightly bad --- .../disguise/utilities/PacketsManager.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/me/libraryaddict/disguise/utilities/PacketsManager.java b/src/me/libraryaddict/disguise/utilities/PacketsManager.java index 9ba52d19..9d2868af 100644 --- a/src/me/libraryaddict/disguise/utilities/PacketsManager.java +++ b/src/me/libraryaddict/disguise/utilities/PacketsManager.java @@ -1269,15 +1269,18 @@ public class PacketsManager { ItemStack heldItem = packets[0].getItemModifier().read(0); if (heldItem != null && heldItem.getType() != Material.AIR) { // Convert the datawatcher - WrappedDataWatcher dataWatcher = WrappedDataWatcher.getEntityWatcher(entity); List list = new ArrayList(); - for (WrappedWatchableObject value : dataWatcher.getWatchableObjects()) { - if (value.getIndex() == 0) { - list.add(value); - break; + if (DisguiseConfig.isMetadataPacketsEnabled()) { + list.add(new WrappedWatchableObject(0, WrappedDataWatcher.getEntityWatcher(entity).getObject(0))); + list = disguise.getWatcher().convert(list); + } else { + for (WrappedWatchableObject obj : disguise.getWatcher().getWatchableObjects()) { + if (obj.getIndex() == 0) { + list.add(obj); + break; + } } } - list = DisguiseConfig.isMetadataPacketsEnabled() ? disguise.getWatcher().convert(list) : list; // Construct the packets to return PacketContainer packetBlock = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA); packetBlock.getModifier().write(0, entity.getEntityId());