mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-16 15:38:14 +01:00
Store bukkit itemstack
This commit is contained in:
parent
a5eddd4305
commit
6bec4c20c4
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user