Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
Added item-in-hand related API.
Dieser Commit ist enthalten in:
Ursprung
44ae0531e7
Commit
5d93ab3e54
@ -40,6 +40,10 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
|||||||
return getInventory().getItemInHand();
|
return getInventory().getItemInHand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setItemInHand(ItemStack item) {
|
||||||
|
getInventory().setItemInHand(item);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}';
|
return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}';
|
||||||
|
@ -22,6 +22,14 @@ public class CraftInventoryPlayer extends CraftInventory implements PlayerInvent
|
|||||||
return new CraftItemStack( getInventory().e() );
|
return new CraftItemStack( getInventory().e() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setItemInHand(ItemStack stack) {
|
||||||
|
setItem( getHeldItemSlot(), stack );
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHeldItemSlot() {
|
||||||
|
return getInventory().c;
|
||||||
|
}
|
||||||
|
|
||||||
public CraftItemStack getHelmet() {
|
public CraftItemStack getHelmet() {
|
||||||
return getItem( getSize() + 0 );
|
return getItem( getSize() + 0 );
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren