You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Chunk lifecycle events with chunk systems that replace vanilla's (e.g. Moonrise) #302
FFAPI fires ServerChunkEvents.CHUNK_LOAD, CHUNK_GENERATE, CHUNK_UNLOAD and FULL_CHUNK_STATUS_CHANGE from mixins into vanilla ChunkStatusTasks.full, ChunkMap.scheduleUnload and ChunkHolder.updateFutures. Moonrise replaces those code paths, so with Moonrise installed none of these events fire, and LoadedChunksCache stays empty (Tuinity/Moonrise#210). Moonrise does post NeoForge's ChunkEvent.Load/Unload.
On Fabric, Moonrise fires the Fabric API events itself. On NeoForge we're unsure where this should live. If Moonrise fires FFAPI's events and FFAPI later starts translating NeoForge's chunk events, everything would fire twice. If FFAPI translates NeoForge's events, the timing changes slightly: on plain NeoForge, ChunkEvent.Unload is posted after the chunk is saved, while Fabric API's CHUNK_UNLOAD fires before it. FULL_CHUNK_STATUS_CHANGE has no NeoForge equivalent either way.
How would you prefer to handle this, so these events work with other chunk systems without risking double dispatch?
C2ME's developer has already requested that FFAPI fire these events from NeoForge's events, and was recommended to make a PR to implement this. That seems like the most reasonable option to me.
The main thing to consider is if the unload timing change is acceptable; it seems like it could lead to data loss. NeoForge firing unload after save is acceptable in their API as they have a separate save event.
I looked for mods that would be affected by the unload timing change. Of the public code GitHub search covers (316 CHUNK_UNLOAD listeners and 152 BLOCK_ENTITY_UNLOAD listeners), almost all only clear their own caches or trackers, or save to separate storage. The only one I found that relies on CHUNK_UNLOAD running before the chunk is saved is SteamCraft, which re-sets a chunk attachment there so recent changes get saved. Fabric API doesn't document that ordering either, so the impact looks small in practice.
Activity
cassiancc commentedon Oct 31, 2026
C2ME's developer has already requested that FFAPI fire these events from NeoForge's events, and was recommended to make a PR to implement this. That seems like the most reasonable option to me.
jpenilla commentedon Oct 31, 2026
The main thing to consider is if the unload timing change is acceptable; it seems like it could lead to data loss. NeoForge firing unload after save is acceptable in their API as they have a separate save event.
jpenilla commentedon Nov 1, 2026
I looked for mods that would be affected by the unload timing change. Of the public code GitHub search covers (316
CHUNK_UNLOADlisteners and 152BLOCK_ENTITY_UNLOADlisteners), almost all only clear their own caches or trackers, or save to separate storage. The only one I found that relies onCHUNK_UNLOADrunning before the chunk is saved is SteamCraft, which re-sets a chunk attachment there so recent changes get saved. Fabric API doesn't document that ordering either, so the impact looks small in practice.cassiancc commentedon Nov 1, 2026
Steamcraft is also only on 1.21.1 - which versions were you looking to make this change on?
jpenilla commentedon Nov 1, 2026
Moonrise currently support 26.1.2 (anticipated Neo LTS) and 26.3. So in that case I can open a PR shortly.