天境配置项

基本信息

天境只有一个配置文件:config/aether/AetherI.cfg。

File newFile = new File(location + "/aether" + "/AetherI.cfg");

(AetherConfig.java:53)

配置类为 com.gildedgames.the_aether.AetherConfig,在主模组 preInit 阶段加载(Aether.java:42 → AetherConfig.init(event.getModConfigurationDirectory()))。加载完调用 config.save()(AetherConfig.java:183)。

配置文件不注册 Forge 配置事件(无 FMLConfigurationEvent 订阅),因此修改后必须重启游戏,热重载不生效。

配置分组

配置共分 6 个分组。

Aether World Generation

键 默认值 读取入口 外部调用数
Christmas Content false shouldLoadHolidayContent() 1
Spawns Holiday Trees during December and January automatically. Christmas Content overrides this. true allowSeasonalChristmas() 1
Enable Tall Grass false tallgrassEnabled() 1

(AetherConfig.java:65-74)

World Identification

键 默认值 读取入口 外部调用数
Aether Dimension ID 4 getAetherDimensionID() 28
Aether Biome ID 127 getAetherBiomeID() 1

(AetherConfig.java:76-79)

getAetherDimensionID() 是全模组调用最频繁的读取入口(28 处),被维度注册(AetherWorld.java:38-39)、传送(TeleporterAether)、日轮祭坛(BlockSunAltar.java:65)等大量逻辑依赖。修改后维度 ID 会随之改变,已建存档中的天境维度会失联。

Gameplay

键 默认值 读取入口 外部调用数
Max Life Shards 10 getMaxLifeShards() 1
Spawns Player with Aether Portal Frame false shouldAetherStart() 1
Removes the requirement for a player to be an operator to use the Sun Altar in multiplayer. false sunAltarMultiplayer() 2

(AetherConfig.java:98-99、:107-108、:125-130)

Misc

本组最大,共 17 项。

键 默认值 读取入口 外部调用数
Activate portal with only Skyroot bucket false activateOnlyWithSkyroot() 1
Enables the Valkyrie Cape in dungeon loot true valkyrieCapeEnabled() 1
Enables the Golden Feather in dungeon loot false goldenFeatherEnabled() 1
Dimension below aether 0 getTravelDimensionID() 3
Floating block collision true shouldFloatWithBlock() 0
Disable random trivia false triviaDisabled() 1
Enable Legacy Visuals false oldMobsEnabled() 5
Gives the Player a Book of Lore upon entering the Aether for the first time true 无 getter 0
Gives the Player a Golden Parachute upon entering the Aether for the first time true 无 getter 0
Enables the Aether Menu false menuEnabled() 0
Enables the Aether Menu toggle button true menuButtonEnabled() 0
Determines whether the Aether b1.7.3 resource pack should be generated. true installResourcepack() 1
Changes whether the Altar should be named Enchanter or not. false legacyAltarName() 3
Sets the id for the Inebriation effect. 31 getInebriationId() 1
If disabed, the Sun Spirit's dialog will only show once per world. true repeatSunSpiritDialogue() 2
Disables eternal day making time cycle in the Aether without having to kill the Sun Spirit. This is mainly intended for use in modpacks. false eternalDayDisabled() 3
Toggles the music in the Aether. Disable this if you use another mod that adds custom music (like MusicChoices) true 无 getter 0

(AetherConfig.java:81-149、:142-146)

Sets the id for the Inebriation effect. 决定醉酒药水的药水 ID,被 PotionInebriation.java:36 使用。

配置项键名 If disabed, ... 中的 disabed 是源码里的拼写错误(应为 disabled)。由于 Forge 以字符串为键,改名会导致旧配置失效,故保持原样记录。

Trivia

键 默认值 读取入口 外部调用数
Disable random trivia false triviaDisabled() 1

(AetherConfig.java:92-93)这是唯一使用 Trivia 分组的配置项,其余 22 项均分属其他 5 个分组。

Spawnrates

11 项,全部为 int,形式统一为 1 is always, higher numbers decrease chances.。

