@Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { if (!(chunkGenerator instanceof ChunkGeneratorFlat)) { //don't generate on flatworlds switch (world.provider.getDimension()) { case 0: generateSurface(world, random, chunkX * 16, chunkZ * 16); break; case -1: generateNether(world, random, chunkX * 16, chunkZ * 16); break; case 1: generateEnd(world, random, chunkX * 16, chunkZ * 16); break; default: generateSurface(world, random, chunkX * 16, chunkZ * 16); } } }
private IChunkGenerator getNewChunkProvider(World world, String chunkProviderType, String generatorOptions) { if (chunkProviderType.equals("VANILLA_DEFAULT")) { return new ChunkGeneratorOverworld(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions); } else if (chunkProviderType.equals("VANILLA_FLAT")) { return new ChunkGeneratorFlat(world, world.getSeed(), world.getWorldInfo().isMapFeaturesEnabled(), generatorOptions); } else if (chunkProviderType.equals("VANILLA_HELL")) { return new ChunkGeneratorHell(world, world.getWorldInfo().isMapFeaturesEnabled(), world.getSeed()); } else if (chunkProviderType.equals("VANILLA_END")) { return new ChunkGeneratorEnd(world, world.getWorldInfo().isMapFeaturesEnabled(), world.getSeed(), new BlockPos(100, 50, 0)); } return null; }