PocketMine-MP 5.30.2 git-98f04176111e5ecab5e8814ffc69d992bfb64939
Loading...
Searching...
No Matches
pocketmine\network\mcpe\InventoryManager Class Reference
+ Collaboration diagram for pocketmine\network\mcpe\InventoryManager:

Public Member Functions

 __construct (private Player $player, private NetworkSession $session)
 
 addPredictedSlotChange (Inventory $inventory, int $slot, Item $item)
 
 addRawPredictedSlotChanges (array $networkInventoryActions)
 
 addTransactionPredictedSlotChanges (InventoryTransaction $tx)
 
 flushPendingUpdates ()
 
 getContainerOpenCallbacks ()
 
 getCurrentWindowId ()
 
 getEnchantingTableOptionIndex (int $recipeId)
 
 getItemStackInfo (Inventory $inventory, int $slot)
 
 getWindowId (Inventory $inventory)
 
 locateWindowAndSlot (int $windowId, int $netSlotId)
 
 onClientOpenMainInventory ()
 
 onClientRemoveWindow (int $id)
 
 onClientSelectHotbarSlot (int $slot)
 
 onCurrentWindowChange (Inventory $inventory)
 
 onCurrentWindowRemove ()
 
 onSlotChange (Inventory $inventory, int $slot)
 
 requestSyncAll ()
 
 setCurrentItemStackRequestId (?int $id)
 
 syncAll ()
 
 syncContents (Inventory $inventory)
 
 syncCreative ()
 
 syncData (Inventory $inventory, int $propertyId, int $value)
 
 syncEnchantingTableOptions (array $options)
 
 syncMismatchedPredictedSlotChanges ()
 
 syncSelectedHotbarSlot ()
 
 syncSlot (Inventory $inventory, int $slot, ItemStack $itemStack)
 

Static Protected Member Functions

static createContainerOpen (int $id, Inventory $inv)
 

Detailed Description

@phpstan-type ContainerOpenClosure \Closure(int $id, Inventory $inventory) : (list<ClientboundPacket>|null)

Definition at line 82 of file InventoryManager.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\network\mcpe\InventoryManager::__construct ( private Player $player,
private NetworkSession $session )

Definition at line 123 of file InventoryManager.php.

Member Function Documentation

◆ addPredictedSlotChange()

pocketmine\network\mcpe\InventoryManager::addPredictedSlotChange ( Inventory $inventory,
int $slot,
Item $item )

Definition at line 236 of file InventoryManager.php.

◆ addRawPredictedSlotChanges()

pocketmine\network\mcpe\InventoryManager::addRawPredictedSlotChanges ( array $networkInventoryActions)
Parameters
NetworkInventoryAction[]$networkInventoryActions
Exceptions
PacketHandlingException

Definition at line 259 of file InventoryManager.php.

◆ addTransactionPredictedSlotChanges()

pocketmine\network\mcpe\InventoryManager::addTransactionPredictedSlotChanges ( InventoryTransaction $tx)

Definition at line 242 of file InventoryManager.php.

◆ createContainerOpen()

static pocketmine\network\mcpe\InventoryManager::createContainerOpen ( int $id,
Inventory $inv )
staticprotected
Returns
ClientboundPacket[]|null @phpstan-return list<ClientboundPacket>|null

Definition at line 365 of file InventoryManager.php.

◆ flushPendingUpdates()

pocketmine\network\mcpe\InventoryManager::flushPendingUpdates ( )

Definition at line 646 of file InventoryManager.php.

◆ getContainerOpenCallbacks()

pocketmine\network\mcpe\InventoryManager::getContainerOpenCallbacks ( )

@phpstan-return ObjectSet<ContainerOpenClosure>

Definition at line 359 of file InventoryManager.php.

◆ getCurrentWindowId()

pocketmine\network\mcpe\InventoryManager::getCurrentWindowId ( )

Definition at line 208 of file InventoryManager.php.

◆ getEnchantingTableOptionIndex()

pocketmine\network\mcpe\InventoryManager::getEnchantingTableOptionIndex ( int $recipeId)

