Preliminary example of WorldUnloadEvent#8399
Conversation
needs organisating, commentry, and actually exposing in the API
| + public static final WorldUnloadResult NOT_EMPTY = new WorldUnloadResult(false, Component.text("Unable to load world with players!")); | ||
| + public static final WorldUnloadResult PENDING_LOGIN = new WorldUnloadResult(false, Component.text("Unable to load world with pending login!")); |
There was a problem hiding this comment.
I think you have a typo on "load" (you meant "unload" right ?)
There was a problem hiding this comment.
Yea, I was honestly just rushing this to get it down, been meaning to look into this one for a good while, general improvements to the messages welcome, etc
|
I assume the title is a typo and you dont actually want an event to check the result of the api call? I generally like this, not super sure the component in the result is required, but I am sure some plugin devs will appreciate beging able to forward those messages to users instead of having to come up with their own. |
|
Yea , title is a brainfart; ideally I'd probs make those just translatable components or whatever, if we wanted to get rid of those I'd probs just turn it into an enum for better or worse, I guess it doesn't exactly matter here, not something likely to be extended, but, thoughts was is that plugins cancelling could maybe add their own reasons down the line, etc I'm not exactly expecting that plugins will care to act differently on any of the results as they should generally be taking care of those cases ahead of time |
|
Any reason why you are providing a component "error" message? |
needs organisating, commentry, and actually exposing in the API
PR is semi hasty, I don't wanna throw a bunch of time cleaning this up without some general commentary first, iffy on not using an enum, being enums have bit us in the arse before, and mostly, people mostly only care about fail/success
Should probably add the annotation to not ignore the ret value too, as many people seem to miss that one in general