Introduce event-driven API, modular threading, and enhanced server lifecycle tools

Add `Events` and `EventBus` for mod-driven event handling with support for main-thread and mod-thread execution. Introduce `MainThread` and `AsyncExecutor` for modular threading and background task management. Add `ForgeSettings` to manage global mod configuration through `forge.toml`. Include tests for events, threading, and configuration parsing to improve robustness and maintainability.
This commit is contained in:
Overlord committed 2026-10-02 12:58:40 +02:00
1 parent 3b21fc3aa6
commit a0d1ec2feb
30 files changed
+1683 -19

No files matched your search

+3 -1
View File
@@ -70,7 +70,9 @@ Notes:
the folder is writable by UID 1000. `[forge]` `enabled = false` in it switches the mod off.
A mod that cannot be loaded (missing dependency, wrong game version, game classes that do
not exist in the running version, failing `onLoad`) stops the server with exit code 1 and
lists every problem in the log.
lists every problem in the log. Optional `/forge/forge.toml`: `[main_thread] budget_ms`
(time per tick for mods' main-thread tasks, default 2) and `[shutdown] timeout_s` (time
mod threads get to finish when the server stops, default 10).
- **Stopping:** `SIGTERM` triggers the game's own save-and-quit. Allow enough time for large
worlds (`podman stop -t 120`, `stop_grace_period` in compose).