From a371890962d470cb51868cfba78892001b742f7e Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Mon, 16 Jun 2014 00:30:51 +0200 Subject: [PATCH] Fixed Chest and Furnace placing, Furnace open --- src/pocketmine/block/BurningFurnace.php | 6 +++--- src/pocketmine/block/Chest.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pocketmine/block/BurningFurnace.php b/src/pocketmine/block/BurningFurnace.php index 3c10002a0..161a1286b 100644 --- a/src/pocketmine/block/BurningFurnace.php +++ b/src/pocketmine/block/BurningFurnace.php @@ -55,7 +55,7 @@ class BurningFurnace extends Solid{ new Int("z", $this->z) )); $nbt->Items->setTagType(NBT::TAG_Compound); - new Furnace($this->getLevel(), $nbt); + new Furnace($this->getLevel()->getChunkAt($this->x >> 4, $this->z >> 4), $nbt); return true; } @@ -81,14 +81,14 @@ class BurningFurnace extends Solid{ new Int("z", $this->z) )); $nbt->Items->setTagType(NBT::TAG_Compound); - $furnace = new Furnace($this->getLevel(), $nbt); + $furnace = new Furnace($this->getLevel()->getChunkAt($this->x >> 4, $this->z >> 4), $nbt); } if(($player->getGamemode() & 0x01) === 0x01){ return true; } - $furnace->openInventory($player); + $player->addWindow($furnace->getInventory()); } return true; diff --git a/src/pocketmine/block/Chest.php b/src/pocketmine/block/Chest.php index ffda8945b..759ddc91c 100644 --- a/src/pocketmine/block/Chest.php +++ b/src/pocketmine/block/Chest.php @@ -77,7 +77,7 @@ class Chest extends Transparent{ new Int("z", $this->z) )); $nbt->Items->setTagType(NBT::TAG_Compound); - $tile = new TileChest($this->getLevel(), $nbt); + $tile = new TileChest($this->getLevel()->getChunkAt($this->x >> 4, $this->z >> 4), $nbt); if($chest instanceof TileChest){ $chest->pairWith($tile); @@ -117,7 +117,7 @@ class Chest extends Transparent{ new Int("z", $this->z) )); $nbt->Items->setTagType(NBT::TAG_Compound); - $chest = new TileChest($this->getLevel(), $nbt); + $chest = new TileChest($this->getLevel()->getChunkAt($this->x >> 4, $this->z >> 4), $nbt); }