From 6bec4c20c4a29d3269e6cf2c8028625dc1971ad7 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Thu, 23 Jan 2014 09:07:56 +1300 Subject: [PATCH] Store bukkit itemstack --- .../disguise/disguisetypes/watchers/DroppedItemWatcher.java | 6 ++---- .../disguise/disguisetypes/watchers/ItemFrameWatcher.java | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/DroppedItemWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/DroppedItemWatcher.java index 9276c6b7..63bef0e0 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/DroppedItemWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/DroppedItemWatcher.java @@ -2,8 +2,6 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; -import me.libraryaddict.disguise.utilities.ReflectionManager; - import org.bukkit.inventory.ItemStack; public class DroppedItemWatcher extends FlagWatcher { @@ -13,11 +11,11 @@ public class DroppedItemWatcher extends FlagWatcher { } public ItemStack getItemStack() { - return ReflectionManager.getBukkitItem(getValue(10, ReflectionManager.getNmsItem(new ItemStack(1)))); + return (ItemStack) getValue(10, new ItemStack(1)); } public void setItemStack(ItemStack item) { - setValue(10, ReflectionManager.getNmsItem(item)); + setValue(10, item); sendData(10); } diff --git a/src/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java b/src/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java index 515f6730..571ca52f 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java +++ b/src/me/libraryaddict/disguise/disguisetypes/watchers/ItemFrameWatcher.java @@ -2,8 +2,6 @@ package me.libraryaddict.disguise.disguisetypes.watchers; import me.libraryaddict.disguise.disguisetypes.Disguise; import me.libraryaddict.disguise.disguisetypes.FlagWatcher; -import me.libraryaddict.disguise.utilities.ReflectionManager; - import org.bukkit.inventory.ItemStack; public class ItemFrameWatcher extends FlagWatcher { @@ -19,7 +17,7 @@ public class ItemFrameWatcher extends FlagWatcher { public ItemStack getItemStack() { if (getValue(2, null) == null) return new ItemStack(0); - return ReflectionManager.getBukkitItem(getValue(2, null)); + return (ItemStack) getValue(2, null); } public void setItemRotation(int rotation) { @@ -30,7 +28,7 @@ public class ItemFrameWatcher extends FlagWatcher { public void setItemStack(ItemStack newItem) { newItem = newItem.clone(); newItem.setAmount(1); - setValue(2, ReflectionManager.getNmsItem(newItem)); + setValue(2, newItem); sendData(2); }