mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-09-10 01:28:19 +02: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.Disguise;
|
||||||
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
|
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
|
||||||
import me.libraryaddict.disguise.utilities.ReflectionManager;
|
|
||||||
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class DroppedItemWatcher extends FlagWatcher {
|
public class DroppedItemWatcher extends FlagWatcher {
|
||||||
@ -13,11 +11,11 @@ public class DroppedItemWatcher extends FlagWatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getItemStack() {
|
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) {
|
public void setItemStack(ItemStack item) {
|
||||||
setValue(10, ReflectionManager.getNmsItem(item));
|
setValue(10, item);
|
||||||
sendData(10);
|
sendData(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@ package me.libraryaddict.disguise.disguisetypes.watchers;
|
|||||||
|
|
||||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||||
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
|
import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
|
||||||
import me.libraryaddict.disguise.utilities.ReflectionManager;
|
|
||||||
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class ItemFrameWatcher extends FlagWatcher {
|
public class ItemFrameWatcher extends FlagWatcher {
|
||||||
@ -19,7 +17,7 @@ public class ItemFrameWatcher extends FlagWatcher {
|
|||||||
public ItemStack getItemStack() {
|
public ItemStack getItemStack() {
|
||||||
if (getValue(2, null) == null)
|
if (getValue(2, null) == null)
|
||||||
return new ItemStack(0);
|
return new ItemStack(0);
|
||||||
return ReflectionManager.getBukkitItem(getValue(2, null));
|
return (ItemStack) getValue(2, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setItemRotation(int rotation) {
|
public void setItemRotation(int rotation) {
|
||||||
@ -30,7 +28,7 @@ public class ItemFrameWatcher extends FlagWatcher {
|
|||||||
public void setItemStack(ItemStack newItem) {
|
public void setItemStack(ItemStack newItem) {
|
||||||
newItem = newItem.clone();
|
newItem = newItem.clone();
|
||||||
newItem.setAmount(1);
|
newItem.setAmount(1);
|
||||||
setValue(2, ReflectionManager.getNmsItem(newItem));
|
setValue(2, newItem);
|
||||||
sendData(2);
|
sendData(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user