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:
1 parent
3b9320d1e0
commit
801deb701a
12 files changed
+432
-29
No files matched your search
@@ -6,7 +6,7 @@ Dimensional Ripper 是一个基于 **NeoForge 1.21.1** 的多线程维度并行
|
||||
|
||||
- **维度并行 Tick**:每个维度拥有独立的 tick 循环与 worker 线程,维度之间互不拖累——单维度低 TPS 不会影响其他维度。
|
||||
- **细粒度并行**:在维度内部对实体、方块实体、区块环境 tick 进行并行调度,充分压榨多核性能。
|
||||
- **实体分片并行 (ShardGate)**:实体按稳定 ID 分为与 CPU 核数对应的若干片,每片由跨 tick 的 CAS 门控独立提交。单个慢分片自动掉拍延后,不再阻塞整个实体 tick 屏障——把"单点慢"从拖垮全局变成只拖自己。
|
||||
- **分片并行 (ShardGate)**:实体/方块实体/区块环境三阶段统一按稳定键分片(实体按 ID、TE 按方块坐标、区块环境按区块坐标),每片由跨 tick 的 CAS 门控独立提交。单个慢分片自动掉拍延后,不再阻塞对应阶段的并行屏障——把"单点慢"从拖垮全局变成只拖自己。
|
||||
- **POI 并发锁优化**:将村民等实体高频读取的职业兴趣点(POI)存储从全互斥同步容器替换为无锁并发容器,消除并行 tick 下的全局锁瓶颈。约 1.9 万村民压测下 TPS 由 9 提升至 20(16 核)。
|
||||
- **碰撞优化**:可禁用实体间碰撞,消除 O(n²) 碰撞开销,显著释放 TPS。
|
||||
- **异步传送门传送**:支持原版下界/末地传送门与模组维度(如暮色森林、以太)传送门的异步预加载与渐进生成,避免传送到未加载区块导致的卡顿、冻结与虚空传送。
|
||||
@@ -29,7 +29,7 @@ Dimensional Ripper 是一个基于 **NeoForge 1.21.1** 的多线程维度并行
|
||||
|------|------|
|
||||
| `/dimensionalripper status` | 查看当前状态、TPS、各开关与掉拍分片统计 |
|
||||
| `/dimensionalripper fine on\|off` | 开关维度内细粒度并行(实体/方块实体/区块环境) |
|
||||
| `/dimensionalripper fine sharded on\|off` | 开关实体分片并行(ShardGate,默认开启) |
|
||||
| `/dimensionalripper fine sharded on\|off` | 开关分片并行(实体/TE/区块环境,ShardGate,默认开启) |
|
||||
| `/dimensionalripper nocollide on\|off` | 开关实体碰撞优化(默认开启) |
|
||||
|
||||
模组**默认启用**多线程与分片并行,开箱即用,无需额外配置。
|
||||
|
||||
Reference in new issue
Block a user