My mod add a new world type which generates only my biome.
My biome is made by 1 block and fluids.
WorldType:
public class TestWorldType extends WorldType {
public TestWorldType() {
super("testworld");
}
@Override
public ChunkGenerator<?> createChunkGenerator(World world) {
if (world.getDimension().getType() == DimensionType.OVERWORLD) {
OverworldGenSettings overworldGenSettings = new OverworldGenSettings();
SingleBiomeProviderSettings biomeProviderSettings = new SingleBiomeProviderSettings(world.getWorldInfo());
biomeProviderSettings.setBiome(TestWorld.TEST_BIOME);
overworldGenSettings.setDefaultBlock(TestWorld.TEST_BLOCK.getDefaultState());
return new OverworldChunkGenerator(world, new SingleBiomeProvider(biomeProviderSettings), overworldGenSettings);
} else
return super.createChunkGenerator(world);
}
}
Biome(I refered to PlainsBiome):
public class TestBiome extends Biome {
private static final BlockState WATER = Blocks.WATER.getDefaultState();
private static final BlockState LAVA = Blocks.LAVA.getDefaultState();
public static final BlockState TEST_BLOCK_STATE = TestWorld.TEST_BLOCK.getDefaultState();
public static final TreeFeatureConfig TEST_TREE_CONFIG = (new TreeFeatureConfig.Builder(new SimpleBlockStateProvider(TEST_BLOCK_STATE), new SimpleBlockStateProvider(TEST_BLOCK_STATE), new BlobFoliagePlacer(2, 0))).baseHeight(4).heightRandA(2).foliageHeight(3).ignoreVines().setSapling((IPlantable) TestWorld.TEST_BLOCK).build();
public static final BlockStateProvidingFeatureConfig HAY_PILE_CONFIG = new BlockStateProvidingFeatureConfig(new SimpleBlockStateProvider(TestWorld.TEST_BLOCK.getDefaultState()));
public TestBiome() {
super((new Builder()).surfaceBuilder(SurfaceBuilder.DEFAULT, new SurfaceBuilderConfig(TEST_BLOCK_STATE, TEST_BLOCK_STATE, TEST_BLOCK_STATE)).precipitation(RainType.RAIN).category(Category.PLAINS).depth(0.125F).scale(0.05F).temperature(0.8F).downfall(0.4F).waterColor(4159204).waterFogColor(329011).parent((String) null));
TestVillagePools.init();
this.addStructure(Feature.VILLAGE.withConfiguration(new VillageConfig("village/test/town_centers", 6)));
this.addCarver(GenerationStage.Carving.AIR, Biome.createCarver(new TestCaveWorldCarver(ProbabilityConfig::deserialize, 256), new ProbabilityConfig(0.14285715F)));
this.addCarver(GenerationStage.Carving.AIR, Biome.createCarver(new TestCanyonWorldCarver(ProbabilityConfig::deserialize), new ProbabilityConfig(0.02F)));
this.addFeature(GenerationStage.Decoration.LOCAL_MODIFICATIONS, new TestLakesFeature(BlockStateFeatureConfig::func_227271_a_).withConfiguration(new BlockStateFeatureConfig(WATER)).withPlacement(Placement.WATER_LAKE.func_227446_a_(new ChanceConfig(4))));
this.addFeature(GenerationStage.Decoration.LOCAL_MODIFICATIONS, new TestLakesFeature(BlockStateFeatureConfig::func_227271_a_).withConfiguration(new BlockStateFeatureConfig(LAVA)).withPlacement(Placement.LAVA_LAKE.func_227446_a_(new ChanceConfig(80))));
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.NORMAL_TREE.withConfiguration(TEST_TREE_CONFIG).withPlacement(Placement.COUNT_EXTRA_HEIGHTMAP.func_227446_a_(new AtSurfaceWithExtraConfig(0, 0.05F, 1))));
this.addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, Feature.VILLAGE.withConfiguration(new VillageConfig("village/plains/town_centers", 6)).withPlacement(Placement.NOPE.func_227446_a_(IPlacementConfig.NO_PLACEMENT_CONFIG)));
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.SHEEP, 12, 4, 4));
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.PIG, 10, 4, 4));
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.CHICKEN, 10, 4, 4));
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.COW, 8, 4, 4));
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.HORSE, 5, 2, 6));
this.addSpawn(EntityClassification.CREATURE, new SpawnListEntry(EntityType.DONKEY, 1, 1, 3));
this.addSpawn(EntityClassification.AMBIENT, new SpawnListEntry(EntityType.BAT, 10, 8, 8));
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.SPIDER, 100, 4, 4));
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ZOMBIE, 95, 4, 4));
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ZOMBIE_VILLAGER, 5, 1, 1));
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.SKELETON, 100, 4, 4));
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.CREEPER, 100, 4, 4));
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.SLIME, 100, 4, 4));
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.ENDERMAN, 10, 1, 4));
this.addSpawn(EntityClassification.MONSTER, new SpawnListEntry(EntityType.WITCH, 5, 1, 1));
}
}