Blocked again opening of chests in Creative mode

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-18 17:05:26 +02:00
parent 96baeaaad2
commit 639ca67a10
3 changed files with 7 additions and 4 deletions

View File

@ -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");

View File

@ -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;
}

View File

@ -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++;