Promote some constructors

This commit is contained in:
Dylan K. Taylor
2022-05-17 22:34:58 +01:00
parent 8e767da29e
commit d4b7f66e15
30 changed files with 144 additions and 218 deletions

View File

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

View File

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

View File

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