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

Adding ChunkSerialization and Generation events. #9988

Closed
wants to merge 1 commit into from
Closed

Adding ChunkSerialization and Generation events. #9988

wants to merge 1 commit into from

Conversation

derverdox
Copy link

This patch adds new Chunk events that are called during the chunks' serialization/generation process.
Yes, there is a ChunkLoad or ChunkUnload event. However, they are called sync.

These proposed events are called during the process. They are primarily used to manipulate the persistent data container of the chunk to offramp saving/loading tasks made by custom plugins to the paper chunk loader threads system.

You may ask: Why not just store data in the persistent data container of the chunk on the fly and let paper handle the rest?
That is how it works right now, but consider a system that performs cleanup tasks to its data before storing it. You cannot do that right now because you will lag the main thread.

Having such events is an excellent alternative for those who don't want to call certain tasks sync but have to because of the synchronous nature of Bukkit's ChunkLoad / ChunkUnload events.

@derverdox derverdox requested a review from a team as a code owner November 30, 2023 00:38
Copy link

Please do not open pull requests from the master branch, create a new branch instead.

@github-actions github-actions bot closed this Nov 30, 2023
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