InventoryManager
in package
Tags
Table of Contents
- HARDCODED_INVENTORY_WINDOW_ID = self::RESERVED_WINDOW_ID_RANGE_START + 2
- RESERVED_WINDOW_ID_RANGE_START = \pocketmine\network\mcpe\protocol\types\inventory\ContainerIds::LAST - 10
- $clientSelectedHotbarSlot : int
- $containerOpenCallbacks : ObjectSet
- $initiatedSlotChanges : array<string|int, array<string|int, Item>>
- $lastInventoryNetworkId : int
- $player : Player
- $session : NetworkSession
- $windowMap : array<string|int, Inventory>
- __construct() : mixed
- getContainerOpenCallbacks() : ObjectSet
- getCurrentWindowId() : int
- getWindow() : Inventory|null
- getWindowId() : int|null
- onClientOpenMainInventory() : void
- onClientRemoveWindow() : void
- onClientSelectHotbarSlot() : void
- onCurrentWindowChange() : void
- onCurrentWindowRemove() : void
- onTransactionStart() : void
- syncAll() : void
- syncContents() : void
- syncCreative() : void
- syncData() : void
- syncSelectedHotbarSlot() : void
- syncSlot() : void
- createContainerOpen() : array<string|int, ClientboundPacket>|null
- add() : void
- remove() : void
Constants
HARDCODED_INVENTORY_WINDOW_ID
private
mixed
HARDCODED_INVENTORY_WINDOW_ID
= self::RESERVED_WINDOW_ID_RANGE_START + 2
RESERVED_WINDOW_ID_RANGE_START
private
mixed
RESERVED_WINDOW_ID_RANGE_START
= \pocketmine\network\mcpe\protocol\types\inventory\ContainerIds::LAST - 10
Properties
$clientSelectedHotbarSlot
private
int
$clientSelectedHotbarSlot
= -1
$containerOpenCallbacks
private
ObjectSet
$containerOpenCallbacks
Tags
$initiatedSlotChanges
private
array<string|int, array<string|int, Item>>
$initiatedSlotChanges
= []
Tags
$lastInventoryNetworkId
private
int
$lastInventoryNetworkId
= \pocketmine\network\mcpe\protocol\types\inventory\ContainerIds::FIRST
$player
private
Player
$player
$session
private
NetworkSession
$session
$windowMap
private
array<string|int, Inventory>
$windowMap
= []
Methods
__construct()
public
__construct(Player $player, NetworkSession $session) : mixed
Parameters
- $player : Player
- $session : NetworkSession
Return values
mixed —getContainerOpenCallbacks()
public
getContainerOpenCallbacks() : ObjectSet
Tags
Return values
ObjectSet —getCurrentWindowId()
public
getCurrentWindowId() : int
Return values
int —getWindow()
public
getWindow(int $windowId) : Inventory|null
Parameters
- $windowId : int
Return values
Inventory|null —getWindowId()
public
getWindowId(Inventory $inventory) : int|null
Parameters
- $inventory : Inventory
Return values
int|null —onClientOpenMainInventory()
public
onClientOpenMainInventory() : void
Return values
void —onClientRemoveWindow()
public
onClientRemoveWindow(int $id) : void
Parameters
- $id : int
Return values
void —onClientSelectHotbarSlot()
public
onClientSelectHotbarSlot(int $slot) : void
Parameters
- $slot : int
Return values
void —onCurrentWindowChange()
public
onCurrentWindowChange(Inventory $inventory) : void
Parameters
- $inventory : Inventory
Return values
void —onCurrentWindowRemove()
public
onCurrentWindowRemove() : void
Return values
void —onTransactionStart()
public
onTransactionStart(InventoryTransaction $tx) : void
Parameters
- $tx : InventoryTransaction
Return values
void —syncAll()
public
syncAll() : void
Return values
void —syncContents()
public
syncContents(Inventory $inventory) : void
Parameters
- $inventory : Inventory
Return values
void —syncCreative()
public
syncCreative() : void
Return values
void —syncData()
public
syncData(Inventory $inventory, int $propertyId, int $value) : void
Parameters
- $inventory : Inventory
- $propertyId : int
- $value : int
Return values
void —syncSelectedHotbarSlot()
public
syncSelectedHotbarSlot() : void
Return values
void —syncSlot()
public
syncSlot(Inventory $inventory, int $slot) : void
Parameters
- $inventory : Inventory
- $slot : int
Return values
void —createContainerOpen()
protected
static createContainerOpen(int $id, Inventory $inv) : array<string|int, ClientboundPacket>|null
Parameters
- $id : int
- $inv : Inventory
Tags
Return values
array<string|int, ClientboundPacket>|null —add()
private
add(int $id, Inventory $inventory) : void
Parameters
- $id : int
- $inventory : Inventory
Return values
void —remove()
private
remove(int $id) : void
Parameters
- $id : int