mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-12-16 15:38:14 +01:00
Changed getHeldItem and setHeldItem in enderman and flagwatcher to setItemInHand
This commit is contained in:
parent
40694c5030
commit
a759cfaa59
@ -167,7 +167,12 @@ public class FlagWatcher {
|
||||
return ((Byte) getValue(0, (byte) 0) & 1 << i) != 0;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public org.bukkit.inventory.ItemStack getHeldItem() {
|
||||
return getItemInHand();
|
||||
}
|
||||
|
||||
public org.bukkit.inventory.ItemStack getItemInHand() {
|
||||
return getItemStack(SlotType.HELD_ITEM);
|
||||
}
|
||||
|
||||
@ -272,7 +277,12 @@ public class FlagWatcher {
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setHeldItem(org.bukkit.inventory.ItemStack itemstack) {
|
||||
setItemInHand(itemstack);
|
||||
}
|
||||
|
||||
public void setItemInHand(org.bukkit.inventory.ItemStack itemstack) {
|
||||
setItemStack(SlotType.HELD_ITEM, itemstack);
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,13 @@ public class EndermanWatcher extends LivingWatcher {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ItemStack getHeldItem() {
|
||||
return getItemInHand();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemInHand() {
|
||||
return new ItemStack((Byte) getValue(16, (byte) 0), 1, ((Byte) getValue(17, (byte) 0)));
|
||||
}
|
||||
|
||||
@ -49,7 +55,13 @@ public class EndermanWatcher extends LivingWatcher {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setHeldItem(ItemStack itemstack) {
|
||||
setItemInHand(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItemInHand(ItemStack itemstack) {
|
||||
setValue(16, (byte) (itemstack.getTypeId() & 255));
|
||||
setValue(17, (byte) (itemstack.getDurability() & 255));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user