Skip to content

Preliminary example of WorldUnloadEvent#8399

Closed
electronicboy wants to merge 2 commits into
masterfrom
feat/WorldUnloadResult
Closed

Preliminary example of WorldUnloadEvent#8399
electronicboy wants to merge 2 commits into
masterfrom
feat/WorldUnloadResult

Conversation

@electronicboy
Copy link
Copy Markdown
Member

@electronicboy electronicboy commented Sep 28, 2022

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

needs organisating, commentry, and actually exposing in the API
Comment on lines +24 to +25
+ 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!"));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have a typo on "load" (you meant "unload" right ?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@MiniDigger
Copy link
Copy Markdown
Member

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.

@electronicboy
Copy link
Copy Markdown
Member Author

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

@Owen1212055
Copy link
Copy Markdown
Member

Any reason why you are providing a component "error" message?

@Warriorrrr Warriorrrr moved this from Awaiting review to Waiting For Author in Paper PR Queue Mar 5, 2025
@kennytv kennytv added the pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch label Mar 23, 2025
@kennytv kennytv deleted the branch master March 23, 2025 19:15
@kennytv kennytv closed this Mar 23, 2025
@kennytv kennytv deleted the feat/WorldUnloadResult branch March 23, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pre-softspoon: never rebased Pre-hardfork pull requests that were not re-opened with the new main branch pre-softspoon

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

6 participants