Java Code Examples for net.minecraft.world.World.setAllowedSpawnTypes()

The following are Jave code examples for showing how to use setAllowedSpawnTypes() of the net.minecraft.world.World class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: DecompiledMinecraft   File: MinecraftServer.java   View Source Code Vote up 6 votes
public void setDifficultyForAllWorlds(EnumDifficulty difficulty)
{
    for (int i = 0; i < this.worldServers.length; ++i)
    {
        World world = this.worldServers[i];

        if (world != null)
        {
            if (world.getWorldInfo().isHardcoreModeEnabled())
            {
                world.getWorldInfo().setDifficulty(EnumDifficulty.HARD);
                world.setAllowedSpawnTypes(true, true);
            }
            else if (this.isSinglePlayer())
            {
                world.getWorldInfo().setDifficulty(difficulty);
                world.setAllowedSpawnTypes(world.getDifficulty() != EnumDifficulty.PEACEFUL, true);
            }
            else
            {
                world.getWorldInfo().setDifficulty(difficulty);
                world.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals);
            }
        }
    }
}
 
Example 2
Project: DecompiledMinecraft   File: MinecraftServer.java   View Source Code Vote up 6 votes
public void setDifficultyForAllWorlds(EnumDifficulty difficulty)
{
    for (int i = 0; i < this.worldServers.length; ++i)
    {
        World world = this.worldServers[i];

        if (world != null)
        {
            if (world.getWorldInfo().isHardcoreModeEnabled())
            {
                world.getWorldInfo().setDifficulty(EnumDifficulty.HARD);
                world.setAllowedSpawnTypes(true, true);
            }
            else if (this.isSinglePlayer())
            {
                world.getWorldInfo().setDifficulty(difficulty);
                world.setAllowedSpawnTypes(world.getDifficulty() != EnumDifficulty.PEACEFUL, true);
            }
            else
            {
                world.getWorldInfo().setDifficulty(difficulty);
                world.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals);
            }
        }
    }
}
 
Example 3
Project: BaseClient   File: MinecraftServer.java   View Source Code Vote up 6 votes
public void setDifficultyForAllWorlds(EnumDifficulty difficulty)
{
    for (int i = 0; i < this.worldServers.length; ++i)
    {
        World world = this.worldServers[i];

        if (world != null)
        {
            if (world.getWorldInfo().isHardcoreModeEnabled())
            {
                world.getWorldInfo().setDifficulty(EnumDifficulty.HARD);
                world.setAllowedSpawnTypes(true, true);
            }
            else if (this.isSinglePlayer())
            {
                world.getWorldInfo().setDifficulty(difficulty);
                world.setAllowedSpawnTypes(world.getDifficulty() != EnumDifficulty.PEACEFUL, true);
            }
            else
            {
                world.getWorldInfo().setDifficulty(difficulty);
                world.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals);
            }
        }
    }
}
 
Example 4
Project: BaseClient   File: MinecraftServer.java   View Source Code Vote up 6 votes
public void setDifficultyForAllWorlds(EnumDifficulty difficulty)
{
    for (int i = 0; i < this.worldServers.length; ++i)
    {
        World world = this.worldServers[i];

        if (world != null)
        {
            if (world.getWorldInfo().isHardcoreModeEnabled())
            {
                world.getWorldInfo().setDifficulty(EnumDifficulty.HARD);
                world.setAllowedSpawnTypes(true, true);
            }
            else if (this.isSinglePlayer())
            {
                world.getWorldInfo().setDifficulty(difficulty);
                world.setAllowedSpawnTypes(world.getDifficulty() != EnumDifficulty.PEACEFUL, true);
            }
            else
            {
                world.getWorldInfo().setDifficulty(difficulty);
                world.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals);
            }
        }
    }
}