diff --git a/src/pocketmine/tile/Chest.php b/src/pocketmine/tile/Chest.php index f6bf1d01f..569188933 100644 --- a/src/pocketmine/tile/Chest.php +++ b/src/pocketmine/tile/Chest.php @@ -46,6 +46,12 @@ class Chest extends Spawnable implements InventoryHolder, Container{ $nbt["id"] = Tile::CHEST; parent::__construct($chunk, $nbt); $this->inventory = new ChestInventory($this); + + if(!isset($this->namedtag->Items) or !($this->namedtag->Items instanceof Enum)){ + $this->namedtag->Items = new Enum("Inventory", []); + $this->namedtag->Items->setTagType(NBT::TAG_Compound); + } + for($i = 0; $i < $this->getSize(); ++$i){ $this->inventory->setItem($i, $this->getItem($i)); } diff --git a/src/pocketmine/tile/Furnace.php b/src/pocketmine/tile/Furnace.php index 7a538a9c7..4143b6946 100644 --- a/src/pocketmine/tile/Furnace.php +++ b/src/pocketmine/tile/Furnace.php @@ -45,6 +45,11 @@ class Furnace extends Tile implements InventoryHolder, Container{ $this->inventory->setItem($i, $this->getItem($i)); } + if(!isset($this->namedtag->Items) or !($this->namedtag->Items instanceof Enum)){ + $this->namedtag->Items = new Enum("Inventory", []); + $this->namedtag->Items->setTagType(NBT::TAG_Compound); + } + if(!isset($this->namedtag->BurnTime) or $this->namedtag["BurnTime"] < 0){ $this->namedtag->BurnTime = new Short("BurnTime", 0); }