Fixed tile and furnace custom names not being visible

This is caused by the Spawnable constructor calling spawnToAll() before the tile is fully initialized. I really really really hate constructors that _DO_ things by themselves.
This commit is contained in:
Dylan K. Taylor 2018-06-03 17:01:16 +01:00
parent b6317fa7ce
commit a22e5616f6
2 changed files with 6 additions and 2 deletions

View File

@ -56,11 +56,13 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
$this->pairZ = $nbt->getInt(self::TAG_PAIRZ);
}
$nbt->removeTag(self::TAG_PAIRX, self::TAG_PAIRZ);
$this->loadName($nbt);
parent::__construct($level, $nbt);
$this->inventory = new ChestInventory($this);
$this->loadItems($this->namedtag);
$this->loadName($this->namedtag);
}
public function close() : void{

View File

@ -68,10 +68,12 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
$this->maxTime = $this->burnTime;
}
$this->loadName($nbt);
parent::__construct($level, $nbt);
$this->inventory = new FurnaceInventory($this);
$this->loadItems($this->namedtag);
$this->loadName($this->namedtag);
if($this->burnTime > 0){
$this->scheduleUpdate();