通过广度优先搜索(BFS)扫描算法优化 TNT 连锁反应,以减少大型爆炸时的服务端延迟。
注意:本模组可安全用于竞技多人服务器。由于它专为提升服务端性能而设计,且不影响客户端粒子或渲染系统,因此可以安装在服务器上以大幅改善服务端性能。
通过广度优先搜索(BFS)扫描算法优化 TNT 连锁反应,以减少大型爆炸时的服务端延迟。
工作原理
与原版重复的光线投射扫描不同,TNT Optimiser 使用 BFS 算法,确保爆炸半径内的每个方块仅被访问一次。通过每个刻的共享追踪器记录已扫描的方块,连锁反应中重叠的爆炸会完全跳过冗余工作,而不是重新处理共享方块。
功能特性
- 基于 BFS 的方块扫描 — 每次爆炸中每个方块仅被访问一次
- 跨爆炸去重 — 重叠的爆炸区域不会重新扫描共享方块
- 孤立 TNT 零额外开销 — 单独引爆且周围无其他 TNT 时,瞬间触发,无任何额外计算
- 爆炸半径、伤害和击退效果不变 — 除扫描步骤外,原版爆炸机制保持不变
- 仅限服务端 — 无需安装客户端模组,对所有玩家自动生效
此模组的作用(及未解决的问题)
此模组旨在减轻运行服务器的机器负担——而非缩短 TNT 爆炸所需的时间。在单人游戏中,服务端性能的提升方式相同,这可能会减少大型 TNT 连锁反应期间的卡顿。客户端渲染(如粒子效果)不受影响。
由于扫描使用的是 BFS 而非原版的光线投射模式,单个爆炸形成的弹坑形状可能与原版略有差异。爆炸半径、伤害和击退效果的计算是独立进行的,不受此更改的影响。
Optimises TNT chain reactions using a Breadth-First Search (BFS) scanning algorithm to reduce server-side lag during large explosions.
NOTE: This mod is safe to use on competitive multiplayer servers. As it is designed for server sided performance and doesn't affect client side particle or rendering systems. The mod can be installed on servers to improve server sided performance vastly.
Optimises TNT chain reactions using a Breadth-First Search (BFS) scanning algorithm to reduce server-side lag during large explosions.
How it works
Instead of vanilla's repeated ray-cast scanning, TNT Optimiser uses BFS to visit each block in the blast radius exactly once. A shared per-tick tracker records which blocks have already been scanned, so overlapping explosions from chain reactions skip redundant work entirely instead of re-resolving shared blocks.
Features
- BFS-based block scanning — each block visited exactly once per explosion
- Cross-explosion deduplication — overlapping blast zones don't rescan shared blocks
- Zero overhead for isolated TNT — a single TNT with nothing nearby fires instantly with no extra work
- Radius, damage, and knockback unchanged — vanilla explosion mechanics are preserved outside of the scanning step
- Server-side only — no client install required, works automatically for all players
What this does (and doesn't) fix
This mod reduces the strain on the machine running the server — not the time it takes for TNT to explode. In singleplayer, server-side performance improves the same way, which may reduce lag during large TNT chain reactions. Client-side rendering, such as particles, is unaffected.
Because scanning uses BFS instead of vanilla's ray-cast pattern, individual explosion craters may differ slightly in shape from vanilla. Blast radius, damage, and knockback are computed separately and are not affected by this change.
评论 0
登录后参与评分
还没有评论,来抢沙发吧