mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Promote some constructors
This commit is contained in:
@ -33,12 +33,10 @@ use pocketmine\world\sound\Sound;
|
||||
class DoubleChestInventory extends BaseInventory implements BlockInventory, InventoryHolder{
|
||||
use AnimatedBlockInventoryTrait;
|
||||
|
||||
private ChestInventory $left;
|
||||
private ChestInventory $right;
|
||||
|
||||
public function __construct(ChestInventory $left, ChestInventory $right){
|
||||
$this->left = $left;
|
||||
$this->right = $right;
|
||||
public function __construct(
|
||||
private ChestInventory $left,
|
||||
private ChestInventory $right
|
||||
){
|
||||
$this->holder = $this->left->getHolder();
|
||||
parent::__construct();
|
||||
}
|
||||
|
@ -43,12 +43,12 @@ class EnderChestInventory extends DelegateInventory implements BlockInventory{
|
||||
onClose as animatedBlockInventoryTrait_onClose;
|
||||
}
|
||||
|
||||
private PlayerEnderInventory $inventory;
|
||||
|
||||
public function __construct(Position $holder, PlayerEnderInventory $inventory){
|
||||
public function __construct(
|
||||
Position $holder,
|
||||
private PlayerEnderInventory $inventory
|
||||
){
|
||||
parent::__construct($inventory);
|
||||
$this->holder = $holder;
|
||||
$this->inventory = $inventory;
|
||||
}
|
||||
|
||||
public function getEnderInventory() : PlayerEnderInventory{
|
||||
|
@ -35,11 +35,11 @@ class FurnaceInventory extends SimpleInventory implements BlockInventory{
|
||||
public const SLOT_FUEL = 1;
|
||||
public const SLOT_RESULT = 2;
|
||||
|
||||
private FurnaceType $furnaceType;
|
||||
|
||||
public function __construct(Position $holder, FurnaceType $furnaceType){
|
||||
public function __construct(
|
||||
Position $holder,
|
||||
private FurnaceType $furnaceType
|
||||
){
|
||||
$this->holder = $holder;
|
||||
$this->furnaceType = $furnaceType;
|
||||
parent::__construct(3);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user