pocketmine\level\GameRules::__construct PHP Method

__construct() public method

public __construct ( CompoundTag $rules = null )
$rules pocketmine\nbt\tag\CompoundTag
    public function __construct(CompoundTag $rules = null)
    {
        $this->addGameRule("doFireTick", true, ByteTag::class);
        // Not CS
        $this->addGameRule("mobGriefing", true, ByteTag::class);
        // TODO: Add to AI branch
        $this->addGameRule("keepInventory", false, ByteTag::class);
        // Implemented
        $this->addGameRule("doMobSpawning", true, ByteTag::class);
        // TODO: Add to AI branch
        $this->addGameRule("doMobLoot", true, ByteTag::class);
        // TODO
        $this->addGameRule("doTileDrops", true, ByteTag::class);
        // Implemented
        $this->addGameRule("doEntityDrops", true, ByteTag::class);
        // TODO
        $this->addGameRule("commandBlockOutput", true, ByteTag::class);
        // Not MCPE
        $this->addGameRule("naturalRegeneration", true, ByteTag::class);
        // TODO
        $this->addGameRule("doDaylightCycle", true, ByteTag::class);
        // Implemented
        $this->addGameRule("logAdminCommands", true, ByteTag::class);
        // TODO
        $this->addGameRule("showDeathMessages", true, ByteTag::class);
        // Implemented
        $this->addGameRule("randomTickSpeed", 3, IntTag::class);
        // TODO
        $this->addGameRule("sendCommandFeedback", true, ByteTag::class);
        // TODO
        $this->addGameRule("reducedDebugInfo", false, ByteTag::class);
        // TODO
        $this->addGameRule("spectatorsGenerateChunks", true, ByteTag::class);
        // TODO
        $this->addGameRule("spawnRadius", 10, IntTag::class);
        // TODO
        $this->addGameRule("disableElytraMovementCheck", false, ByteTag::class);
        // Not MCPE
        $this->addGameRule("doWeatherCycle", true, ByteTag::class);
        // TODO
        $this->addGameRule("maxEntityCramming", 24, IntTag::class);
        // TODO
        if (!is_null($rules)) {
            $this->readFromNBT($rules);
        }
    }