Skip to content

Adding ChunkSerialization and Generation events.#9988

Closed
derverdox wants to merge 1 commit into
PaperMC:masterfrom
derverdox:master
Closed

Adding ChunkSerialization and Generation events.#9988
derverdox wants to merge 1 commit into
PaperMC:masterfrom
derverdox:master

Conversation

@derverdox
Copy link
Copy Markdown

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
@github-actions
Copy link
Copy Markdown

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