Fix singleplayer disconnect on ESC pause: freeze dimension loops

- New client mixin MixinMinecraftPauseDetector: on each Minecraft.runTick, detect integrated-server pause and freeze/unfreeze all dimension loops via DimThreadCore.setPaused, so no worker writes LevelChunk while the main thread is saving/pausing. Fixes reproducible disconnect (packet decode IndexOutOfBounds on ClientboundLevelChunkWithLight) ~0.5s after opening the pause menu.

- LevelTickLoop: add pause()/resume() (cancel next tick, stop self-rescheduling, re-schedule on resume) plus a paused guard at run() entry. Resilient to RejectedExecutionException when the master pool is already shut down.

- ServerManager.setPaused: pause all loops, then wait up to 5s for the in-flight tick to fully settle before returning.

- Keep existing work: TE whitelist command (/dimensionalripper tewhitelist), shard drop counters (entity/TE/chunk-env), POI lock optimization.
This commit is contained in:
modzuozhi committed 2026-09-12 00:44:23 +08:00
1 parent 3b9320d1e0
commit 801deb701a
12 files changed
+432 -29

No files matched your search

@@ -64,6 +64,7 @@
"YieldJobSiteGuardMixin"
],
"client": [
"MixinMinecraftPauseDetector"
],
"server": [
],