服务器与刷怪概率

基本信息

属性 值
配置分类 Server、Coremod、Skeleton CustomArrow Spawn Rate
读取位置 BattlegearConfig.getConfig(BattlegearConfig.java:85-189)
触发时机 preInit 阶段(Battlegear.java:70)

功能

三个分类的非渲染类配置项。

Server — 网络更新频率

配置项 默认值 范围 含义 来源
Update packet rate 20 1 ~ 20000 网络上更新 battle 背包槽位的发包间隔。数值越低更新越快,但包更多 BattlegearConfig.java:88-94、:57

该项没有调用 setRequiresMcRestart,读入后存入 BattlegearConfig.updateRate 静态字段(BattlegearConfig.java:57)。

Skeleton CustomArrow Spawn Rate — 骷髅刷怪箭矢概率

分类注释:The spawn rate (between 0 & 1) that Skeletons will spawn with Arrows provided from this mod(BattlegearConfig.java:158-160)。共 9 个配置项,键名取自 ItemMBArrow.names,全部 setRequiresMcRestart(true)(BattlegearConfig.java:163-167)。

默认值由下式给出:

config.get(category, ItemMBArrow.names[i], i != 1 && i != 5 ? 0.1D : 0.0D, "", 0D, 1D)
    .setRequiresMcRestart(true).getDouble();

(BattlegearConfig.java:164-166)

metadata 箭矢 默认概率
0 holy 0.1
1 ice 0.0
2 explosive 0.1
3 ender 0.1
4 flame 0.1
5 piercing 0.0
6 poison 0.1
7 mystery 0.1
8 leech 0.1

取值范围 0 ~ 1(BattlegearConfig.java:165),读入 skeletonArrowSpawnRate 数组(BattlegearConfig.java:82)。

源码注释与实现不一致。 BattlegearConfig.java:162 的注释写的是 // default 10% for everything but ender (which is 0%),但三元条件 i != 1 && i != 5 命中的是 ice(索引 1)与 piercing(索引 5),而 ender(索引 3)实际取到的是 0.1。以代码为准:默认概率为 0 的是 ice 与 piercing。

Coremod — ASM debug Mode

配置项 默认值 需要重启 来源
ASM debug Mode false 是 BattlegearConfig.java:95-96

注释:Only use for advanced bug reporting when asked by a dev.

该项读取后即被丢弃,当前版本无实际效果。 源码只对返回的 Property 调用了 setRequiresMcRestart(true),没有调用 getBoolean(),返回值也未赋给任何字段:

config.get("Coremod", "ASM debug Mode", false, "Only use for advanced bug reporting when asked by a dev.")
        .setRequiresMcRestart(true);

(BattlegearConfig.java:95-96)

唯一读取 Battlegear.debug 的地方是 ClientProxy.registerItemRenderers(ClientProxy.java:110),但 Battlegear.debug 在全仓库中只有声明处 public static boolean debug = false;(Battlegear.java:61),从未被赋值为 true:

grep -rn 'debug' --include='*.java' src/

命中 3 处:Battlegear.java:61(声明)、BattlegearConfig.java:95(配置读取)、ClientProxy.java:110(读取)。该配置项因此不构成有效内容。

数值

配置项 默认值 范围 存储字段 来源
Update packet rate 20 1 ~ 20000 updateRate(int) BattlegearConfig.java:57, 88-94
ASM debug Mode false — 无(未读取) BattlegearConfig.java:95-96
9 个刷怪概率项 见上表 0 ~ 1 skeletonArrowSpawnRate(double[]) BattlegearConfig.java:82, 163-167

交互

触发 行为
修改 Update packet rate 写入 updateRate 静态字段
修改任一刷怪概率项 需要重启游戏
修改 ASM debug Mode 需要重启游戏,但功能未实现,改了不起作用

合成配方

不适用。

相关条目