键 默认值 读取入口 外部调用点
Phyg Spawnrate. ... 1 getPhygSpawnrate() EntityPhyg.java:65
Flying Cow Spawnrate. ... 1 getFlyingCowSpawnrate() EntityFlyingCow.java:67
Sheepuff Spawnrate. ... 1 getSheepuffSpawnrate() EntitySheepuff.java:88
Aerbunny Spawnrate. ... 1 getAerbunnySpawnrate() EntityAerbunny.java:75
Moa Spawnrate. ... 1 getMoaSpawnrate() EntityMoa.java:111
Aerwhale Spawnrate. ... 1 getAerwhaleSpawnrate() EntityAerwhale.java:57
Zephyr Spawnrate. ... 65 getZephyrSpawnrate() EntityZephyr.java:49
Cockatrice Spawnrate. ... 45 getCockatriceSpawnrate() EntityCockatrice.java:54
Swet Spawnrate. ... 40 getSwetSpawnrate() EntitySwet.java:442
Aechor Plant Spawnrate. ... 55 getAechorPlantSpawnrate() EntityAechorPlant.java:56
Whirlwind Spawnrate. ... 55 getWhirlwindSpawnrate() EntityWhirlwind.java:393

(AetherConfig.java:151-181)

已声明但无任何外部读取的配置项

以下字段已声明、已赋值,但整个仓库中没有任何读取方,因此在 1.7.10 这份源码里修改它们不产生任何效果:

字段 / 读取入口 声明行 赋值行 外部调用数
shouldFloatWithBlock()(floating_block_collision) AetherConfig.java:22 :89-90 0
menuEnabled()(menu_enabled) AetherConfig.java:26 :110-111 0
menuButtonEnabled()(menu_button) AetherConfig.java:26 :112-113 0
book_of_lore AetherConfig.java:36 :100-102 与 :103-105 无 getter
golden_parachute AetherConfig.java:38 无 无 getter
toggle_music AetherConfig.java:42 :142-146 无 getter

核对方法:grep -rn 'AetherConfig\.<getter>(' --include=*.java src/ | grep -v 'AetherConfig.java' | wc -l 对每个读取入口逐一执行,结果均为 0。

字段重复赋值(逐字记录,不断言为缺陷)

book_of_lore 字段被连续赋值两次,第二次的读取键却是 Golden Parachute 的键(AetherConfig.java:100-105):

book_of_lore = config
    .get("Misc", "Gives the Player a Book of Lore upon entering the Aether for the first time", true)
    .getBoolean(true);
book_of_lore = config
    .get("Misc", "Gives the Player a Golden Parachute upon entering the Aether for the first time", true)
    .getBoolean(true);

后果:book_of_lore 最终保存的是金黄云落伞那个键的值,而 Gives the Player a Book of Lore... 这个键的值被立即覆盖丢弃;golden_parachute 字段(:38)因此从未被赋值。

此处逐字记录该现象。本仓库未找到任何注释、commit 说明或文档表明这是有意设计,因此不断言其为缺陷。两个字段都没有 getter,所以无论该现象的成因如何,二者当前都不影响任何游戏行为。

数值

数值名 值 来源
配置文件路径 config/aether/AetherI.cfg AetherConfig.java:53
默认维度 ID 4 AetherConfig.java:76-77
默认生物群系 ID 127 AetherConfig.java:78-79
默认生命幻片上限 10 AetherConfig.java:107-108
默认醉酒药水 ID 31 AetherConfig.java:122-123
默认永昼 开启(eternal_day = false 表示不关闭) AetherConfig.java:136-140
getAetherDimensionID() 调用次数 28 全仓库 grep 统计
无外部读取的配置字段数 6 上表
config.get( 调用总数 23 grep -c 'config\.get\(' AetherConfig.java
配置分组数 6 AetherConfig.java

交互

  • 配置文件不热重载,改完必须重启游戏
  • 维度 ID 与生物群系 ID 修改后已有存档不兼容
  • 醉酒药水 ID 修改后若与其他模组冲突,附魔毒镖箭的毒效会失效

相关条目