全亮度
基本信息
| 属性 | 值 |
|---|---|
| 所属配置类 | MiscConfig(config/MiscConfig.java) |
| 字段 | public static boolean fullBright |
| 类型 | boolean |
| 默认值 | false(@Config.DefaultBoolean(false)) |
| 服务端同步 | ✅ @Config.Sync |
| 配置分类 | category = "misc" |
| 配置注释 | Enable full brightness while in freecam |
门控的行为
实现点是 MixinEntityRenderer(早期阶段 Mixin):
@ModifyExpressionValue(
method = "updateLightmap",
at = @At(value = "FIELD",
target = "Lnet/minecraft/client/settings/GameSettings;gammaSetting:F",
opcode = Opcodes.GETFIELD))
private float freecam$fullbrightGamma(float original) {
if (FreecamController.instance().isActive() && MiscConfig.fullBright) {
return 100.0F;
}
return original;
}
| 环节 | 值 |
|---|---|
| 注入器 | @ModifyExpressionValue(mixinExtras),作用于 updateLightmap 中对 gammaSetting 的读操作 |
| 生效值 | 100.0F |
| 门控 | isActive() && MiscConfig.fullBright——退出自由相机即自动还原 |
源码注释说明了为何不直接改 gammaSetting 字段本身:
Apply fullbright at render time instead of mutating the persistent gammaSetting, so a force-quit while in freecam cannot leave the saved gamma stuck on full bright.
即只在渲染时替换读值,不写回持久化的游戏设置。若直接赋值,freecam 期间强退游戏就会把
options.txt 里的亮度永久留成全亮。
其它配置项
MiscConfig 共 5 项(按字段声明顺序):
| 字段 | 类型 | 默认值 | 服务端同步 |
|---|---|---|---|
fullBright |
boolean |
false |
✅ |
| disableSubmersionFog | boolean |
false |
✅ |
| overlayVisibility | OverlayVisibility |
HIDE |
✅ |
| initialPerspective | Perspective |
INSIDE |
❌ |
| showHand | boolean |
false |
❌ |
相关条目
- Mixin 加载阶段 -
updateLightmap注入在全部 7 个 Mixin 中的位置 - 自由相机状态机 -
isActive()的含义与退出路径 - 显示手部 - 同属
MiscConfig,同样有原版注入 + Angelica 监听器两条路径 - 禁用浸没雾 - 另一个改写渲染读取的
MiscConfig项