Definition at line 735 of file InventoryManager.php.

◆ getItemStackInfo()

pocketmine\network\mcpe\InventoryManager::getItemStackInfo ( Inventory $inventory,
int $slot )

Definition at line 743 of file InventoryManager.php.

◆ getWindowId()

pocketmine\network\mcpe\InventoryManager::getWindowId ( Inventory $inventory)

Definition at line 204 of file InventoryManager.php.

◆ locateWindowAndSlot()

pocketmine\network\mcpe\InventoryManager::locateWindowAndSlot ( int $windowId,
int $netSlotId )

@phpstan-return array{Inventory, int}|null

Definition at line 215 of file InventoryManager.php.

References pocketmine\inventory\Inventory\slotExists().

+ Here is the call graph for this function:

◆ onClientOpenMainInventory()

pocketmine\network\mcpe\InventoryManager::onClientOpenMainInventory ( )

Definition at line 393 of file InventoryManager.php.

◆ onClientRemoveWindow()

pocketmine\network\mcpe\InventoryManager::onClientRemoveWindow ( int $id)

Definition at line 421 of file InventoryManager.php.

◆ onClientSelectHotbarSlot()

pocketmine\network\mcpe\InventoryManager::onClientSelectHotbarSlot ( int $slot)

Definition at line 673 of file InventoryManager.php.

◆ onCurrentWindowChange()

pocketmine\network\mcpe\InventoryManager::onCurrentWindowChange ( Inventory $inventory)

Definition at line 328 of file InventoryManager.php.

◆ onCurrentWindowRemove()

pocketmine\network\mcpe\InventoryManager::onCurrentWindowRemove ( )

Definition at line 409 of file InventoryManager.php.

◆ onSlotChange()

pocketmine\network\mcpe\InventoryManager::onSlotChange ( Inventory $inventory,
int $slot )

Definition at line 480 of file InventoryManager.php.

◆ requestSyncAll()

pocketmine\network\mcpe\InventoryManager::requestSyncAll ( )

Definition at line 624 of file InventoryManager.php.

◆ setCurrentItemStackRequestId()

pocketmine\network\mcpe\InventoryManager::setCurrentItemStackRequestId ( ?int $id)

Definition at line 283 of file InventoryManager.php.

◆ syncAll()

pocketmine\network\mcpe\InventoryManager::syncAll ( )

Definition at line 618 of file InventoryManager.php.

◆ syncContents()

pocketmine\network\mcpe\InventoryManager::syncContents ( Inventory $inventory)

Definition at line 582 of file InventoryManager.php.

◆ syncCreative()

pocketmine\network\mcpe\InventoryManager::syncCreative ( )

Definition at line 701 of file InventoryManager.php.

◆ syncData()

pocketmine\network\mcpe\InventoryManager::syncData ( Inventory $inventory,
int $propertyId,
int $value )

Definition at line 666 of file InventoryManager.php.

◆ syncEnchantingTableOptions()

pocketmine\network\mcpe\InventoryManager::syncEnchantingTableOptions ( array $options)
Parameters
EnchantingOption[]$options@phpstan-param list<EnchantingOption> $options

Definition at line 709 of file InventoryManager.php.

References pocketmine\item\enchantment\EnchantmentInstance\getLevel(), and pocketmine\item\enchantment\EnchantmentInstance\getType().

+ Here is the call graph for this function:

◆ syncMismatchedPredictedSlotChanges()

pocketmine\network\mcpe\InventoryManager::syncMismatchedPredictedSlotChanges ( )

Definition at line 628 of file InventoryManager.php.

◆ syncSelectedHotbarSlot()

pocketmine\network\mcpe\InventoryManager::syncSelectedHotbarSlot ( )

Definition at line 677 of file InventoryManager.php.

◆ syncSlot()

pocketmine\network\mcpe\InventoryManager::syncSlot ( Inventory $inventory,
int $slot,
ItemStack $itemStack )

Definition at line 551 of file InventoryManager.php.


The documentation for this class was generated from the following file: