-
Notifications
You must be signed in to change notification settings - Fork 38
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
[1.21] Field Registraction Adjustments #268
[1.21] Field Registraction Adjustments #268
Conversation
- Inject supplier into RegistryEntry - MemoizedSupplier's that caches the first get call made to the supplier
- Made such abstract classes instead of interfaces to allow for direct calls to entry method on AutoRegistryContainer - Fix MemoizedEntry name - Move iterateAccessibleStaticFieldsAllowingMemorizedSuppliers to FieldRegistrationHandler
Note: This will cause breaking changes fyi |
src/main/java/io/wispforest/owo/registration/reflect/FieldRegistrationHandler.java
Outdated
Show resolved
Hide resolved
import java.util.function.Supplier; | ||
|
||
public class MemoizedEntry<T> implements Supplier<T> { | ||
|
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.
is this class needed if there already is a helper method on AutoRegistryContainer
for making a MemoizedRegistryEntry
? any people who only want a supplier can still use the registry entry class since you made it extend supplier
…efore type checks
…variant instead of base supplier
- Refactor folder structure - FIx `register` method on `AutoRegistryContainer` being unavailable due to being package private
Closing this as such changes with Item, Block, and EntityType basically make it nearly impossible to use AutoRegistryContainer tbh |
Adjusts the Field registration API to handle Registry Entries combined with a supplier method of deferred registration