Do not generate plains in nether and end

This commit is contained in:
Fabrizio La Rosa 2020-07-12 14:33:25 +02:00
parent 96b440cec3
commit e67106cb46

View File

@ -29,7 +29,21 @@ public class VoidGenerator extends ChunkGenerator {
final Configuration configLoad = plugin.getFileManager().getConfig(new File(plugin.getDataFolder(), "config.yml")).getFileConfiguration();
final ConfigurationSection worldSection = configLoad.getConfigurationSection("Island.World");
Biome biome = CompatibleBiome.valueOf(configLoad.getString("Island.Biome.Default.Type").toUpperCase()).getBiome();
Biome biome;
switch (world.getEnvironment()) {
case NORMAL:
biome = CompatibleBiome.valueOf(configLoad.getString("Island.Biome.Default.Type", "PLAINS").toUpperCase()).getBiome();
break;
case NETHER:
biome = CompatibleBiome.NETHER_WASTES.getBiome();
break;
case THE_END:
biome = CompatibleBiome.THE_END.getBiome();
break;
default:
throw new IllegalStateException("Unexpected value: " + world.getEnvironment());
}
if(ServerVersion.isServerVersionAtLeast(ServerVersion.V1_16)) { // TODO Should be 1.15 but it works fine there
setChunkBiome3D(biome, biomeGrid, world);