Close modded engines per level at unload and in a stopped phase

Server stopping used to close engines, mantle and the generation pools while the loader was still draining chunk generation. Stopping now tears down the services only; the engines and pools close at server stopped, a failed level unload is logged instead of aborting the loader's close loop, and a sweep at the next server start or JVM exit covers a loader that skips the stopped event.

Upstream: 259f88523 782a85c26
This commit is contained in:
piexel committed 2026-11-10 01:07:00 +01:00
1 parent b0f535832e
commit bed98c417d
9 files changed
+192 -26

No files matched your search

@@ -60,6 +60,7 @@ public final class IrisFabricBootstrap implements ModInitializer {
ServerLifecycleEvents.SERVER_STARTING.register((MinecraftServer server) -> ModdedEngineBootstrap.start(server));
ServerLifecycleEvents.SERVER_STARTED.register((MinecraftServer server) -> ModdedEngineBootstrap.serverStarted(server));
ServerLifecycleEvents.SERVER_STOPPING.register((MinecraftServer server) -> ModdedEngineBootstrap.stop());
ServerLifecycleEvents.SERVER_STOPPED.register((MinecraftServer server) -> ModdedEngineBootstrap.stopped());
ServerLevelEvents.LOAD.register((MinecraftServer server, ServerLevel level) -> ModdedEngineBootstrap.levelLoaded(level));
ServerLevelEvents.UNLOAD.register((MinecraftServer server, ServerLevel level) -> ModdedEngineBootstrap.levelUnloaded(level));
CommandRegistrationCallback.EVENT.register((CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext buildContext, Commands.CommandSelection selection) -> IrisModdedCommands.register(dispatcher));