diff --git a/src/pocketmine/tile/Container.php b/src/pocketmine/tile/Container.php index 34e358237..a349824f5 100644 --- a/src/pocketmine/tile/Container.php +++ b/src/pocketmine/tile/Container.php @@ -51,4 +51,9 @@ interface Container{ * @return Inventory */ public function getInventory(); + + /** + * @return Inventory + */ + public function getRealInventory(); } diff --git a/src/pocketmine/tile/ContainerTrait.php b/src/pocketmine/tile/ContainerTrait.php index 1b472c864..5ad11c9d3 100644 --- a/src/pocketmine/tile/ContainerTrait.php +++ b/src/pocketmine/tile/ContainerTrait.php @@ -45,7 +45,7 @@ trait ContainerTrait{ /** * @return Inventory */ - abstract public function getInventory(); + abstract public function getRealInventory(); /** * @param $index @@ -118,7 +118,7 @@ trait ContainerTrait{ $this->getNBT()->setTag(new ListTag(Container::TAG_ITEMS, [], NBT::TAG_Compound)); } - $inventory = $this->getInventory(); + $inventory = $this->getRealInventory(); for($i = 0, $size = $this->getSize(); $i < $size; ++$i){ $inventory->setItem($i, $this->getItem($i)); } @@ -127,7 +127,7 @@ trait ContainerTrait{ protected function saveItems() : void{ $this->getNBT()->setTag(new ListTag(Container::TAG_ITEMS, [], NBT::TAG_Compound)); - $inventory = $this->getInventory(); + $inventory = $this->getRealInventory(); for($i = 0, $size = $this->getSize(); $i < $size; ++$i){ $this->setItem($i, $inventory->getItem($i)); } diff --git a/src/pocketmine/tile/Furnace.php b/src/pocketmine/tile/Furnace.php index 9b91a93a0..91289501c 100644 --- a/src/pocketmine/tile/Furnace.php +++ b/src/pocketmine/tile/Furnace.php @@ -118,6 +118,13 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{ return $this->inventory; } + /** + * @return FurnaceInventory + */ + public function getRealInventory(){ + return $this->getInventory(); + } + protected function checkFuel(Item $fuel){ $this->server->getPluginManager()->callEvent($ev = new FurnaceBurnEvent($this, $fuel, $fuel->getFuelTime()));