Add a level screen provider registry #4118
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds a registry for level screen providers in the
fabric-screen-api-v1
module, which control the screens available from clicking 'Customize' on the create world screen. It can be used in the following way:To test this registry, a Fabricland chunk generator and world preset has been added to the
fabric-screen-api-v1
testmod. The create world screen allows opening a customization screen which allows the background and outline blocks that are generated to be changed:The corresponding names in Yarn mappings may be improved, so the
LevelScreenProviderRegistry
class name in this API should not be considered final.Note that the
LevelScreenProviderMixin
class modifiesMap.of
rather than replacing the field value as other registry API mixins do; theMap.of
method is more brittle, but seemingly is required asLevelScreenProvider
is an interface. See this Discord message for more information.Fixes #3926