mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 23:59:53 +00:00
Fixed #1530 Container tiles not getting imported right when they are empty
This commit is contained in:
parent
88157d6e99
commit
df68853c76
@ -46,6 +46,12 @@ class Chest extends Spawnable implements InventoryHolder, Container{
|
|||||||
$nbt["id"] = Tile::CHEST;
|
$nbt["id"] = Tile::CHEST;
|
||||||
parent::__construct($chunk, $nbt);
|
parent::__construct($chunk, $nbt);
|
||||||
$this->inventory = new ChestInventory($this);
|
$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){
|
for($i = 0; $i < $this->getSize(); ++$i){
|
||||||
$this->inventory->setItem($i, $this->getItem($i));
|
$this->inventory->setItem($i, $this->getItem($i));
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,11 @@ class Furnace extends Tile implements InventoryHolder, Container{
|
|||||||
$this->inventory->setItem($i, $this->getItem($i));
|
$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){
|
if(!isset($this->namedtag->BurnTime) or $this->namedtag["BurnTime"] < 0){
|
||||||
$this->namedtag->BurnTime = new Short("BurnTime", 0);
|
$this->namedtag->BurnTime = new Short("BurnTime", 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user