Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I want to add a custom biome which is made by 1 block.

However I can't change stone layer.

How do I do it?

@SubscribeEvent
  public static void onRegisterBiome(RegistryEvent.Register<Biome> event) {
    TEST_BIOME.setRegistryName("test_biome");
    ForgeRegistries.BIOMES.register(TEST_BIOME);
    BiomeDictionary.addTypes(TEST_BIOME, BiomeDictionary.Type.PLAINS);
    BiomeManager.addSpawnBiome(TEST_BIOME);
  }
public class TestBiome extends Biome {
  public TestBiome() {
    super((new Builder()).surfaceBuilder(SurfaceBuilder.DEFAULT, new SurfaceBuilderConfig(TestMod.TEST_BLOCK.getDefaultState(), TestMod.TEST_BLOCK.getDefaultState(), TestMod.TEST_BLOCK.getDefaultState())).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));
    
    DefaultBiomeFeatures.addCarvers(this);
    DefaultBiomeFeatures.addLakes(this);

    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));
  }
}

 

It's solved by using OverworldGenSettings#setDefaultBlock.

Edited by kyazuki

  • 2 weeks later...

@kyazuki Can you show the new code? I am interessing by making Biomes and find anything on the Web for the 1.15.2. Then i want compare your method with the Vanilla method.

New in Modding? == Still learning!

  • Author

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));
  }
}

 

  • 1 month later...

@kyazuki did you have to register anything related to your new world type? Or since you overrided the method did it just work from there? I am having trouble not only finding my biome but being able to create a world with just my biome.

 

I am able to see my biome using the buffet world when creating a world. I assume that means my biome is registered correctly but I haven't seen it in the overworld or been able to create just a world with the biome itself.

 

I would love to see your main class and where you registered your biome using the Forge DeferredRegister. Thanks!

 

  • Author

My world type generates only 1 biome.

So I use SingleBiomeProvider.

On 2/21/2020 at 1:10 AM, kyazuki said:

 


return new OverworldChunkGenerator(world, new SingleBiomeProvider(biomeProviderSettings), overworldGenSettings);

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.