mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-05 17:41:46 +00:00
Blocked again opening of chests in Creative mode
This commit is contained in:
parent
96baeaaad2
commit
639ca67a10
@ -560,6 +560,9 @@ class Player{
|
|||||||
foreach(BlockAPI::$creative as $item){
|
foreach(BlockAPI::$creative as $item){
|
||||||
$this->inventory[] = array(DANDELION, 0, 1);
|
$this->inventory[] = array(DANDELION, 0, 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->itemEnforcement === true){
|
||||||
$this->sendInventory();
|
$this->sendInventory();
|
||||||
}
|
}
|
||||||
$this->eventHandler("Your gamemode has been changed to ".$this->getGamemode().".", "server.chat");
|
$this->eventHandler("Your gamemode has been changed to ".$this->getGamemode().".", "server.chat");
|
||||||
|
@ -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;
|
return true;
|
||||||
}
|
}
|
||||||
$player->windowCnt++;
|
$player->windowCnt++;
|
||||||
$player->windowCnt = $id = max(1, $player->windowCnt % 255);
|
$player->windowCnt = $id = max(1, $player->windowCnt % 255);
|
||||||
$player->windows[$id] = $chest;
|
$player->windows[$id] = $furnace;
|
||||||
$player->dataPacket(MC_CONTAINER_OPEN, array(
|
$player->dataPacket(MC_CONTAINER_OPEN, array(
|
||||||
"windowid" => $id,
|
"windowid" => $id,
|
||||||
"type" => WINDOW_FURNACE,
|
"type" => WINDOW_FURNACE,
|
||||||
@ -104,7 +104,7 @@ class BurningFurnaceBlock extends SolidBlock{
|
|||||||
));
|
));
|
||||||
$slots = array();
|
$slots = array();
|
||||||
for($s = 0; $s < FURNACE_SLOTS; ++$s){
|
for($s = 0; $s < FURNACE_SLOTS; ++$s){
|
||||||
$slot = $chest->getSlot($s);
|
$slot = $furnace->getSlot($s);
|
||||||
if($slot->getID() > 0 and $slot->count > 0){
|
if($slot->getID() > 0 and $slot->count > 0){
|
||||||
$slots[] = $slot;
|
$slots[] = $slot;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
return true;
|
||||||
}
|
}
|
||||||
$player->windowCnt++;
|
$player->windowCnt++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user