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