显示手部

基本信息

属性 值
所属配置类 MiscConfig
字段 public static boolean showHand
类型 boolean
默认值 false(@Config.DefaultBoolean(false))——即默认不显示
服务端同步 ❌ 无 @Config.Sync
配置分类 category = "misc"
配置注释 Show the player's hand while in freecam

门控的行为:两条并行路径

本配置项是全 mod 唯一同时驱动原版 Mixin 与第三方 mod 事件监听器的选项。

路径一:原版渲染管线(始终生效)

MixinEntityRenderer(早期阶段 Mixin):

@Inject(method = "renderHand", at = @At("HEAD"), cancellable = true)
private void freecam$hideHand(float partialTicks, int pass, CallbackInfo ci) {
    if (FreecamController.instance().isActive() && !MiscConfig.showHand) {
        ci.cancel();
    }
}
环节 值
目标方法 EntityRenderer.renderHand(float, int)
注入点 HEAD + cancellable
门控 isActive() && !MiscConfig.showHand
效果 在方法开头直接 ci.cancel(),整段手部渲染被跳过

路径二:Angelica 光影(仅当 Angelica 装齐时生效)

AngelicaCompat.registerAngelicaHandListener()(@Optional.Method(modid = "angelica")):

RenderHandEvent.BUS.addListener(
    event -> FreecamController.instance().isActive() && !MiscConfig.showHand);
环节 值
入口守卫 Mods.ANGELICA_HAND_EVENT.isLoaded(),在 ClientEventHandler 构造函数中调用
版本门槛 需要 Angelica 2.1.30+(RenderHandEvent 自该版本才加入)
事件 RenderHandEvent,由 Angelica 从 HandRenderer#canRender 派发
效果 源码注释:取消该事件即可在光影下手部被隐藏

两条路径的门控条件完全一致(isActive() && !showHand),因此不会出现 "关光影时手部还在、开光影时手部不见"的割裂。

与物品栏切换的交互

ClientEventHandler.onClientTick 中还有一条独立逻辑:当 切换自由相机 的 F4 按住(toggleKeyHeld == true)时,会把 gameSettings.keyBindsHotbar 中每个按键的 isPressed() 队列清空:

for (KeyBinding hotbarKey : Minecraft.getMinecraft().gameSettings.keyBindsHotbar) {
    while (hotbarKey.isPressed()) {}
}

目的是让玩家在按住 F4 选三脚架机位时,数字键不会同时切换物品栏。 这条逻辑与 showHand 无关,但在实际使用中与手部显示配合出现。

其它配置项

MiscConfig 共 5 项:

字段 类型 默认值 服务端同步
fullBright boolean false ✅
disableSubmersionFog boolean false ✅
overlayVisibility OverlayVisibility HIDE ✅
initialPerspective Perspective INSIDE ❌
showHand boolean false ❌

相关条目