mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Promote some constructors
This commit is contained in:
@ -31,13 +31,12 @@ use function count;
|
||||
* An inventory which is backed by another inventory, and acts as a proxy to that inventory.
|
||||
*/
|
||||
class DelegateInventory extends BaseInventory{
|
||||
|
||||
private Inventory $backingInventory;
|
||||
private InventoryListener $inventoryListener;
|
||||
|
||||
public function __construct(Inventory $backingInventory){
|
||||
public function __construct(
|
||||
private Inventory $backingInventory
|
||||
){
|
||||
parent::__construct();
|
||||
$this->backingInventory = $backingInventory;
|
||||
$this->backingInventory->getListeners()->add($this->inventoryListener = new CallbackInventoryListener(
|
||||
function(Inventory $unused, int $slot, Item $oldItem) : void{
|
||||
$this->onSlotChange($slot, $oldItem);
|
||||
|
@ -26,11 +26,10 @@ namespace pocketmine\inventory;
|
||||
use pocketmine\entity\Human;
|
||||
|
||||
final class PlayerEnderInventory extends SimpleInventory{
|
||||
|
||||
private Human $holder;
|
||||
|
||||
public function __construct(Human $holder, int $size = 27){
|
||||
$this->holder = $holder;
|
||||
public function __construct(
|
||||
private Human $holder,
|
||||
int $size = 27
|
||||
){
|
||||
parent::__construct($size);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user