Canary
矿井中毒气的早期预警。
Canary 是一个模组,用于检测其他模组中的危险行为并提供多种诊断工具。
检测到的问题
BlockState 属性注入
一些模组试图向原版方块添加新的 BlockState 属性。 不幸的是,这很可能导致方块不同步(desync)。
解决方案:
- 使用 Statement,这是一个专为安全执行此操作而设计的库
- 改用自定义方块,并在需要时在其与原版方块之间进行转换
同步实体数据注入
一些模组试图向原版实体类添加新的同步数据条目(EntityDataAccessor)。
这样做很可能导致难以排查的网络错误,因为客户端和服务器之间的字段顺序并不稳定。
解决方案:
- 使用 数据附件
- 将值存储在普通字段中,并通过自定义数据包进行同步
诊断功能
此外,Canary 还具备以下诊断功能:
- 当在配置中启用时(
"print_blockstate_report": true),会将 BlockState 报告打印到日志中 - 命令
/canaryclient diagnoseDesync将在客户端和服务器上生成方块状态报告
趣味事实
该模组的名字来源于现实中在煤矿中使用金丝雀来检测有毒气体的做法。就像现实中的金丝雀一样,如果金丝雀死了(游戏崩溃),那你就有麻烦了。
Canary
An early warning of poison in the mines.
Canary is a mod that detects dangerous behaviors in other mods and provides several diagnostic tools.
Detected Issues
BlockState Property Injection
Some mods try to add new BlockState properties to vanilla blocks. Unfortunately, this is likely to cause block desyncs.
Solutions:
- Use Statement, a library designed to do this safely
- Use a custom block instead, converting between it and the vanilla block as needed
Synced Entity Data Injection
Some mods try to add new synced data entries (EntityDataAccessors) to vanilla entity classes.
Doing this is likely to cause inscrutable networking errors, since field order is not stable between clients and the server.
Solutions:
- Use a Data Attachment
- Store values in normal fields, and sync them with custom packets
Diagnostics
In addition, Canary has the following diagnostic features:
- when enabled in the config (
"print_blockstate_report": true), a report of BlockStates will be printed to the log - the command
/canaryclient diagnoseDesyncwill generate a report of blockstates on the client and server
Fun Fact
This mod is named after the real life practice of using canaries in coal mines to detect poisonous gasses. Like the real life counterpart, if the canary dies (the game crashes), you've got a problem.
下载 Canary
下载 Canary
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Canary
下载 Canary
下载 Canary
下载 Canary
下载 Canary
下载 Canary
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Canary
下载 Canary
- 更新至 26.1
- 移除了过时的检查(
fabric模组 ID 依赖、EntityDataSerializers注册) desync_diagnostics_permission_level配置值现在使用权限等级名称而非整数(all、moderators、gamemasters、admins、owners)
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