Skip to content

SimpleInventory ​

class · pocketmine\inventory\SimpleInventory · source

Extends BaseInventory

This class provides a complete implementation of a regular inventory.

Properties ​

$slots protected ​

php
protected \SplFixedArray $slots

Methods ​

__construct() ​

php
public function __construct(int $size)

getContents() ​

php
public function getContents(bool $includeEmpty = false) : array

getItem() ​

php
public function getItem(int $index) : \pocketmine\item\Item

getMatchingItemCount() protected ​

php
protected function getMatchingItemCount(int $slot, \pocketmine\item\Item $test, bool $checkTags) : int

getSize() ​

php
public function getSize() : int

Returns the size of the inventory.

internalSetContents() protected ​

php
protected function internalSetContents(array $items) : void

internalSetItem() protected ​

php
protected function internalSetItem(int $index, \pocketmine\item\Item $item) : void

isSlotEmpty() ​

php
public function isSlotEmpty(int $index) : bool

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.