Budschie Posted December 16, 2020 Share Posted December 16, 2020 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 Quote Link to comment Share on other sites More sharing options...
Budschie Posted December 18, 2020 Author Share Posted December 18, 2020 As an extra, I have no idea how to declare a dimension. Quote Link to comment Share on other sites More sharing options...
Budschie Posted December 21, 2020 Author Share Posted December 21, 2020 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? Quote Link to comment Share on other sites More sharing options...
ChampionAsh5357 Posted December 21, 2020 Share Posted December 21, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
Budschie Posted December 21, 2020 Author Share Posted December 21, 2020 @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? Quote Link to comment Share on other sites More sharing options...
ChampionAsh5357 Posted December 22, 2020 Share Posted December 22, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
Budschie Posted December 22, 2020 Author Share Posted December 22, 2020 (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 December 22, 2020 by Budschie Quote Link to comment Share on other sites More sharing options...
ChampionAsh5357 Posted December 23, 2020 Share Posted December 23, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
Budschie Posted December 23, 2020 Author Share Posted December 23, 2020 @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 Quote Link to comment Share on other sites More sharing options...
ChampionAsh5357 Posted December 24, 2020 Share Posted December 24, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
Budschie Posted December 24, 2020 Author Share Posted December 24, 2020 @ChampionAsh5357 Alright, thanks. Everything is clear to me now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.