|
Genisys
Genisys API 1.9.3
A server software for Minecraft: Pocket Edition with many features
|
Public Member Functions | |
| __construct (Human $player, $contents=null) | |
| getSize () | |
| setSize ($size) | |
| getHotbarSlotIndex ($index) | |
| setHotbarSlotIndex ($index, $slot) | |
| getHeldItemIndex () | |
| setHeldItemIndex ($hotbarSlotIndex, $sendToHolder=true, $slotMapping=null) | |
| getItemInHand () | |
| setItemInHand (Item $item) | |
| getHotbar () | |
| getHeldItemSlot () | |
| setHeldItemSlot ($slot) | |
| sendHeldItem ($target) | |
| onSlotChange ($index, $before, $send) | |
| getHotbarSize () | |
| getArmorItem ($index) | |
| setArmorItem ($index, Item $item) | |
| damageArmor ($index, $cost) | |
| getHelmet () | |
| getChestplate () | |
| getLeggings () | |
| getBoots () | |
| setHelmet (Item $helmet) | |
| setChestplate (Item $chestplate) | |
| setLeggings (Item $leggings) | |
| setBoots (Item $boots) | |
| setItem ($index, Item $item, $send=true) | |
| clear ($index, $send=true) | |
| getArmorContents () | |
| clearAll () | |
| sendArmorContents ($target) | |
| setArmorContents (array $items) | |
| sendContents ($target) | |
| getHolder () | |
Public Member Functions inherited from BaseInventory | |
| __construct (InventoryHolder $holder, InventoryType $type, array $items=[], $overrideSize=null, $overrideTitle=null) | |
| getSize () | |
| getHotbarSize () | |
| setSize ($size) | |
| getMaxStackSize () | |
| getName () | |
| getTitle () | |
| getItem ($index) | |
| getContents () | |
| setContents (array $items, $send=true) | |
| setItem ($index, Item $item, $send=true) | |
| contains (Item $item) | |
| slotContains ($slot, Item $item, $matchCount=false) | |
| all (Item $item) | |
| remove (Item $item, $send=true) | |
| first (Item $item) | |
| firstEmpty () | |
| firstOccupied () | |
| canAddItem (Item $item) | |
| clear ($index, $send=true) | |
| clearAll ($send=true) | |
| getViewers () | |
| getHolder () | |
| setMaxStackSize ($size) | |
| open (Player $who) | |
| close (Player $who) | |
| onOpen (Player $who) | |
| onClose (Player $who) | |
| onSlotChange ($index, $before, $send) | |
| processSlotChange (Transaction $transaction) | |
| sendContents ($target) | |
| sendSlot ($index, $target) | |
| getType () | |
Public Member Functions inherited from Inventory | |
| setItem ($index, Item $item) | |
| addItem (...$slots) | |
| removeItem (...$slots) | |
| setContents (array $items) | |
| remove (Item $item) | |
| clear ($index) | |
Protected Attributes | |
| $itemInHandIndex = 0 | |
| $hotbar | |
Protected Attributes inherited from BaseInventory | |
| $type | |
| $maxStackSize = Inventory::MAX_STACK | |
| $size | |
| $name | |
| $title | |
| $slots = [] | |
| $viewers = [] | |
| $holder | |
Additional Inherited Members | |
Data Fields inherited from Inventory | |
| const | MAX_STACK = 64 |
| clearAll | ( | ) |
Clears all the slots
Implements Inventory.
| getArmorContents | ( | ) |
| getHeldItemIndex | ( | ) |
Returns the index of the inventory slot the player is currently holding
| getHeldItemSlot | ( | ) |
Returns the inventory slot index of the currently equipped slot
| getHolder | ( | ) |
Implements Inventory.
| getHotbar | ( | ) |
Returns an array of hotbar indices
| getHotbarSlotIndex | ( | $index | ) |
| int | $index |
Returns the index of the inventory slot linked to the specified hotbar slot
| getItemInHand | ( | ) |
Returns the item the player is currently holding
| onSlotChange | ( | $index, | |
| $before, | |||
| $send | |||
| ) |
| int | $index | |
| Item | $before | |
| bool | $send |
Implements Inventory.
| sendArmorContents | ( | $target | ) |
| Player|Player[] | $target |
| sendContents | ( | $target | ) |
| Player|Player[] | $target |
Implements Inventory.
| sendHeldItem | ( | $target | ) |
| Player|Player[] | $target |
| setArmorContents | ( | array | $items | ) |
| Item[] | $items |
| setHeldItemIndex | ( | $hotbarSlotIndex, | |
$sendToHolder = true, |
|||
$slotMapping = null |
|||
| ) |
| int | $hotbarSlotIndex | |
| bool | $sendToHolder | |
| int | $slotMapping | Sets which hotbar slot the player is currently holding. Allows slot remapping as specified by a MobEquipmentPacket. DO NOT CHANGE SLOT MAPPING IN PLUGINS! This new implementation is fully compatible with older APIs. NOTE: Slot mapping is the raw slot index sent by MCPE, which will be between 9 and 44. |
| setHeldItemSlot | ( | $slot | ) |
| int | $slot |
| setHotbarSlotIndex | ( | $index, | |
| $slot | |||
| ) |
Changes the linkage of the specified hotbar slot. This should never be done unless it is requested by the client.
| int | $index | |
| int | $slot |
| setItemInHand | ( | Item | $item | ) |
| Item | $item |
Sets the item in the inventory slot the player is currently holding.