PHP Класс pocketmine\inventory\PlayerInventory

Наследование: extends BaseInventory
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$hotbar int[]
$itemInHandIndex

Открытые методы

Метод Описание
__construct ( Human $player, $contents = null )
clear ( $index, $send = true )
clearAll ( )
getArmorContents ( ) : Item[]
getArmorItem ( $index )
getBoots ( )
getChestplate ( )
getHeldItemIndex ( ) : integer
getHeldItemSlot ( ) : integer
getHelmet ( )
getHolder ( ) : Human | Player
getHotbar ( ) : int[]
getHotbarSize ( )
getHotbarSlotIndex ( integer $index ) : integer
getItemInHand ( ) : Item
getLeggings ( )
getSize ( )
onSlotChange ( $index, $before, $send )
sendArmorContents ( Player | Player[] $target )
sendArmorSlot ( integer $index, Player | Player[] $target )
sendContents ( Player | Player[] $target )
sendHeldItem ( Player | Player[] $target )
sendSlot ( integer $index, Player | Player[] $target )
setArmorContents ( array $items )
setArmorItem ( $index, Item $item )
setBoots ( Item $boots )
setChestplate ( Item $chestplate )
setHeldItemIndex ( integer $hotbarSlotIndex, boolean $sendToHolder = true, integer $slotMapping = null )
setHeldItemSlot ( integer $slot )
setHelmet ( Item $helmet )
setHotbarSlotIndex ( $index, $slot )
setItem ( $index, Item $item, $send = true )
setItemInHand ( Item $item ) : boolean
setLeggings ( Item $leggings )
setSize ( $size )

Описание методов

__construct() публичный Метод

public __construct ( Human $player, $contents = null )
$player pocketmine\entity\Human

clear() публичный Метод

public clear ( $index, $send = true )

clearAll() публичный Метод

public clearAll ( )

getArmorContents() публичный Метод

public getArmorContents ( ) : Item[]
Результат pocketmine\item\Item[]

getArmorItem() публичный Метод

public getArmorItem ( $index )

getBoots() публичный Метод

public getBoots ( )

getChestplate() публичный Метод

public getChestplate ( )

getHeldItemIndex() публичный Метод

public getHeldItemIndex ( ) : integer
Результат integer Returns the index of the inventory slot the player is currently holding

getHeldItemSlot() публичный Метод

public getHeldItemSlot ( ) : integer
Результат integer Returns the inventory slot index of the currently equipped slot

getHelmet() публичный Метод

public getHelmet ( )

getHolder() публичный Метод

public getHolder ( ) : Human | Player
Результат pocketmine\entity\Human | pocketmine\Player

getHotbar() публичный Метод

public getHotbar ( ) : int[]
Результат int[] Returns an array of hotbar indices

getHotbarSize() публичный Метод

public getHotbarSize ( )

getHotbarSlotIndex() публичный Метод

public getHotbarSlotIndex ( integer $index ) : integer
$index integer
Результат integer Returns the index of the inventory slot linked to the specified hotbar slot

getItemInHand() публичный Метод

public getItemInHand ( ) : Item
Результат pocketmine\item\Item Returns the item the player is currently holding

getLeggings() публичный Метод

public getLeggings ( )

getSize() публичный Метод

public getSize ( )

onSlotChange() публичный Метод

public onSlotChange ( $index, $before, $send )

sendArmorContents() публичный Метод

public sendArmorContents ( Player | Player[] $target )
$target pocketmine\Player | pocketmine\Player[]

sendArmorSlot() публичный Метод

public sendArmorSlot ( integer $index, Player | Player[] $target )
$index integer
$target pocketmine\Player | pocketmine\Player[]

sendContents() публичный Метод

public sendContents ( Player | Player[] $target )
$target pocketmine\Player | pocketmine\Player[]

sendHeldItem() публичный Метод

public sendHeldItem ( Player | Player[] $target )
$target pocketmine\Player | pocketmine\Player[]

sendSlot() публичный Метод

public sendSlot ( integer $index, Player | Player[] $target )
$index integer
$target pocketmine\Player | pocketmine\Player[]

setArmorContents() публичный Метод

public setArmorContents ( array $items )
$items array

setArmorItem() публичный Метод

public setArmorItem ( $index, Item $item )
$item pocketmine\item\Item

setBoots() публичный Метод

public setBoots ( Item $boots )
$boots pocketmine\item\Item

setChestplate() публичный Метод

public setChestplate ( Item $chestplate )
$chestplate pocketmine\item\Item

setHeldItemIndex() публичный Метод

public setHeldItemIndex ( integer $hotbarSlotIndex, boolean $sendToHolder = true, integer $slotMapping = null )
$hotbarSlotIndex integer
$sendToHolder boolean
$slotMapping integer 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() публичный Метод

Устаревший:
public setHeldItemSlot ( integer $slot )
$slot integer

setHelmet() публичный Метод

public setHelmet ( Item $helmet )
$helmet pocketmine\item\Item

setHotbarSlotIndex() публичный Метод

Устаревший: Changes the linkage of the specified hotbar slot. This should never be done unless it is requested by the client.
public setHotbarSlotIndex ( $index, $slot )

setItem() публичный Метод

public setItem ( $index, Item $item, $send = true )
$item pocketmine\item\Item

setItemInHand() публичный Метод

public setItemInHand ( Item $item ) : boolean
$item pocketmine\item\Item
Результат boolean Sets the item in the inventory slot the player is currently holding.

setLeggings() публичный Метод

public setLeggings ( Item $leggings )
$leggings pocketmine\item\Item

setSize() публичный Метод

public setSize ( $size )

Описание свойств

$hotbar защищенное свойство

protected int[] $hotbar
Результат int[]

$itemInHandIndex защищенное свойство

protected $itemInHandIndex