Store bukkit itemstack

This commit is contained in:
libraryaddict 2014-01-23 09:07:56 +13:00
parent a5eddd4305
commit 6bec4c20c4
2 changed files with 4 additions and 8 deletions

View File

@ -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);
}

View File

@ -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);
}