PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
pocketmine\inventory\DoubleChestInventory Class Reference
+ Inheritance diagram for pocketmine\inventory\DoubleChestInventory:
+ Collaboration diagram for pocketmine\inventory\DoubleChestInventory:

Public Member Functions

 __construct (Chest $left, Chest $right)
 
 getInventory ()
 
 getHolder ()
 
 getItem ($index)
 
 setItem ($index, Item $item, $source=null)
 
 clear ($index, $source=null)
 
 getContents ()
 
 setContents (array $items)
 
 onOpen (Player $who)
 
 onClose (Player $who)
 
 getLeftSide ()
 
 getRightSide ()
 
 getSize ()
 
 getMaxStackSize ()
 
 getName ()
 
 getTitle ()
 
 contains (Item $item)
 
 all (Item $item)
 
 remove (Item $item)
 
 first (Item $item)
 
 firstEmpty ()
 
 canAddItem (Item $item)
 
 clearAll ()
 
 getViewers ($source=null)
 
 setMaxStackSize ($size)
 
 open (Player $who)
 
 close (Player $who)
 
 onSlotChange ($index, $before, $source=null)
 
 sendContents ($target)
 
 sendSlot ($index, $target)
 
 getType ()
 
 addItem (...$slots)
 
 removeItem (...$slots)
 

Public Attributes

const MAX_STACK = 64
 

Protected Attributes

 $type
 
 $maxStackSize = Inventory::MAX_STACK
 
 $size
 
 $name
 
 $title
 
 $slots = []
 
 $viewers = []
 
 $holder
 

Detailed Description

Definition at line 31 of file DoubleChestInventory.php.

Member Function Documentation

pocketmine\inventory\Inventory::addItem (   $slots)
inherited

Stores the given Items in the inventory. This will try to fill existing stacks and empty slots as well as it can.

Returns the Items that did not fit. A Player source can be set at the end

Parameters
Item...$item
Returns
Item[]
pocketmine\inventory\BaseInventory::all ( Item  $item)
inherited

Will return all the Items that has the same id and metadata (if not null). Won't check amount

Parameters
Item$item
Returns
Item[]

Implements pocketmine\inventory\Inventory.

Definition at line 163 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\getContents().

+ Here is the call graph for this function:

pocketmine\inventory\BaseInventory::canAddItem ( Item  $item)
inherited

Checks if a given Item can be added to the inventory

Parameters
Item$item
Returns
bool

Implements pocketmine\inventory\Inventory.

Definition at line 206 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\getItem().

+ Here is the call graph for this function:

pocketmine\inventory\DoubleChestInventory::clear (   $index,
  $source = null 
)

Will clear a specific slot

Parameters
int$index
Player$source
Returns
bool

Implements pocketmine\inventory\Inventory.

Definition at line 59 of file DoubleChestInventory.php.

pocketmine\inventory\BaseInventory::clearAll ( )
inherited

Clears all the slots

Implements pocketmine\inventory\Inventory.

Definition at line 360 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\clear(), and pocketmine\inventory\BaseInventory\getContents().

+ Here is the call graph for this function:

pocketmine\inventory\BaseInventory::contains ( Item  $item)
inherited

Checks if the inventory contains any Item with the same material data. It will check id, amount, and metadata (if not null)

Parameters
Item$item
Returns
bool

Implements pocketmine\inventory\Inventory.

Definition at line 148 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\getContents().

+ Here is the call graph for this function:

pocketmine\inventory\BaseInventory::first ( Item  $item)
inherited

Will return the first slot has the same id and metadata (if not null) as the Item. -1 if not found, will check amount

Parameters
Item$item
Returns
int

Implements pocketmine\inventory\Inventory.

Definition at line 184 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\getContents().

+ Here is the call graph for this function:

pocketmine\inventory\BaseInventory::firstEmpty ( )
inherited

Returns the first empty slot, or -1 if not found

Returns
int

Implements pocketmine\inventory\Inventory.

Definition at line 196 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\getItem().

+ Here is the call graph for this function:

pocketmine\inventory\DoubleChestInventory::getContents ( )
Returns
Item[]

Implements pocketmine\inventory\Inventory.

Definition at line 63 of file DoubleChestInventory.php.

References pocketmine\inventory\DoubleChestInventory\getItem().

+ Here is the call graph for this function:

pocketmine\inventory\DoubleChestInventory::getHolder ( )
Returns
InventoryHolder

Implements pocketmine\inventory\Inventory.

Definition at line 47 of file DoubleChestInventory.php.

pocketmine\inventory\DoubleChestInventory::getInventory ( )

Get the object related inventory

Returns
Inventory

Implements pocketmine\inventory\InventoryHolder.

Definition at line 43 of file DoubleChestInventory.php.

