InventoryManager
Constants
ENCHANTING_OPTION_NETWORK_OFFSET 5.46.0
public const ENCHANTING_OPTION_NETWORK_OFFSET = 100000SMITHING_RECIPE_NETWORK_OFFSET 5.46.0
public const SMITHING_RECIPE_NETWORK_OFFSET = 200000Methods
__construct()
public function __construct(\pocketmine\player\Player $player, \pocketmine\network\mcpe\NetworkSession $session)addPredictedSlotChange()
public function addPredictedSlotChange(\pocketmine\inventory\Inventory $inventory, int $slot, \pocketmine\item\Item $item) : voidaddRawPredictedSlotChanges()
public function addRawPredictedSlotChanges(array $networkInventoryActions) : voidaddTransactionPredictedSlotChanges()
public function addTransactionPredictedSlotChanges(\pocketmine\inventory\transaction\InventoryTransaction $tx) : voidcreateContainerOpen() protected
protected static function createContainerOpen(int $id, \pocketmine\inventory\Inventory $inv) : ?arraycreateHorseEquipPacket() 5.46.0
public static function createHorseEquipPacket(int $windowId, \pocketmine\inventory\HorseInventory $inventory) : \pocketmine\network\mcpe\protocol\UpdateEquipPacketThe slots of a horse screen, sent after its ContainerOpen (BDS does so, per gophertunnel's UpdateEquip docs): what each equipment slot accepts and the icon of the empty slot, built like GeyserMC's mount screens. Slot 0 is the saddle (or a llama's carpet), slot 1 the body armor (horse or nautilus armor).
createTradePacket() 5.46.0
public static function createTradePacket(int $windowId, \pocketmine\inventory\TradeInventory $inventory) : \pocketmine\network\mcpe\protocol\UpdateTradePacketTrading screen of a villager or wandering trader (the client opens it on UpdateTradePacket instead of ContainerOpen). Offers are the vanilla "Recipes" list (see \pocketmine\entity\npc\TradeOffer::toNbt()).
flushBundleWritebacks() 5.46.0
public function flushBundleWritebacks() : voidWrites the contents of bundle containers changed by the last transaction back to their bundles. Like the client, the contents are compacted (no gaps between stacks); stack IDs move with their items, since the client moves them the same way.
flushPendingUpdates()
public function flushPendingUpdates() : voidgetBundleContainerById() 5.46.0
public function getBundleContainerById(int $dynamicId) : ?\pocketmine\network\mcpe\BundleContainergetBundleContainerByInventory() 5.46.0
public function getBundleContainerByInventory(\pocketmine\inventory\Inventory $inventory) : ?\pocketmine\network\mcpe\BundleContainerReturns the bundle container mirrored by the given inventory, if it is one.
getContainerOpenCallbacks()
public function getContainerOpenCallbacks() : \pocketmine\utils\ObjectSetgetCurrentWindowId()
public function getCurrentWindowId() : intgetEnchantingTableOptionIndex()
public function getEnchantingTableOptionIndex(int $recipeId) : ?intgetItemStackInfo()
public function getItemStackInfo(\pocketmine\inventory\Inventory $inventory, int $slot) : ?\pocketmine\network\mcpe\ItemStackInfogetWindowId()
public function getWindowId(\pocketmine\inventory\Inventory $inventory) : ?intlocateBundleContainerSlot() 5.46.0
public function locateBundleContainerSlot(int $dynamicId, int $slot) : ?arrayReturns the inventory mirroring a bundle's dynamic container and the slot in it, as referenced by the client with a FullContainerName (DynamicContainer, $dynamicId).
locateWindowAndSlot()
public function locateWindowAndSlot(int $windowId, int $netSlotId) : ?arrayonBundleMoved() 5.46.0
public function onBundleMoved(\pocketmine\inventory\Inventory $inventoryA, int $slotA, \pocketmine\inventory\Inventory $inventoryB, int $slotB) : voidCalled when an ItemStackRequest moves or swaps bundles between two slots, so that the bundles keep their dynamic containers: the client keeps the bundle_id of a bundle it moves.
onClientOpenMainInventory()
public function onClientOpenMainInventory() : voidonClientRemoveWindow()
public function onClientRemoveWindow(int $id) : voidonClientSelectHotbarSlot()
public function onClientSelectHotbarSlot(int $slot) : voidonCurrentWindowChange()
public function onCurrentWindowChange(\pocketmine\inventory\Inventory $inventory) : voidonCurrentWindowRemove()
public function onCurrentWindowRemove() : voidonSlotChange()
public function onSlotChange(\pocketmine\inventory\Inventory $inventory, int $slot) : voidrequestSyncAll()
public function requestSyncAll() : voidsetCurrentItemStackRequestId()
public function setCurrentItemStackRequestId(?int $id) : voidsyncAll()
public function syncAll() : voidsyncContents()
public function syncContents(\pocketmine\inventory\Inventory $inventory) : voidsyncCreative()
public function syncCreative() : voidsyncData()
public function syncData(\pocketmine\inventory\Inventory $inventory, int $propertyId, int $value) : voidsyncEnchantingTableOptions()
public function syncEnchantingTableOptions(array $options) : voidsyncMismatchedPredictedSlotChanges()
public function syncMismatchedPredictedSlotChanges() : voidsyncSelectedHotbarSlot()
public function syncSelectedHotbarSlot() : voidsyncSlot()
public function syncSlot(\pocketmine\inventory\Inventory $inventory, int $slot, \pocketmine\network\mcpe\protocol\types\inventory\ItemStack $itemStack) : voidsyncTrades() 5.46.0
public function syncTrades(\pocketmine\inventory\TradeInventory $inventory) : voidSends the trades again (after a trade changed their uses or the trader's level).
