-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow FabricCodecDataProvider
to access dynamic registries
#3522
Allow FabricCodecDataProvider
to access dynamic registries
#3522
Conversation
I'd argue that since the datagen module only used in dev, it's fine to break the API. |
No, I dont think this is a something we want to do. A few people actually use this in prod as well (for runtime resource gen) |
I recommend breaking this in 1.20.5. |
Interesting, I thought people uses different API for that. Still, I don't think the datagen module needs to follow the strict backwards compatibility promise as other modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I always forget our stance on forRemoval
I thought we generally didnt use it?
...pi-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricCodecDataProvider.java
Outdated
Show resolved
Hide resolved
...pi-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricCodecDataProvider.java
Show resolved
Hide resolved
...pi-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricCodecDataProvider.java
Outdated
Show resolved
Hide resolved
...pi-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricCodecDataProvider.java
Outdated
Show resolved
Hide resolved
...pi-v1/src/main/java/net/fabricmc/fabric/api/datagen/v1/provider/FabricCodecDataProvider.java
Outdated
Show resolved
Hide resolved
* Add CompletableFuture to FabricCodecDataProvider * Deprecate the old method and constructor, and fix the style * Fix the style for real this time * Add exceptions to the configure methods * Apply suggestions from code review --------- Co-authored-by: modmuss <modmuss50@gmail.com> (cherry picked from commit 5c01334)
This PR allows
FabricCodecDataProvider
to access the dynamic registries if it is passed in the constructor. Now, I have a couple of issues with this implementation myself because I didn't want to cause a breaking change, the biggest one being that if you do not override the correct method in your subclass, it won't generate any files. Using theFabricCodecDataProvider#FabricCodecDataProvider(FabricDataOutput, CompletableFuture, DataOutput.OutputType, String, Codec)}
constructor and then theFabricCodecDataProvider#configure(BiConsumer)
method won't generate anything as it's never called.This could all be avoided by always requiring a
CompletableFuture<RegistryWrapper.WrapperLookup>
in the constructor and by adding saidRegistryWrapper.WrapperLookup
to theconfigure
method, but that would be a breaking change. We would end up with a much more graceful implementation though.