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

@ -58,7 +58,7 @@ class Furnace extends Spawnable implements Container, Nameable{
public function __construct(World $world, Vector3 $pos){
parent::__construct($world, $pos);
$this->inventory = new FurnaceInventory($this->pos);
$this->inventory->addListeners(CallbackInventoryListener::onAnyChange(
$this->inventory->getListeners()->add(CallbackInventoryListener::onAnyChange(
function(Inventory $unused) : void{
$this->pos->getWorldNonNull()->scheduleDelayedBlockUpdate($this->pos, 1);
})