Changed enderman watcher to override held get/set and deprecated the rest

This commit is contained in:
Andrew 2013-11-08 06:37:36 +13:00
parent a122152492
commit 643f2b1c85
2 changed files with 14 additions and 2 deletions

View File

@ -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 DroppedItemWatcher extends FlagWatcher {
public DroppedItemWatcher(Disguise disguise) {

View File

@ -10,14 +10,21 @@ public class EndermanWatcher extends LivingWatcher {
super(disguise);
}
@Deprecated
public int getCarriedData() {
return ((Byte) getValue(17, (byte) 0));
}
@Deprecated
public int getCarriedId() {
return ((Byte) getValue(16, (byte) 0));
}
@Override
public ItemStack getHeldItem() {
return new ItemStack((Byte) getValue(16, (byte) 0), 1, ((Byte) getValue(17, (byte) 0)));
}
public boolean isAgressive() {
return (Integer) getValue(18, (byte) 0) == 1;
}
@ -35,9 +42,16 @@ public class EndermanWatcher extends LivingWatcher {
sendData(17);
}
@Deprecated
public void setCarriedItem(ItemStack itemstack) {
setValue(16, (byte) (itemstack.getTypeId() & 255));
setValue(17, (byte) (itemstack.getDurability() & 255));
}
@Override
public void setHeldItem(ItemStack itemstack) {
setValue(16, (byte) (itemstack.getTypeId() & 255));
setValue(17, (byte) (itemstack.getDurability() & 255));
}
}