mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-15 14:13:56 +01:00
Added item-in-hand related API.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
dbc9e0eb55
commit
88cf954f4e
2 changed files with 12 additions and 0 deletions
|
@ -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 a new issue