-
Notifications
You must be signed in to change notification settings - Fork 502
add resource reload start/end events #5108
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
base: 1.21.11
Are you sure you want to change the base?
add resource reload start/end events #5108
Conversation
…f the test right next to the one I added so idk
| /** | ||
| * Called before the client begins loading resources. | ||
| */ | ||
| public static final Event<StartResourceReload> START_RESOURCE_RELOAD = EventFactory.createArrayBacked(StartResourceReload.class, callbacks -> (client, isFirst) -> { |
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.
It would be helpful to explain the isFirst parameter in the javadoc
LambdAurora
left a comment
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.
The events should be in resource-loader-v1, in a new class (ClientResourceLoadingEvents), and in a future PR most likely move the data-pack events to resource loader too.
Aside from that, the events are missing important context: the resource manager.
And in the case of the end event, it's also missing an Optional<Throwable> in the case of errors, (and the event should trigger even if the resource load fails).
It's the kind of low-bandwidth event where I'd recommend creating a context object just to ensure a stable API while allowing to add more context if needs be.
|
Could it also include the store on success? |
|
Including the store is not a bad idea, yes. |
im not sure exactly what package to put it in in the resource loader module, do i mimic the package structure from a typical event module?
what does this mean exactly? |
No description provided.