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:
1 parent
3b21fc3aa6
commit
a0d1ec2feb
30 files changed
+1683
-19
No files matched your search
+7
-2
@@ -77,9 +77,14 @@ public final class ServerHooks
|
||||
/**
|
||||
* Called on the main thread for every frame of the main loop, directly after
|
||||
* {@code ServerMap.instance.preupdate()}, inside the {@code frameStep} profiling probe. Not
|
||||
* called while the update limiter skips a frame.
|
||||
* called while the update limiter skips a frame. Posts the tick event and runs the mods'
|
||||
* queued main-thread tasks.
|
||||
*/
|
||||
public static void onTick() {}
|
||||
public static void onTick()
|
||||
{
|
||||
try { ServerHooks.FORGE.tick(); }
|
||||
catch (RuntimeException e) { e.printStackTrace(); }
|
||||
}
|
||||
|
||||
/**
|
||||
* Called once on the shutdown hook thread ({@code GameServer$1}), after
|
||||
|
||||
Reference in new issue
Block a user