From 639ca67a10887c44b5f3b44c7939e597608dcbb3 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Thu, 18 Apr 2013 17:05:26 +0200 Subject: [PATCH] Blocked again opening of chests in Creative mode --- src/Player.php | 3 +++ src/material/block/solid/BurningFurnace.php | 6 +++--- src/material/block/solid/Chest.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Player.php b/src/Player.php index 5dff3ed8e..39bf60996 100644 --- a/src/Player.php +++ b/src/Player.php @@ -560,6 +560,9 @@ class Player{ foreach(BlockAPI::$creative as $item){ $this->inventory[] = array(DANDELION, 0, 1); } + } + + if($this->itemEnforcement === true){ $this->sendInventory(); } $this->eventHandler("Your gamemode has been changed to ".$this->getGamemode().".", "server.chat"); diff --git a/src/material/block/solid/BurningFurnace.php b/src/material/block/solid/BurningFurnace.php index 9e8e59da9..e844da2cc 100644 --- a/src/material/block/solid/BurningFurnace.php +++ b/src/material/block/solid/BurningFurnace.php @@ -90,12 +90,12 @@ class BurningFurnaceBlock extends SolidBlock{ )); } - if($furnace->class !== TILE_FURNACE){ + if($furnace->class !== TILE_FURNACE or ($player->gamemode & 0x01) === 0x01){ return true; } $player->windowCnt++; $player->windowCnt = $id = max(1, $player->windowCnt % 255); - $player->windows[$id] = $chest; + $player->windows[$id] = $furnace; $player->dataPacket(MC_CONTAINER_OPEN, array( "windowid" => $id, "type" => WINDOW_FURNACE, @@ -104,7 +104,7 @@ class BurningFurnaceBlock extends SolidBlock{ )); $slots = array(); for($s = 0; $s < FURNACE_SLOTS; ++$s){ - $slot = $chest->getSlot($s); + $slot = $furnace->getSlot($s); if($slot->getID() > 0 and $slot->count > 0){ $slots[] = $slot; } diff --git a/src/material/block/solid/Chest.php b/src/material/block/solid/Chest.php index 8e1e6af86..9e060e12f 100644 --- a/src/material/block/solid/Chest.php +++ b/src/material/block/solid/Chest.php @@ -107,7 +107,7 @@ class ChestBlock extends TransparentBlock{ )); } - if($chest->class !== TILE_CHEST){ + if($chest->class !== TILE_CHEST or ($player->gamemode & 0x01) === 0x01){ return true; } $player->windowCnt++;