Port Sodium rendering fix to multiplatform-1.21.4 - #12
Merged
squi2rel merged 1 commit intoJul 26, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
#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#renderHEAD 注入,先于 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