From a759cfaa59adf6951d5a6e4b0baaf74314597acf Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 5 Dec 2013 21:27:46 +1300 Subject: [PATCH] Changed getHeldItem and setHeldItem in enderman and flagwatcher to setItemInHand --- .../disguise/disguisetypes/FlagWatcher.java | 10 ++++++++++ .../disguisetypes/watchers/EndermanWatcher.java | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index 80591207..fd19559f 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -167,7 +167,12 @@ public class FlagWatcher { return ((Byte) getValue(0, (byte) 0) & 1 << i) != 0; } + @Deprecated public org.bukkit.inventory.ItemStack getHeldItem() { + return getItemInHand(); + } + + public org.bukkit.inventory.ItemStack getItemInHand() { return getItemStack(SlotType.HELD_ITEM); } @@ -272,7 +277,12 @@ public class FlagWatcher { } } + @Deprecated public void setHeldItem(org.bukkit.inventory.ItemStack itemstack) { + setItemInHand(itemstack); + } + + public void setItemInHand(org.bukkit.inventory.ItemStack itemstack) { setItemStack(SlotType.HELD_ITEM, itemstack); } diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java index 80e46fe9..c7c60659 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/EndermanWatcher.java @@ -21,7 +21,13 @@ public class EndermanWatcher extends LivingWatcher { } @Override + @Deprecated public ItemStack getHeldItem() { + return getItemInHand(); + } + + @Override + public ItemStack getItemInHand() { return new ItemStack((Byte) getValue(16, (byte) 0), 1, ((Byte) getValue(17, (byte) 0))); } @@ -49,7 +55,13 @@ public class EndermanWatcher extends LivingWatcher { } @Override + @Deprecated public void setHeldItem(ItemStack itemstack) { + setItemInHand(itemstack); + } + + @Override + public void setItemInHand(ItemStack itemstack) { setValue(16, (byte) (itemstack.getTypeId() & 255)); setValue(17, (byte) (itemstack.getDurability() & 255)); }