Skip to content

fix(ecs): provide World reference to SystemContext#148

Merged
iverly merged 3 commits intomainfrom
fix/ecs-world-reference
Apr 18, 2026
Merged

fix(ecs): provide World reference to SystemContext#148
iverly merged 3 commits intomainfrom
fix/ecs-world-reference

Conversation

@iverly
Copy link
Copy Markdown
Contributor

@iverly iverly commented Apr 18, 2026

Summary

  • Ecs stores an Option<Arc<World>> set via set_world() at server startup
  • SystemContext::world() returns this reference instead of panicking
  • Fixes PhysicsPlugin crash when ctx.world() is called during system dispatch

Test plan

  • cargo test
  • Connect with MC client, verify physics (gravity, collision) works

iverly added 3 commits April 18, 2026 22:50
Ecs stores an optional Arc<World> set by the server at startup.
SystemContext::world() returns this reference instead of panicking.
Fixes PhysicsPlugin crash when ctx.world() is called during
system dispatch.
Game loop panic: TickLoop::Drop detects thread panic via
JoinHandle::join() and calls process::exit(1). The server
never becomes a zombie with a dead game loop.

Plugin handler panic: dispatch_event() wraps bus.dispatch()
in catch_unwind when crash_on_plugin_panic = false. Panicking
handlers are logged and skipped without killing the game loop.
Net task instant dispatches (chat, commands) are also caught
and logged.

When crash_on_plugin_panic = true (default), plugin panics
propagate normally and crash the game loop → process::exit(1).
Infrastructure panics (game loop, I/O thread) crash the server
via process::exit(1) — detected through JoinHandle::join() in
Drop/stop. The server never becomes a zombie.

Plugin handler panics are caught at the dispatch level via
dispatch_event() with catch_unwind when crash_on_plugin_panic
is false. Net task instant dispatches (chat, commands) are
also caught and logged.

Net task panics are monitored via JoinHandle and logged without
crashing the server. Skin fetch failures are logged with context.
@iverly iverly merged commit 89173f5 into main Apr 18, 2026
22 checks passed
@iverly iverly deleted the fix/ecs-world-reference branch April 18, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant