Inventory: reduce API duplication by using a Set for viewers

This commit is contained in:
Dylan K. Taylor
2020-05-14 14:13:28 +01:00
parent 3dafee6aa6
commit 4437756987
8 changed files with 25 additions and 47 deletions

View File

@ -54,7 +54,7 @@ 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->addListeners(CallbackInventoryListener::onAnyChange(function(Inventory $unused) : void{
$this->inventory->getListeners()->add(CallbackInventoryListener::onAnyChange(function(Inventory $unused) : void{
$this->pos->getWorldNonNull()->scheduleDelayedBlockUpdate($this->pos, 1);
}));
}