Repository navigation
Conversation
strobil
marked this pull request as draft
October 10, 2026 23:32
strobil
marked this pull request as ready for review
October 11, 2026 01:00
ChunkAccess#getNoiseBiome takes biome (quart) coordinates, as the adapter's own getBiome already does. The previous call passed block coordinates, so biome regeneration read from the wrong place.
Folia cannot wait for chunk generation on a region thread, so the Bukkit adapter generates the terrain into a detached snapshot in a temporary world, as the synchronous path does, but waits on chunk futures instead of managedBlock. The selection's chunks are then loaded with World#getChunkAtAsync and held with plugin tickets, the snapshot is applied on the region thread owning them, and the command completes on the player's scheduler. Core gains a single World#regenerateAsync default method that falls back to the synchronous regenerate(); //regen creates its own edit session so both paths share one completion handler. The adapters implement regenerateAsync from the existing temporary world setup and copy loop, driven by a small AsyncRegeneration helper, and load the temporary world through the Bukkit API rather than chunk system internals. Temporary worlds live on the global region thread, one at a time. Limitations: the selection must end up in one region when the result is applied, concurrent regenerations are refused with a message, inventory mode is not supported, seed overrides remain unsupported on 26.x, and there is no timeout.
strobil
force-pushed
the
codex/folia-regen-master
branch
from
October 11, 2026 01:02
ea7a529 to
6c53204
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
//regenon Folia, including-b,-c, block entities, masks, limits and undo. Plugins can use the newWorld#regenerateAsync.The adapter generates the terrain into a snapshot in a temporary world, as the synchronous path does, but waits on chunk futures instead of
managedBlock. The selection's chunks are loaded withWorld#getChunkAtAsyncand held with plugin tickets, the snapshot is applied on the region thread owning them, and the command completes on the player's scheduler. Temporary worlds live on the global region thread, one at a time.Limitations:
//regenis refused with a message.Also fixes
//regen -bsampling biomes at block instead of quart coordinates on all platforms (separate commit).Risks:
ServerLevelconstructor trick as the synchronous path. Its registration in the server's world map is brief but visible to plugins iteratingBukkit.getWorlds()from other threads.Tested on Folia 26.2 and Paper 26.2: regen of unloaded chunks far from spawn, undo, redo,
-b,-c, two concurrent requests; block counts verified afterwards.