Skip to content

修复早期 Mixin 日志导致的 KubeJS 启动崩溃 - #459

Merged
QiuYe-QAQ merged 1 commit into
1.21from
qy/fix-kubejs-early-classloading
Nov 20, 2026
Merged

QiuYe-QAQ merged 1 commit into
1.21from
qy/fix-kubejs-early-classloading

Conversation

@QiuYe-QAQ

Copy link
Copy Markdown
Member

Mixin 准备阶段如果通过 Data_Energistics.LOGGER 记录跳过原因,会触发模组主类的静态初始化。MutableComponent 会经由 ResourceLocation 被提前加载,KubeJS 因此无法为它添加 ComponentKJS。物品提示调用 kjs$gold() 时报错,随后错误界面调用 kjs$gray() 时崩溃。

DataEnergisticsMixinPlugin 现在用自己的私有 Log4j 日志器记录跳过原因和兼容性警告,避免在这两个回调中初始化模组主类。

验证

  • gradlew.bat --offline --console=plain jar spotlessJavaCheck 通过。
  • 在隔离的整合包副本中运行本次构建的 JAR。使用 KubeJS 2101.7.2-build.381 和 NeoForge 21.1.267,确认 MutableComponent 获得了 ComponentKJS,原有物品提示脚本以及 Text.gold()、Text.gray() 回归验证均通过,KubeJS 客户端日志为 0 条错误。

@github-actions github-actions Bot added the 1.21 label Nov 20, 2026
@QiuYe-QAQ QiuYe-QAQ added type: bugfix General bug fixes Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. labels Nov 20, 2026
@github-actions github-actions Bot added the Tests: Passed Game Tests have passed on this PR label Nov 20, 2026
@QiuYe-QAQ
QiuYe-QAQ merged commit 94b57d6 into 1.21 Nov 20, 2026
5 of 7 checks passed
@QiuYe-QAQ
QiuYe-QAQ deleted the qy/fix-kubejs-early-classloading branch November 20, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.21 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. Tests: Passed Game Tests have passed on this PR type: bugfix General bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant