Skip to content
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

Modify behavior when worlds are attempted to be loaded or unloaded while being ticked (Addresses #8300) #8310

Closed
wants to merge 1 commit into from

Conversation

willkroboth
Copy link
Contributor

This PR changes two things:

  • Allow world creation while worlds are being ticked (previously an IllegalStateException would be thrown)
  • Delay world unload until worlds are not being ticked (previously an IllegalStateException would be thrown)

This aligns Paper's behavior with Spigot's after SPIGOT-7089 was resolved, which fixed an error that occurred if worlds were loaded or unloaded while being ticked (Previously, Paper had fixed this by throwing IllegalStateExceptions: #7653 and #8081). With this PR, Spigot and Paper agree and allow worlds to be loaded/unloaded while being ticked.

To address the concerns of this comment, if the worlds are being ticked Paper will not unload a world immediately. Instead, the task that unloads the world will be packaged in a Runnable and stored in a list to be run immediately after the worlds are done being ticked.

Delay world unload until worlds are not being ticked
@willkroboth willkroboth requested a review from a team as a code owner August 17, 2022 18:57
@willkroboth willkroboth marked this pull request as draft August 17, 2022 22:20
@willkroboth
Copy link
Contributor Author

#8300 has been alternatively resolved as: plugins have to deal with the differences between Spigot and Paper.

@willkroboth willkroboth deleted the 8300 branch August 19, 2022 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant