Bring back API to get world type information other than flat vs not flat#13888
Bring back API to get world type information other than flat vs not flat#13888LeonTG wants to merge 7 commits into
Conversation
As requested by the original PR
| /** | ||
| * Represents various types of worlds that may exist | ||
| */ | ||
| public enum WorldType { |
There was a problem hiding this comment.
could this use the generator, to generate the enum automatically from NoiseGeneratorSettings
There was a problem hiding this comment.
this also seems to miss the END and NETHER world types
There was a problem hiding this comment.
Those are already covered by Environment.XXX
There was a problem hiding this comment.
But they're also valid world types in vanilla so maybe they should be included here as well
There was a problem hiding this comment.
No, not easily and this type should be deprecated later once a more proper world gen api exists.
There was a problem hiding this comment.
(The real way to go about this would be to just expose the key being used, if people want to check those against the default templated types that's their thing, but tying this to an enum in the era of registries is pretty flawed in the long run, and pretty sure this is already broken today given datapacks can define this stuff?
There was a problem hiding this comment.
I would argue then that this is more a temporary solution for people to be able to detect the different types and being able to create CAVES, FLOATING_ISLANDS and DEBUG from WorldCreator while a better more improved system can be made
I've made commits now to add a method to get the key and re-deprecated the getWorldType(), but I think the added world types should be kept for creating new worlds until said better system is made
There was a problem hiding this comment.
The key is also a temporary measure ultimately the registry needs to be exposed and I don't think it's worth doing it rn. But the method should indeed stay deprecated.
There was a problem hiding this comment.
I don't think that's the right keys too, the closest thing to how WorldType is used rn seems to be WorldPreset in internal for example doing WorldCreator.ofKey(NamespacedKey.fromString("abc")).type(WorldType.FLOATING_ISLANDS).createWorld()
log the following message: "Failed to parse level-type floating_islands, defaulting to minecraft:normal"
There was a problem hiding this comment.
It was working in my testing, I'll take another look later
I originally did this before the hard-fork in PR #10314
Completely forgot about it until now, figured I would redo it with the requested changes