Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.15.2] Replace stone to custom block in own biome


Recommended Posts

Hello! Sorry for my Eng.

I created a new biome, and now I need to replace default Minecraft stone with my custom block (AmbientBlocks.Blocks.stone.getDefaultState()). How I can do this?

My biome code:

public class TerraForestBiome extends Biome {
    public TerraForestBiome(Builder biomeBuilder) {
        super((new Biome.Builder()
                .surfaceBuilder(new ConfiguredSurfaceBuilder<SurfaceBuilderConfig>(SurfaceBuilder.DEFAULT, new SurfaceBuilderConfig(
                        AmbientBlocks.Blocks.grass.getDefaultState(),
                        AmbientBlocks.Blocks.dirt.getDefaultState(),
                        AmbientBlocks.Blocks.stone.getDefaultState())))
                .precipitation(RainType.RAIN)
                .category(Category.PLAINS)
                .downfall(0.25F)
                .depth(0.1F)
                .scale(0.3F)
                .temperature(0.8F)
                .waterColor(4159204)
                .waterFogColor(329011)
                .parent(null)));
    }
}

 

Edited by SSKirillSS
Link to post
Share on other sites
29 minutes ago, SSKirillSS said:

Maybe surfaceBuilder override

I don't think SurfaceBuilder is what you want to look at, as that only builds the surface.

Probably check out ChunkGenerators, I see in net.minecraft.world.gen.GenerationSettings there is a defaultBlock field that seems to default to stone.

 

*edit: looking a little bit more, it almost seems as if the default block is determined by the dimension as opposed to the biome.

Edited by Ugdhar
Link to post
Share on other sites
18 minutes ago, SSKirillSS said:

So I can’t change this block without creating my own dimension?

It looks like the easiest way to do this would be to add a feature to your biome(s) that replace all of the Stone blocks with whatever block you want. However if you feel adventurous feel free to look into GenerationSettings::defaultBlock and changing that between the block that you want to use and the vanilla Stone block.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to post
Share on other sites
2 minutes ago, SSKirillSS said:

How I can do this? Will I need make own GenerationSettings extends default, and override that's variable?

I'm not sure. If I had more time I could look into it. Why not look into it yourself

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to post
Share on other sites
24 minutes ago, Animefan8888 said:

Show what you've tried.

Everything was limited to the search for methods of changing the stone through the biome, but they could not be found. The only sure way to change the value of that variable with a stone (GenerationSettings#defaultBlock), but I don't know how to change a variable without processing almost the entire generation logic. It's like creating a separate world...

I have not yet considered the option of replacing the stone with my block at the generation stage, since I hope that there is a more correct way.

Edited by SSKirillSS
Link to post
Share on other sites
  • 1 month later...

You need to do it in a new dimension.

You can add it directly to your GenerationSetting.

 

public class ModGenSettings extends GenerationSettings{

    public ModGenSettings () {
        this.setDefaultBlock( YOUR_BLOCK.get().getDefaultState().getBlockState() );
    }

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.