GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
TemporaryInventory Class Reference

Public Member Functions

 getResultSlotIndex ()
 
 onClose (Player $who)
 
- Public Member Functions inherited from ContainerInventory
 onOpen (Player $who)
 
 onClose (Player $who)
 
- Public Member Functions inherited from BaseInventory
 __construct (InventoryHolder $holder, InventoryType $type, array $items=[], $overrideSize=null, $overrideTitle=null)
 
 __destruct ()
 
 getSize ()
 
 getHotbarSize ()
 
 setSize ($size)
 
 getMaxStackSize ()
 
 getName ()
 
 getTitle ()
 
 getItem ($index)
 
 getContents ()
 
 setContents (array $items, $send=true)
 
 setItem ($index, Item $item, $send=true)
 
 contains (Item $item)
 
 slotContains ($slot, Item $item, $matchCount=false)
 
 all (Item $item)
 
 remove (Item $item, $send=true)
 
 first (Item $item)
 
 firstEmpty ()
 
 firstOccupied ()
 
 canAddItem (Item $item)
 
 clear ($index, $send=true)
 
 clearAll ($send=true)
 
 getViewers ()
 
 getHolder ()
 
 setMaxStackSize ($size)
 
 open (Player $who)
 
 close (Player $who)
 
 onOpen (Player $who)
 
 onClose (Player $who)
 
 onSlotChange ($index, $before, $send)
 
 processSlotChange (Transaction $transaction)
 
 sendContents ($target)
 
 sendSlot ($index, $target)
 
 getType ()
 
- Public Member Functions inherited from Inventory
 setItem ($index, Item $item)
 
 addItem (... $slots)
 
 removeItem (... $slots)
 
 setContents (array $items)
 
 remove (Item $item)
 
 clear ($index)
 
 clearAll ()
 

Additional Inherited Members

- Data Fields inherited from Inventory
const MAX_STACK = 64
 
- Protected Attributes inherited from BaseInventory
 $type
 
 $maxStackSize = Inventory::MAX_STACK
 
 $size
 
 $name
 
 $title
 
 $slots = []
 
 $viewers = []
 
 $holder
 

Member Function Documentation

◆ getResultSlotIndex()

getResultSlotIndex ( )
abstract
Returns
mixed

◆ onClose()

onClose ( Player  $who)
Parameters
Player$who

Implements Inventory.

38  {
39  foreach($this->getContents() as $slot => $item){
40  if($slot === $this->getResultSlotIndex()){
41  //Do not drop the item in the result slot - it is a virtual item and does not actually exist.
42  continue;
43  }
44  $who->dropItem($item);
45  }
46  $this->clearAll();
47  }

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