mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-16 15:38:14 +01:00
Fixed itemframes. Tho they are still stupid
This commit is contained in:
parent
331d254641
commit
b47d5e8b5f
@ -6,8 +6,6 @@ import me.libraryaddict.disguise.disguisetypes.FlagWatcher;
|
||||
import org.bukkit.craftbukkit.v1_6_R3.inventory.CraftItemStack;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
|
||||
|
||||
public class ItemFrameWatcher extends FlagWatcher {
|
||||
|
||||
public ItemFrameWatcher(Disguise disguise) {
|
||||
@ -15,17 +13,24 @@ public class ItemFrameWatcher extends FlagWatcher {
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
if (getValue(3, (byte) 0) instanceof Integer)
|
||||
if (getValue(2, null) == null)
|
||||
return new ItemStack(0);
|
||||
return CraftItemStack.asBukkitCopy((net.minecraft.server.v1_6_R3.ItemStack) getValue(3, null));
|
||||
return CraftItemStack.asBukkitCopy((net.minecraft.server.v1_6_R3.ItemStack) getValue(2, null));
|
||||
}
|
||||
|
||||
public void setItemStack(ItemStack newItem) {
|
||||
if (newItem.getTypeId() == 0)
|
||||
setValue(3, (byte) 0);
|
||||
else {
|
||||
setValue(3, CraftItemStack.asCraftCopy(newItem));
|
||||
}
|
||||
newItem = newItem.clone();
|
||||
newItem.setAmount(1);
|
||||
setValue(2, CraftItemStack.asNMSCopy(newItem));
|
||||
sendData(2);
|
||||
}
|
||||
|
||||
public int getItemRotation() {
|
||||
return (Integer) getValue(3, 0);
|
||||
}
|
||||
|
||||
public void setItemRotation(int rotation) {
|
||||
setValue(3, (byte) (rotation % 4));
|
||||
sendData(3);
|
||||
}
|
||||
|
||||
|
@ -4,8 +4,6 @@ import java.util.Random;
|
||||
|
||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||
|
||||
|
||||
|
||||
public class SlimeWatcher extends LivingWatcher {
|
||||
|
||||
public SlimeWatcher(Disguise disguise) {
|
||||
|
Loading…
Reference in New Issue
Block a user