mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Avoid more $this refs on long-life closures
This commit is contained in:
@ -54,8 +54,8 @@ class BrewingStand extends Spawnable implements Container, Nameable{
|
||||
public function __construct(World $world, Vector3 $pos){
|
||||
parent::__construct($world, $pos);
|
||||
$this->inventory = new BrewingStandInventory($this->pos);
|
||||
$this->inventory->getListeners()->add(CallbackInventoryListener::onAnyChange(function(Inventory $unused) : void{
|
||||
$this->pos->getWorld()->scheduleDelayedBlockUpdate($this->pos, 1);
|
||||
$this->inventory->getListeners()->add(CallbackInventoryListener::onAnyChange(static function(Inventory $unused) use ($world, $pos) : void{
|
||||
$world->scheduleDelayedBlockUpdate($pos, 1);
|
||||
}));
|
||||
}
|
||||
|
||||
|
@ -58,8 +58,8 @@ class Furnace extends Spawnable implements Container, Nameable{
|
||||
parent::__construct($world, $pos);
|
||||
$this->inventory = new FurnaceInventory($this->pos);
|
||||
$this->inventory->getListeners()->add(CallbackInventoryListener::onAnyChange(
|
||||
function(Inventory $unused) : void{
|
||||
$this->pos->getWorld()->scheduleDelayedBlockUpdate($this->pos, 1);
|
||||
static function(Inventory $unused) use ($world, $pos) : void{
|
||||
$world->scheduleDelayedBlockUpdate($pos, 1);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user