Jump to content

[1.14.4] Question about world generation [Solved]


Tieso2001

Recommended Posts

I would like to generate farmland with wheat crops near water, but I don't know how I can do that.

 

I only know how to do this, but that can only generate wheat like grass is generated:

public static void setupWorldGen() {

        for (Biome biome : ForgeRegistries.BIOMES) {
            biome.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Biome.createDecoratedFeature(Feature.BUSH, new BushConfig(Blocks.WHEAT.getDefaultState()), Placement.CHANCE_HEIGHTMAP, new ChanceConfig(4)));
        }
    }

 

Could someone please explain to me how I can generate the wheat with farmland below, thanks in advance.

Edited by Tieso2001
Link to comment
Share on other sites

1 hour ago, Tieso2001 said:

Could someone please explain to me how I can generate the wheat with farmland below, thanks in advance.

Just from a quick look at the source files for Decorators. It looks like you are gonna need a Placement object which is an ForgeRegistryEntry so don't forget to register it. And somewhere in this you have to check for surrounding water at a BlockPos and change the blocks how you want to.

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 comment
Share on other sites

17 minutes ago, Animefan8888 said:

It looks like you are gonna need a Placement object which is an ForgeRegistryEntry so don't forget to register it.

I don't really know how this works, I'm trying to understand by looking at vanilla classes. For example, I'm looking at the Placement class.

public static final Placement<> CROP = 

Are there any tutorials, examples or documentations for this? How do I register a placement object and is there an example of this?

Edited by Tieso2001
Link to comment
Share on other sites

Just now, Tieso2001 said:

I don't really know how this works, I'm trying to understand by looking at vanilla classes.

This is probably your best option at this point, I'm not sure of any other mods using this.

 

Just now, Tieso2001 said:

How do I register a placement object and is there an example of this?

You register it the same way you would with an Item or a Block.And many examples through I believe you know how to register Items and Blocks.

 

1 minute ago, Tieso2001 said:

Are there any tutorials, examples or documentations for this?

i highly doubt it 1.13/1.14 are still relatively new, but it wouldn't hurt to check out Choonsters github, maybe even Draco18s.

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 comment
Share on other sites

1 minute ago, Tieso2001 said:

I am not sure yet how I tell a placement that it needs to place it near water.

There has to be a method that tells the feature where to place the blocks. Maybe it's not even in the Placement, but the name sure does make me think it is. In that method you need some algorithm to find water around a random point and select that one. Or you could implement this algorithm in the feature if you really want to.

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 comment
Share on other sites

I could create an if statement in the feature class so that it only places when next to water, but I don't think that is the proper way to do it. I think the proper way is to create a custom placement.

 

Edit: Nevermind vanilla does the checks in the feature class itself, I checked in the feature from sugarcane and it does the check there.

Edited by Tieso2001
Link to comment
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.
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...

×   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.

Announcements



×
×
  • Create New...

Important Information

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