mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
Remove useless $items parameter from inventory constructors
This commit is contained in:
parent
94ee33e47b
commit
8ec25b59a3
@ -44,13 +44,10 @@ abstract class BaseInventory implements Inventory{
|
||||
protected $listeners = [];
|
||||
|
||||
/**
|
||||
* @param int $size
|
||||
* @param Item[] $items
|
||||
* @param int $size
|
||||
*/
|
||||
public function __construct(int $size, array $items = []){
|
||||
public function __construct(int $size){
|
||||
$this->slots = new \SplFixedArray($size);
|
||||
|
||||
$this->setContents($items, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -29,9 +29,9 @@ abstract class BlockInventory extends BaseInventory{
|
||||
/** @var Vector3 */
|
||||
protected $holder;
|
||||
|
||||
public function __construct(Vector3 $holder, int $size, array $items = []){
|
||||
public function __construct(Vector3 $holder, int $size){
|
||||
$this->holder = $holder;
|
||||
parent::__construct($size, $items);
|
||||
parent::__construct($size);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class BrewingStandInventory extends BlockInventory{
|
||||
|
||||
public function __construct(Vector3 $holder, int $size = 5, array $items = []){
|
||||
parent::__construct($holder, $size, $items);
|
||||
public function __construct(Vector3 $holder, int $size = 5){
|
||||
parent::__construct($holder, $size);
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ namespace pocketmine\inventory;
|
||||
use pocketmine\block\tile\Chest;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\player\Player;
|
||||
use function array_merge;
|
||||
use function count;
|
||||
|
||||
class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
||||
@ -38,8 +37,7 @@ class DoubleChestInventory extends ChestInventory implements InventoryHolder{
|
||||
public function __construct(Chest $left, Chest $right){
|
||||
$this->left = $left->getRealInventory();
|
||||
$this->right = $right->getRealInventory();
|
||||
$items = array_merge($this->left->getContents(true), $this->right->getContents(true));
|
||||
BaseInventory::__construct($this->left->getSize() + $this->right->getSize(), $items);
|
||||
BaseInventory::__construct($this->left->getSize() + $this->right->getSize());
|
||||
}
|
||||
|
||||
public function getInventory(){
|
||||
|
@ -27,7 +27,7 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class HopperInventory extends BlockInventory{
|
||||
|
||||
public function __construct(Vector3 $holder, int $size = 5, array $items = []){
|
||||
parent::__construct($holder, $size, $items);
|
||||
public function __construct(Vector3 $holder, int $size = 5){
|
||||
parent::__construct($holder, $size);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user