Looking through BetaPlus's code while making a LevelGeneratorType myself, I notice two things that make worldtypes in fabric a pain to create:
Maybe there should be a fabric api module for this? What do you all think?
Surely you mean LevelGeneratorTypes?
Yes
That may have been some :voldethonk: ,
though I think the game calls them world types as well?
I am fairly certain that its actually way worse than you think it is. You need separate mixins (or a LOT of reflection) for the dedicated server and the client to allow players to select your custom world type.
iirc you will even need to create your own custom buttons on the client side since the vanilla buttons are hardcoded...
Would appreciate a fabric module for this.
Yeah, a fabric module would be great. Something that does the brunt work of:
bump
bump
From what I can see, the modded LevelGeneratorTypes also need to be initialized before the server processes the properties file, or the server will use default world type instead of the said modded one.
My current solution is to mixin to LevelGeneratorType.getTypeFromName but it would probably be better to just make the LevelGeneratorTypes initialize at the right time
The whole map type (yes they're called that in game) selection process is very hardcoded indeed. I'm also in the situation where I need a custom one.
What I think is needed is
Of course there is more that could be done, but with this the basic funcionality should be complete?
Other than 3. it doesn't seem that hard. Maybe a bit ugly and invasive but not hard.
Nice to haves:
There are 8 vanilla world types, but id 7 isn’t used and two of them are hidden (customised and debug_all_block_states). One of them isn’t set to be hidden but you can’t select it via “more world options” from what I can tell (default_1_1)
So ids 0-6 and 8 are taken by minecraft
Altering other vanilla dimensions can be done like the overworld.
And did I mention that the constructor is private? yeehaw emoji
Mixin 0.8 might mean we can use mixin to invoke the constructor
I'll work on making a fabric level generator type api probably unless someone else does it first
bump
I guess #483 works on it?
Most helpful comment
The whole map type (yes they're called that in game) selection process is very hardcoded indeed. I'm also in the situation where I need a custom one.
What I think is needed is
Of course there is more that could be done, but with this the basic funcionality should be complete?
Other than 3. it doesn't seem that hard. Maybe a bit ugly and invasive but not hard.
Nice to haves: