From 4198c445b05c8808f94eeb145738fd36f850b34d Mon Sep 17 00:00:00 2001 From: dktapps Date: Tue, 6 Sep 2016 19:14:24 +0100 Subject: [PATCH] Fixed Furnace crash --- src/pocketmine/tile/Furnace.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/pocketmine/tile/Furnace.php b/src/pocketmine/tile/Furnace.php index f972597e9..0c13a8d20 100644 --- a/src/pocketmine/tile/Furnace.php +++ b/src/pocketmine/tile/Furnace.php @@ -32,13 +32,14 @@ use pocketmine\level\format\FullChunk; use pocketmine\nbt\NBT; use pocketmine\nbt\tag\CompoundTag; +use pocketmine\nbt\tag\IntTag; use pocketmine\nbt\tag\ListTag; use pocketmine\nbt\tag\ShortTag; use pocketmine\nbt\tag\StringTag; use pocketmine\network\Network; use pocketmine\network\protocol\ContainerSetDataPacket; -class Furnace extends Tile implements InventoryHolder, Container, Nameable{ +class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{ /** @var FurnaceInventory */ protected $inventory; @@ -286,4 +287,20 @@ class Furnace extends Tile implements InventoryHolder, Container, Nameable{ return $ret; } + + public function getSpawnCompound(){ + $nbt = new CompoundTag("", [ + new StringTag("id", Tile::FURNACE), + new IntTag("x", (int) $this->x), + new IntTag("y", (int) $this->y), + new IntTag("z", (int) $this->z), + new ShortTag("BurnTime", $this->namedtag["BurnTime"]), + new ShortTag("CookTime", $this->namedtag["CookTime"]) + ]); + + if($this->hasName()){ + $nbt->CustomName = $this->namedtag->CustomName; + } + return $nbt; + } }