mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
BaseInventory: remove setSize()
no inventory is designed to deal with this. Changing this can break transactions, specialized logic like double chest / furnace and more.
This commit is contained in:
parent
f128fc1849
commit
7ba1dd3242
@ -62,16 +62,6 @@ abstract class BaseInventory implements Inventory{
|
||||
return $this->slots->getSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the new size of the inventory.
|
||||
* WARNING: If the size is smaller, any items past the new size will be lost.
|
||||
*
|
||||
* @param int $size
|
||||
*/
|
||||
public function setSize(int $size) : void{
|
||||
$this->slots->setSize($size);
|
||||
}
|
||||
|
||||
public function getMaxStackSize() : int{
|
||||
return $this->maxStackSize;
|
||||
}
|
||||
|
@ -57,10 +57,6 @@ class CraftingGrid extends BaseInventory{
|
||||
return $this->gridWidth;
|
||||
}
|
||||
|
||||
public function setSize(int $size) : void{
|
||||
throw new \BadMethodCallException("Cannot change the size of a crafting grid");
|
||||
}
|
||||
|
||||
public function setItem(int $index, Item $item, bool $send = true) : void{
|
||||
parent::setItem($index, $item, $send);
|
||||
$this->seekRecipeBounds();
|
||||
|
@ -34,10 +34,6 @@ class PlayerCursorInventory extends BaseInventory{
|
||||
parent::__construct(1);
|
||||
}
|
||||
|
||||
public function setSize(int $size) : void{
|
||||
throw new \BadMethodCallException("Cursor can only carry one item at a time");
|
||||
}
|
||||
|
||||
/**
|
||||
* This override is here for documentation and code completion purposes only.
|
||||
* @return Player
|
||||
|
Loading…
x
Reference in New Issue
Block a user