Tile: make ContainerTrait and NameableTrait non-dependent on context-retained NBT

This commit is contained in:
Dylan K. Taylor
2018-06-03 16:32:05 +01:00
parent 7b7917939a
commit b1cb63ebd6
6 changed files with 53 additions and 30 deletions

View File

@ -59,7 +59,8 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
parent::__construct($level, $nbt);
$this->inventory = new ChestInventory($this);
$this->loadItems();
$this->loadItems($this->namedtag);
$this->loadName($this->namedtag);
}
public function close() : void{
@ -86,7 +87,8 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
}else{
$this->namedtag->removeTag(self::TAG_PAIRX, self::TAG_PAIRZ);
}
$this->saveItems();
$this->saveItems($this->namedtag);
$this->saveName($this->namedtag);
}
/**