Skip to content

Port Sodium rendering fix to multiplatform-1.21.4 - #12

Merged
squi2rel merged 1 commit into
squi2rel:multiplatform-1.21.4from
cloudfl4re:port-sodium-rendering-fix
Jul 26, 2026
Merged

Port Sodium rendering fix to multiplatform-1.21.4#12
squi2rel merged 1 commit into
squi2rel:multiplatform-1.21.4from
cloudfl4re:port-sodium-rendering-fix

Conversation

@cloudfl4re

Copy link
Copy Markdown
Contributor

背景

#9 反馈"所有配置成功后自动眨眼无法生效",根因是 Sodium 的实体渲染优化绕过了原版 Cuboid#renderCuboid 调用,导致 FTCuboid 的动态面部绘制(包括自动眨眼)完全不执行。#10 已在 multiplatform-1.20.1 分支加入 Sodium 兼容层,但 #11 移植到本分支时只包含了 OSC 修复,缺少 Sodium 渲染部分。本 PR 补齐这部分,使两个分支的修复保持一致。

改动

  • 新增 MCFTMixinPlugin:仅当 classpath 上存在 Sodium 实体渲染 mixin 时才启用兼容 mixin;同时检测 Sodium 0.5(me.jellysquid)与 0.6(net.caffeinemc)两代包名。
  • 新增 ModelPartRenderMixin(priority 900):在 ModelPart#render HEAD 注入,先于 Sodium 的可取消回调执行;当部件包含 FTCuboid 时按原版逻辑渲染(走到 FTCuboid#renderCuboid)并取消,其余部件不受影响、照常使用 Sodium 优化路径。已适配 1.21.4 的 render(...III)V 签名(int 颜色)。
  • ModelPartAccessor 增加 visible/hidden 访问器(与 1.20.1 分支版本一致)。
  • mcft.mixins.json 注册插件与新 mixin。

说明

Sodium 0.6.x(1.21.4 对应版本)当前的拦截点在 Cube#compile 基类方法内(cancellable @Inject),FTCuboid 重写了该方法会天然绕过拦截,因此在现有版本组合下该兼容层保持惰性(运行时探测不到 0.5 风格的 ModelPartData 类时不介入渲染)。此移植主要作为与 1.20.1 分支一致的防护层,防止 ModelPart 级接管式渲染路径(如 Sodium 0.5 风格)在 1.21.4 生态中出现时再次破坏面部渲染。

Refs #9

🤖 Generated with Claude Code

Sodium's entity rendering path can bypass the vanilla
Cuboid#renderCuboid call that MCFT relies on to draw the animated
face, leaving auto blink and face tracking invisible (squi2rel#9). Port the
compatibility layer from multiplatform-1.20.1: a mixin plugin only
enables ModelPartRenderMixin when Sodium's entity renderer is
present, and the mixin renders parts containing an FTCuboid through
the vanilla path before Sodium takes over. Also handles the new
net.caffeinemc package layout used by Sodium 0.6.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@squi2rel
squi2rel merged commit bcec6c5 into squi2rel:multiplatform-1.21.4 Jul 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants