pocketmine\inventory\InventoryType::getDefaultSize PHP Method

getDefaultSize() public method

public getDefaultSize ( ) : integer
return integer
    public function getDefaultSize()
    {
        return $this->size;
    }

Usage Example

Example #1
0
 /**
  * @param InventoryHolder $holder
  * @param InventoryType   $type
  * @param Item[]          $items
  * @param int             $overrideSize
  * @param string          $overrideTitle
  */
 public function __construct(InventoryHolder $holder, InventoryType $type, array $items = [], $overrideSize = \null, $overrideTitle = \null)
 {
     $this->holder = $holder;
     $this->type = $type;
     if ($overrideSize !== \null) {
         $this->size = (int) $overrideSize;
     } else {
         $this->size = $this->type->getDefaultSize();
     }
     if ($overrideTitle !== \null) {
         $this->title = $overrideTitle;
     } else {
         $this->title = $this->type->getDefaultTitle();
     }
     $this->name = $this->type->getDefaultTitle();
     $this->setContents($items);
 }