mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-22 16:21:29 +01:00
Added item-in-hand related API.
This commit is contained in:
parent
44ae0531e7
commit
5d93ab3e54
@ -40,6 +40,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||
return getInventory().getItemInHand();
|
||||
}
|
||||
|
||||
public void setItemInHand(ItemStack item) {
|
||||
getInventory().setItemInHand(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}';
|
||||
|
@ -22,6 +22,14 @@ public class CraftInventoryPlayer extends CraftInventory implements PlayerInvent
|
||||
return new CraftItemStack( getInventory().e() );
|
||||
}
|
||||
|
||||
public void setItemInHand(ItemStack stack) {
|
||||
setItem( getHeldItemSlot(), stack );
|
||||
}
|
||||
|
||||
public int getHeldItemSlot() {
|
||||
return getInventory().c;
|
||||
}
|
||||
|
||||
public CraftItemStack getHelmet() {
|
||||
return getItem( getSize() + 0 );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user