pocketmine\inventory\DoubleChestInventory::getItem (   $index)
Parameters
int$index
Returns
Item

Implements pocketmine\inventory\Inventory.

Definition at line 51 of file DoubleChestInventory.php.

Referenced by pocketmine\inventory\DoubleChestInventory\getContents().

+ Here is the caller graph for this function:

pocketmine\inventory\DoubleChestInventory::getLeftSide ( )
Returns
ChestInventory

Definition at line 124 of file DoubleChestInventory.php.

pocketmine\inventory\DoubleChestInventory::getRightSide ( )
Returns
ChestInventory

Definition at line 131 of file DoubleChestInventory.php.

pocketmine\inventory\BaseInventory::getType ( )
inherited
Returns
InventoryType

Implements pocketmine\inventory\Inventory.

Definition at line 465 of file BaseInventory.php.

Referenced by pocketmine\inventory\ContainerInventory\onOpen().

+ Here is the caller graph for this function:

pocketmine\inventory\DoubleChestInventory::onClose ( Player  $who)
Parameters
Player$who

Implements pocketmine\inventory\Inventory.

Definition at line 106 of file DoubleChestInventory.php.

References pocketmine\Server\broadcastPacket(), and pocketmine\inventory\BaseInventory\getViewers().

+ Here is the call graph for this function:

pocketmine\inventory\DoubleChestInventory::onOpen ( Player  $who)
Parameters
Player$who

Implements pocketmine\inventory\Inventory.

Definition at line 90 of file DoubleChestInventory.php.

References pocketmine\Server\broadcastPacket(), and pocketmine\inventory\BaseInventory\getViewers().

+ Here is the call graph for this function:

pocketmine\inventory\BaseInventory::onSlotChange (   $index,
  $before,
  $source = null 
)
inherited
Parameters
int$index
Item$before
Player$source

Implements pocketmine\inventory\Inventory.

Definition at line 413 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\getViewers(), and pocketmine\inventory\BaseInventory\sendSlot().

Referenced by pocketmine\inventory\BaseInventory\clear(), and pocketmine\inventory\BaseInventory\setItem().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

pocketmine\inventory\BaseInventory::open ( Player  $who)
inherited

Tries to open the inventory to a player

Parameters
Player$who
Returns
bool

Implements pocketmine\inventory\Inventory.

Definition at line 391 of file BaseInventory.php.

References pocketmine\Player\getServer(), and pocketmine\inventory\BaseInventory\onOpen().

+ Here is the call graph for this function:

pocketmine\inventory\BaseInventory::remove ( Item  $item)
inherited

Will remove all the Items that has the same id and metadata (if not null)

Parameters
Item$item

Implements pocketmine\inventory\Inventory.

Definition at line 175 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\clear(), and pocketmine\inventory\BaseInventory\getContents().

+ Here is the call graph for this function:

pocketmine\inventory\Inventory::removeItem (   $slots)
inherited

Removes the given Item from the inventory. It will return the Items that couldn't be removed. A Player source can be set at the end

Parameters
Item...$item
Returns
Item[]
pocketmine\inventory\BaseInventory::sendContents (   $target)
inherited
Parameters
Player|Player[]$target

Implements pocketmine\inventory\Inventory.

Definition at line 421 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\getItem().

Referenced by pocketmine\inventory\ContainerInventory\onOpen().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

pocketmine\inventory\BaseInventory::sendSlot (   $index,
  $target 
)
inherited
Parameters
int$index
Player|Player[]$target

Implements pocketmine\inventory\Inventory.

Definition at line 446 of file BaseInventory.php.

References pocketmine\inventory\BaseInventory\getItem().

Referenced by pocketmine\inventory\PlayerInventory\clear(), pocketmine\inventory\BaseInventory\clear(), pocketmine\inventory\BaseInventory\onSlotChange(), pocketmine\inventory\BaseInventory\setItem(), and pocketmine\inventory\PlayerInventory\setItem().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

pocketmine\inventory\DoubleChestInventory::setContents ( array  $items)
Parameters
Item[]$items

Implements pocketmine\inventory\Inventory.

Definition at line 75 of file DoubleChestInventory.php.

pocketmine\inventory\DoubleChestInventory::setItem (   $index,
Item  $item,
  $source = null 
)

Puts an Item in a slot. If a plugin refuses the update or $index is invalid, it'll return false If a source Player is specified, it won't send a Inventory update to it

Parameters
int$index
Item$item
Player$source
Returns
bool

Implements pocketmine\inventory\Inventory.

Definition at line 55 of file DoubleChestInventory.php.

pocketmine\inventory\BaseInventory::setMaxStackSize (   $size)
inherited
Parameters
int$size

Implements pocketmine\inventory\Inventory.

Definition at line 387 of file BaseInventory.php.


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