use of net.glowstone.generator.NetherGenerator 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();
}
}
}
Aggregations