fix(ci): Use Java 11 in CI workflow for ForgeGradle compatibility#97
fix(ci): Use Java 11 in CI workflow for ForgeGradle compatibility#97hattapauzi wants to merge 4 commits intoHttpRafa:forge/1.12.2from
Conversation
Add a client mixin for multiplayer server-list entries so servers routed through modflared display the existing indicator icon. Position the indicator away from the Forge modded-server compatibility badge and use direct visible strings for the hover and connection status text to avoid untranslated lang keys appearing in-game. Register the new mixin and keep the language entry for the server-list tooltip resource.
Reset the render color to white before binding and drawing the modflared server-list indicator. This prevents the indicator texture from inheriting tint from previous server-list rendering state or other modded indicators.
Restore localization lookups for the server-list tooltip and connection feedback while preserving English fallbacks when the legacy client returns unresolved translation keys. This addresses the review feedback without reintroducing the in-game issue where raw translation keys appeared in the UI.
Update the Forge 1.12.2 artifact version from 1.12.2-legacy.1 to 1.12.2-1 now that the branch is tested and feature complete. This changes the generated jar names to drop the legacy qualifier while preserving the mod id and build configuration.
There was a problem hiding this comment.
Code Review
This pull request updates the mod version and introduces a visual indicator in the multiplayer server list to show when a Cloudflare tunnel is active. It also refactors translation logic to provide fallbacks when localization keys are missing. Feedback was provided regarding a version mismatch between configuration files, a potential server-side crash due to client-only mixins being registered in the common list, and a redundant null check in the translation helper.
| mod_name=Modflared | ||
| mod_license=MIT | ||
| mod_version=1.12.2-legacy.1 | ||
| mod_version=1.12.2-1 |
There was a problem hiding this comment.
| "client.GuiConnectingMixin", | ||
| "client.GuiConnectingThreadMixin", | ||
| "client.ServerDataMixin", | ||
| "client.ServerListEntryNormalMixin", |
There was a problem hiding this comment.
This mixin targets ServerListEntryNormal, which is a client-only class. Adding it to the main mixins list in a common mixin configuration will cause a ClassNotFoundException when the mod is loaded on a dedicated server. It should be moved to the client array (line 15) to ensure it only loads on the client side. Note that other client-side mixins in this list (lines 9-13) likely share this issue.
| @Unique | ||
| private static String modflared$translate(String key, String fallback) { | ||
| String translated = I18n.format(key); | ||
| if (translated == null || translated.equals(key)) { |
There was a problem hiding this comment.
|
Let say if this fix is successful, would it still means that MixinBootstrap still be needed as dependencies? |
|
We should use Java 8 because Minecraft 1.12.2 uses it. |
Summary
Fix CI build failure by using Java 11 instead of Java 21, as ForgeGradle 2.3 and Gradle 4.x require the Pack200 API which was removed in Java 14.
Context
The CI workflow was configured to use Java 21, which caused the build to fail with:
The Pack200 API was deprecated in Java 8 and removed in Java 14. Since this project uses ForgeGradle 2.3 and Gradle 4.10.3 (an older toolchain for Minecraft 1.12.2), Java 11 is the appropriate choice as it still includes Pack200 support.
Changes
21to11in.github/workflows/build_publish.ymlTesting
The change can be verified by running the CI workflow, which should now complete successfully without Pack200 errors.
Links
java/util/jar/Pack200inapplyBinaryPatchestask