mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 12:27:51 +00:00
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:
parent
b6317fa7ce
commit
a22e5616f6
@ -56,11 +56,13 @@ class Chest extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
$this->pairZ = $nbt->getInt(self::TAG_PAIRZ);
|
$this->pairZ = $nbt->getInt(self::TAG_PAIRZ);
|
||||||
}
|
}
|
||||||
$nbt->removeTag(self::TAG_PAIRX, self::TAG_PAIRZ);
|
$nbt->removeTag(self::TAG_PAIRX, self::TAG_PAIRZ);
|
||||||
|
$this->loadName($nbt);
|
||||||
|
|
||||||
parent::__construct($level, $nbt);
|
parent::__construct($level, $nbt);
|
||||||
|
|
||||||
$this->inventory = new ChestInventory($this);
|
$this->inventory = new ChestInventory($this);
|
||||||
$this->loadItems($this->namedtag);
|
$this->loadItems($this->namedtag);
|
||||||
$this->loadName($this->namedtag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function close() : void{
|
public function close() : void{
|
||||||
|
@ -68,10 +68,12 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
|
|||||||
$this->maxTime = $this->burnTime;
|
$this->maxTime = $this->burnTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->loadName($nbt);
|
||||||
|
|
||||||
parent::__construct($level, $nbt);
|
parent::__construct($level, $nbt);
|
||||||
$this->inventory = new FurnaceInventory($this);
|
$this->inventory = new FurnaceInventory($this);
|
||||||
$this->loadItems($this->namedtag);
|
$this->loadItems($this->namedtag);
|
||||||
$this->loadName($this->namedtag);
|
|
||||||
|
|
||||||
if($this->burnTime > 0){
|
if($this->burnTime > 0){
|
||||||
$this->scheduleUpdate();
|
$this->scheduleUpdate();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user