mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Added item-in-hand related API.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
b202a59909
commit
fdc7e20d71
2 changed files with 18 additions and 5 deletions
|
@ -29,17 +29,16 @@ public interface HumanEntity extends LivingEntity {
|
|||
*/
|
||||
public ItemStack getItemInHand();
|
||||
|
||||
|
||||
/** TODO: This probably won't work ;(
|
||||
/**
|
||||
* Sets the item to the given ItemStack, this will replace whatever the
|
||||
* user was holding.
|
||||
*
|
||||
* @param item The ItemStack which will end up in the hand
|
||||
* @return
|
||||
*
|
||||
public void setItemInHand( ItemStack item );
|
||||
*/
|
||||
public void setItemInHand(ItemStack item);
|
||||
|
||||
**
|
||||
/**
|
||||
* Changes the item in hand to another of your 'action slots'.
|
||||
*
|
||||
* @param index The new index to use, only valid ones are 0-8.
|
||||
|
|
|
@ -77,4 +77,18 @@ public interface PlayerInventory extends Inventory {
|
|||
* @return The currently holded ItemStack
|
||||
*/
|
||||
public ItemStack getItemInHand();
|
||||
|
||||
/**
|
||||
* Sets the item in hand
|
||||
*
|
||||
* @param stack Stack to set
|
||||
*/
|
||||
public void setItemInHand(ItemStack stack);
|
||||
|
||||
/**
|
||||
* Get the slot number of the currently held item
|
||||
*
|
||||
* @return Held item slot number
|
||||
*/
|
||||
public int getHeldItemSlot();
|
||||
}
|
Loading…
Reference in a new issue