Jump to content

[1.16.3] [Solved] Own Chunk Generator and Biome Generator with java code


Recommended Posts

Posted

Hello there!

Today I decided to get into minecraft modding once more, as game development bored me a bit.

So, as the title already suggests, I want to somehow integrate own code into the json-data-driven system that minecraft

currently uses for its biome and terrain generation.

 

I'm totally clueless at the moment, as I have no idea how I can achieve something like this.

 

For the biome generator, I need to know how a codec works.

 

And for the terrain generator, I don't even know from what classes to extend from.

 

So, I'd really appreciate help.

 

-Budschie

Posted

So, because I am getting no replies to this topic, I am a bit worried as this could mean that

this simply isn't possible. Could it be worth to backport my mod to 1.15, so that I can hardcode my dimensions again?

Posted

Chunk generators can be declared within json, biome generators are chunk generators. If something can be jsoned, it can most definitely be coded. Getting no replies to the topic either means that the person who viewed means they most like don't know the answer.

  • Like 1
Posted
17 hours ago, Budschie said:

So, how do I register a biome/chunkgenerator?

Biomes are handled through forge registries while chunk generators are handled through vanilla registries. You can find examples of both within the source or the docs.

17 hours ago, Budschie said:

And how exactly should I handle the codec class, and what is its purpose?

The codec class is essentially a generic algorithm that is not applicable to any one format. This allows different file operations to call this codec to handle in their specific file format. Here's a basic explanation of how to set up a codec. This article is completely independent of Forge itself and is not written by Forge.

  • Like 1
Posted (edited)

@ChampionAsh5357 Thanks again for the reply. So, I'm now slowly getting used to this stuff.

But as my old code used quite a few methods in a mod-own biome base class (it contained stuff like biome-specific chunk generation),

which inherited from biome (sadly, this behaviour isn't possible anymore, as the biome constructor is private),

I started to wonder whether it would be considered good practise to use access transformers to allow me to inherit from the biome class again.

 

So, I'd appreciate answers to this question.

-Budschie

Edited by Budschie
Posted
5 hours ago, Budschie said:

I started to wonder whether it would be considered good practise to use access transformers to allow me to inherit from the biome class again.

No, that wouldn't be feasible as this data driven system gets more developed over time. It would be just as easy to store a simple key interface that executes when a player is within a biome as needed without having to AT to extend the biome class.

  • Like 1
Posted

I should've put the word map in there. Basically, each biome has an associated registry key which is universally unique. You could grab the registry key of the specific object and pass that into a map to grab an associated object or interface which would allow you to do some custom mechanics for the biomes. It works the same as if it was attached to the object itself, minus a little extra time.

  • Like 1
  • Budschie changed the title to [1.16.3] [Solved] Own Chunk Generator and Biome Generator with java code

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.