Posted December 16, 20204 yr 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
December 21, 20204 yr Author 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?
December 21, 20204 yr 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.
December 21, 20204 yr Author @ChampionAsh5357Thanks for your quick reply! So, how do I register a biome/chunkgenerator? Do I just have to register it with a deferred registry? And how exactly should I handle the codec class, and what is its purpose?
December 22, 20204 yr 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.
December 22, 20204 yr Author @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 December 22, 20204 yr by Budschie
December 23, 20204 yr 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.
December 23, 20204 yr Author @ChampionAsh5357 Thanks for the reply 🙂 So, I have one last question: I don't fully understand what you mean by: 13 hours ago, ChampionAsh5357 said: a simple key interface So, answers would be appreciated. -Budschie
December 24, 20204 yr 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.
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.