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:
Dylan K. Taylor 2019-06-13 17:24:17 +01:00
parent f128fc1849
commit 7ba1dd3242
3 changed files with 0 additions and 18 deletions

View File

@ -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;
}

View File

@ -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();

View File

@ -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