Search in sources :

Example 1 with TheEndGenerator

use of net.glowstone.generator.TheEndGenerator in project Glowstone by GlowstoneMC.

the class GlowServer method getGenerator.

/**
 * Gets the default ChunkGenerator for the given environment and type.
 *
 * @return The ChunkGenerator.
 */
private ChunkGenerator getGenerator(String name, Environment environment, WorldType type) {
    // find generator based on configuration
    ConfigurationSection worlds = config.getWorlds();
    if (worlds != null) {
        // NON-NLS
        String genName = worlds.getString(name + ".generator", null);
        ChunkGenerator generator = WorldCreator.getGeneratorForName(name, genName, getConsoleSender());
        if (generator != null) {
            return generator;
        }
    }
    // find generator based on environment and world type
    if (environment == Environment.NETHER) {
        return new NetherGenerator();
    } else if (environment == Environment.THE_END) {
        return new TheEndGenerator();
    } else {
        if (type == WorldType.FLAT) {
            return new SuperflatGenerator();
        } else {
            return new OverworldGenerator();
        }
    }
}
Also used : TheEndGenerator(net.glowstone.generator.TheEndGenerator) SuperflatGenerator(net.glowstone.generator.SuperflatGenerator) OverworldGenerator(net.glowstone.generator.OverworldGenerator) NetherGenerator(net.glowstone.generator.NetherGenerator) ChunkGenerator(org.bukkit.generator.ChunkGenerator) ConfigurationSection(org.bukkit.configuration.ConfigurationSection)

Aggregations

NetherGenerator (net.glowstone.generator.NetherGenerator)1 OverworldGenerator (net.glowstone.generator.OverworldGenerator)1 SuperflatGenerator (net.glowstone.generator.SuperflatGenerator)1 TheEndGenerator (net.glowstone.generator.TheEndGenerator)1 ConfigurationSection (org.bukkit.configuration.ConfigurationSection)1 ChunkGenerator (org.bukkit.generator.ChunkGenerator)1