Changed enderman watcher to override held get/set and deprecated the rest
This commit is contained in:
		@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
@@ -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));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user