OritechDefender
OritechDefender 是一款服务端 NeoForge 性能模组,旨在减少由 Oritech 机器同步产生的冗余编码与传输。
当同一个 Oritech 方块实体在短时间内产生多个绝对状态更新时,OritechDefender 会保留最新的状态,并根据真实的区块追踪、连接可写性以及受限的发送预算安全地发送该状态。
默认模式为 OBSERVE(观察)。它会在不改变数据包传输的情况下记录真实统计数据。管理员可以在切换到 ENFORCE(强制执行)之前查看结果。
功能特性
- 合并 Oritech 的
TICK 和 SPARSE_TICK 绝对状态更新;
- 仅保留每个方块实体的最新待处理状态;
- 仅向实际追踪相关区块的玩家发送更新;
- 为每位玩家使用独立的队列,防止慢速连接阻塞正常运行的玩家;
- 应用有效载荷计数预算、估算字节预算以及 Netty 背压机制;
- 在发送前立即重新验证维度、区块、方块实体身份以及玩家追踪状态;
- 报告真实的请求、编码、合并、传输、延迟和积压统计数据;
- 可随时切换至
OFF 以恢复 Oritech 的原始传输路径。
实际运行结果
以下累计统计数据是在真实服务器的一次长时间运行会话中记录的:
| 类型 |
请求数 |
已编码数 |
编码缩减率 |
| TICK |
4,768,552 |
1,076,220 |
约 77.43% |
| SPARSE_TICK |
123,237 |
120,114 |
约 2.53% |
| 总计 |
4,891,789 |
1,196,334 |
约 75.54% |
编码缩减率的计算公式为 1 - encoded / requested。结果取决于机器数量、玩家数量、区块追踪情况以及配置。编码缩减率并不等同于网络接口流量的缩减率。
安全边界
OritechDefender 仅管理 Oritech 的 TICK 和 SPARSE_TICK 广播:
INITIAL、GUI_OPEN、GUI_TICK 和 CUSTOM 始终直接通过;
- 定向的
sendUpdate(type, player) 同步始终直接通过;
- 机器的 ticking、能量、物品、流体、配方、NBT 和世界数据均未被修改;
- 不会强制加载区块;
- 不会写入世界
SavedData;
- 当版本或精确注入点不匹配时,优化将保持禁用状态;
- 队列已满、线程或实体验证失败或编码异常时,会保留原始传输路径。
OritechDefender 不需要进行世界数据迁移。停止服务器并移除其 JAR 文件即可恢复到未安装状态。
要求
- Minecraft: 1.21.1
- 加载器: NeoForge 21.1.240 或更高版本(21.1.x 系列)
- Oritech: 1.2.8
- 安装端: 仅限服务端
- Java: 21
OritechDefender 会验证完整的 Oritech 1.2.8 JAR 指纹以及所需的 Mixin 注入点。如果使用不同、经过修改或不支持的 Oritech 构建版,将被报告为 PASS_THROUGH(直通);不会强制启用优化。
安装步骤
- 停止服务器。
- 备份 world、mods 和 config 目录。
- 将 OritechDefender 的 JAR 文件放入服务器的
mods 目录中。
- 确保已安装受支持的 Oritech 1.2.8 JAR 文件,文件名为
oritech-neoforge-1.21.1-1.2.8.jar。
- 启动服务器。
- 运行
/oritechdefender status。
- 确认 Oritech 被报告为
SUPPORTED,然后在具有代表性的峰值负载期间保持 OBSERVE 启用状态。
- 确认统计数据和服务端状态健康后,运行
/oritechdefender mode enforce。
客户端无需安装 OritechDefender。
命令
/oritechdefender status
显示当前模式、兼容性门控、钩子活动、请求/编码/合并/传输计数器、调度器计时、积压、背压、失效和安全打开(fail-open)统计数据。
/oritechdefender top [1..60]
显示选定时间窗口内最繁忙的维度、区块和 Oritech 同步类型。
/oritechdefender player <name>
显示指定玩家的待处理数量、最旧条目年龄、上一刻传输量、连接可写性以及压力状态。
/oritechdefender mode <off|observe|enforce>
OFF: 使用 Oritech 的原始传输行为。
OBSERVE: 记录统计数据但不改变传输方式。
ENFORCE: 启用安全的合并、独立队列和背压机制。
此命令需要权限等级 2。所选模式会持久化保存到配置文件中。
/oritechdefender reload
重新加载配置文件。需要权限等级 2。
/oritechdefender resetstats
清除累积的统计数据。需要权限等级 2。
阅读统计数据
requested: 由 Oritech 发起的同步请求;
encoded: 实际进行编码的 Oritech 有效载荷;
coalesced: 被更新状态替换因而未单独发送的请求;
sent: 实际发送给玩家的目标-有效载荷;
deferred: 因预算或背压而推迟的调度尝试;
pending: 当前等待在玩家队列中的状态;
oldest: 最旧待处理条目的年龄;
failOpen: 安全检查失败时保留原始路径的次数;
queueFull: 有界队列达到配置限制的次数。
sent 可能高于 encoded,因为一个已编码的有效载荷可以发送给追踪同一区块的多名玩家。
推荐部署流程
OBSERVE → ENFORCE → 如有需要则切换为 OFF
在具有代表性的峰值负载期间保持 OBSERVE 启用状态,并在启用 ENFORCE 之前保存 status 和 top 60 的输出。如果出现任何问题,请立即运行:
/oritechdefender mode off
配置
首次启动服务器时会创建:
config/oritechdefender-server.toml
默认最小同步间隔:
- TICK: 10 ticks
- SPARSE_TICK: 100 ticks
默认设置优先考虑状态新鲜度和安全回滚。增加这些间隔可能会减少更多编码开销,但也会增加客户端可见的状态延迟。建议不要在没有受控对比测试的情况下进行激进更改。
问题反馈
在报告问题时,请包含以下内容:
- Minecraft、NeoForge、OritechDefender 和 Oritech 的版本;
/oritechdefender status 命令的脱敏输出;
- 当前配置文件;
- 最小化复现步骤;
- 相关日志和异常堆栈跟踪;
- 切换至
OFF 是否能停止该问题。
发布前请移除服务器地址、玩家信息、认证令牌、RCON 密码及其他敏感数据。
OritechDefender
OritechDefender is a server-side NeoForge performance mod that reduces redundant
encoding and delivery generated by Oritech machine synchronization.
When the same Oritech block entity produces multiple absolute-state updates in a
short period, OritechDefender keeps the latest state and delivers it safely
according to real chunk tracking, connection writability, and bounded send
budgets.
The default mode is OBSERVE. It records real statistics without changing
packet delivery. Administrators can review the results before switching to
ENFORCE.
Features
- Coalesces Oritech
TICK and SPARSE_TICK absolute-state updates;
- Keeps only the latest pending state for each block entity;
- Sends updates only to players who are actually tracking the relevant chunk;
- Uses an independent queue for every player, so a slow connection cannot block
healthy players;
- Applies payload-count budgets, estimated-byte budgets, and Netty backpressure;
- Revalidates the dimension, chunk, block entity identity, and player tracking
state immediately before sending;
- Reports real request, encoding, coalescing, delivery, deferral, and backlog
statistics;
- Can switch to
OFF at any time to restore Oritech's original delivery path.
Real-World Results
The following cumulative statistics were recorded during a long-running session
on a real server:
| Type |
requested |
encoded |
Encoding reduction |
| TICK |
4,768,552 |
1,076,220 |
About 77.43% |
| SPARSE_TICK |
123,237 |
120,114 |
About 2.53% |
| Total |
4,891,789 |
1,196,334 |
About 75.54% |
Encoding reduction is calculated as 1 - encoded / requested. Results depend on
machine count, player count, chunk tracking, and configuration. Encoding
reduction is not the same as network-interface traffic reduction.
Safety Boundaries
OritechDefender manages only Oritech TICK and SPARSE_TICK broadcasts:
INITIAL, GUI_OPEN, GUI_TICK, and CUSTOM always pass through;
- Targeted
sendUpdate(type, player) synchronization always passes through;
- Machine ticking, energy, items, fluids, recipes, NBT, and world data are not
modified;
- It does not force chunks to load;
- It does not write world
SavedData;
- Optimization remains disabled when the version or exact injection points do
not match;
- A full queue, failed thread or entity validation, or an encoding exception
preserves the original delivery path.
OritechDefender does not require a world-data migration. Stop the server and
remove its JAR to return to an uninstalled state.
Requirements
- Minecraft: 1.21.1
- Mod loader: NeoForge 21.1.240 or newer within the 21.1.x line
- Oritech: 1.2.8
- Installation side: Server only
- Java: 21
OritechDefender verifies the full Oritech 1.2.8 JAR fingerprint and the required
Mixin injection points. A different, modified, or unsupported Oritech build is
reported as PASS_THROUGH; optimization is not forced.
Installation
- Stop the server.
- Back up the world,
mods, and config directories.
- Place the OritechDefender JAR in the server's
mods directory.
- Make sure the supported Oritech 1.2.8 JAR is installed as
oritech-neoforge-1.21.1-1.2.8.jar.
- Start the server.
- Run
/oritechdefender status.
- Confirm that Oritech is reported as
SUPPORTED, then keep OBSERVE enabled
through a representative peak-load period.
- After confirming that the statistics and server state are healthy, run
/oritechdefender mode enforce.
Clients do not need to install OritechDefender.
Commands
/oritechdefender status
Displays the current mode, compatibility gate, hook activity, request/encoding/
coalescing/delivery counters, scheduler timing, backlog, backpressure,
invalidation, and fail-open statistics.
/oritechdefender top [1..60]
Displays the busiest dimensions, chunks, and Oritech synchronization types in
the selected time window.
/oritechdefender player <name>
Displays the selected player's pending count, oldest-entry age, previous-tick
delivery volume, connection writability, and pressure state.
/oritechdefender mode <off|observe|enforce>
OFF: Uses Oritech's original delivery behavior.
OBSERVE: Records statistics without changing delivery.
ENFORCE: Enables safe coalescing, independent queues, and backpressure.
This command requires permission level 2. The selected mode is persisted in the
configuration file.
/oritechdefender reload
Reloads the configuration. Requires permission level 2.
/oritechdefender resetstats
Clears accumulated statistics. Requires permission level 2.
Reading the Statistics
requested: Synchronization requests initiated by Oritech;
encoded: Oritech payloads that were actually encoded;
coalesced: Requests replaced by a newer state and therefore not sent
separately;
sent: Recipient-payloads actually delivered to players;
deferred: Scheduling attempts postponed by a budget or backpressure;
pending: States currently waiting in a player queue;
oldest: Age of the oldest pending entry;
failOpen: Times a failed safety check preserved the original path;
queueFull: Times a bounded queue reached its configured limit.
sent may be higher than encoded because one encoded payload can be delivered
to multiple players who are tracking the same chunk.
Recommended Rollout
OBSERVE → ENFORCE → OFF if needed
Keep OBSERVE enabled during a representative peak-load period and save the
output of status and top 60 before enabling ENFORCE. If a problem appears,
immediately run:
/oritechdefender mode off
Configuration
The first server start creates:
config/oritechdefender-server.toml
Default minimum synchronization intervals:
- TICK: 10 ticks
- SPARSE_TICK: 100 ticks
The defaults prioritize state freshness and safe rollback. Increasing these
intervals may reduce more encoding, but it also increases visible client-side
state latency. Aggressive changes are not recommended without controlled
comparison testing.
Reporting Issues
When reporting a problem, include:
- Minecraft, NeoForge, OritechDefender, and Oritech versions;
- Redacted output from
/oritechdefender status;
- The current configuration file;
- Minimal reproduction steps;
- Relevant logs and exception stack traces;
- Whether switching to
OFF stops the problem.
Remove server addresses, player information, authentication tokens, RCON
passwords, and other sensitive data before posting.
评论 0
登录后参与评分
还没有评论,来抢沙发吧