inventory = new BarrelInventory($this->position); } public function readSaveData(CompoundTag $nbt) : void{ $this->loadName($nbt); $this->loadItems($nbt); } protected function writeSaveData(CompoundTag $nbt) : void{ $this->saveName($nbt); $this->saveItems($nbt); } public function close() : void{ if(!$this->closed){ $this->inventory->removeAllViewers(); parent::close(); } } /** * @return BarrelInventory */ public function getInventory(){ return $this->inventory; } /** * @return BarrelInventory */ public function getRealInventory(){ return $this->inventory; } public function getDefaultName() : string{ return "Barrel"; } }