From b765bcb51f4d335d639ce50543c6b11fde81fc9e Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Wed, 22 Apr 2026 19:27:07 -0400 Subject: [PATCH 1/4] Improve compatibility with mods that inject into ModelBaker.bake Fixes #646 --- .../mixin/perf/dynamic_resources/ModelBakeryMixin.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/ModelBakeryMixin.java b/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/ModelBakeryMixin.java index f8a08e42..d3b3a5f9 100644 --- a/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/ModelBakeryMixin.java +++ b/src/main/java/org/embeddedt/modernfix/common/mixin/perf/dynamic_resources/ModelBakeryMixin.java @@ -374,7 +374,12 @@ public abstract class ModelBakeryMixin implements IExtendedModelBakery { ModelBakery self = (ModelBakery) (Object) this; ModelBaker theBaker = self.new ModelBakerImpl(textureGetter, modelLocation); ((IExtendedModelBaker)theBaker).throwOnMissingModel(true); - synchronized(this) { m = theBaker.bake(modelLocation, state, theBaker.getModelTextureGetter()); } + synchronized(this) { + // We intentionally use the 2-arg overload for better mixin compatibility, because we use the baker's default + // texture getter anyway. + //noinspection deprecation + m = theBaker.bake(modelLocation, state); + } if(m != null) loadedBakedModels.put(key, m); return m; From 46dd5ecddda040f265462943b663c269fcb1c762 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Wed, 22 Apr 2026 19:36:59 -0400 Subject: [PATCH 2/4] Comment on issues when fix is released Fixes #649 --- .github/workflows/gradle.yml | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 5b621513..037848bf 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -11,6 +11,8 @@ on: jobs: build: runs-on: ubuntu-22.04 + permissions: + issues: write concurrency: group: release-${{ github.ref }} cancel-in-progress: true @@ -52,6 +54,57 @@ jobs: env: CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + - name: Capture mod version + if: steps.check_branch.outputs.is_release == 'true' + run: echo "MOD_VERSION=$(./gradlew properties -q | grep '^version:' | awk '{print $2}')" >> $GITHUB_ENV + - name: Comment on fixed issues + if: steps.check_branch.outputs.is_release == 'true' + uses: actions/github-script@v7 + with: + script: | + const { execSync } = require('child_process'); + + const branch = context.ref.replace('refs/heads/', ''); + const { data: runs } = await github.rest.actions.listWorkflowRuns({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: 'gradle.yml', + branch, + status: 'success', + per_page: 1 + }); + + const logArgs = runs.workflow_runs.length > 0 + ? `${runs.workflow_runs[0].head_sha}..${context.sha}` + : `-1 ${context.sha}`; + const log = execSync(`git log ${logArgs} --format=%s%n%b`, { encoding: 'utf8' }); + + const issueNumbers = new Set(); + const pattern = /(?:fix(?:es|ed)?|close[sd]?|resolve[sd]?)\s+#(\d+)/gi; + let match; + while ((match = pattern.exec(log)) !== null) { + issueNumbers.add(parseInt(match[1])); + } + + if (issueNumbers.size === 0) { + console.log('No fixed issues found in commits'); + return; + } + + const version = process.env.MOD_VERSION; + for (const issueNumber of issueNumbers) { + try { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + body: `The fix for this issue has been released in ModernFix ${version}` + }); + console.log(`Commented on issue #${issueNumber}`); + } catch (e) { + console.log(`Could not comment on #${issueNumber}: ${e.message}`); + } + } - name: Upload Artifacts to GitHub uses: actions/upload-artifact@v4 with: From a40363c1fb2c247e14e1b7cba8d0811489ca4cb0 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Wed, 22 Apr 2026 19:42:45 -0400 Subject: [PATCH 3/4] Improve issue comment workflow [skip ci] --- .github/workflows/gradle.yml | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 037848bf..b22cbe7f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -56,7 +56,9 @@ jobs: MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - name: Capture mod version if: steps.check_branch.outputs.is_release == 'true' - run: echo "MOD_VERSION=$(./gradlew properties -q | grep '^version:' | awk '{print $2}')" >> $GITHUB_ENV + run: | + echo "MOD_VERSION=$(./gradlew properties -q | grep '^version:' | awk '{print $2}')" >> $GITHUB_ENV + echo "MC_VERSION=$(grep '^minecraft_version=' gradle.properties | cut -d= -f2)" >> $GITHUB_ENV - name: Comment on fixed issues if: steps.check_branch.outputs.is_release == 'true' uses: actions/github-script@v7 @@ -91,16 +93,38 @@ jobs: return; } - const version = process.env.MOD_VERSION; + const MARKER = ''; + const modVersion = process.env.MOD_VERSION; + const mcVersion = process.env.MC_VERSION; + const newLine = `- ${modVersion} for Minecraft ${mcVersion}`; + for (const issueNumber of issueNumbers) { try { - await github.rest.issues.createComment({ + const { data: comments } = await github.rest.issues.listComments({ owner: context.repo.owner, repo: context.repo.repo, issue_number: issueNumber, - body: `The fix for this issue has been released in ModernFix ${version}` + per_page: 100 }); - console.log(`Commented on issue #${issueNumber}`); + + const existing = comments.find(c => c.body.includes(MARKER)); + if (existing) { + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: existing.id, + body: existing.body + `\n${newLine}` + }); + console.log(`Updated comment on issue #${issueNumber}`); + } else { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: issueNumber, + body: `${MARKER}\nThe fix for this issue has been released in the following versions of ModernFix:\n${newLine}` + }); + console.log(`Created comment on issue #${issueNumber}`); + } } catch (e) { console.log(`Could not comment on #${issueNumber}: ${e.message}`); } From 4e3ecf9b6d7ab3ebecbc0604db916cd4922689fc Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Mon, 27 Apr 2026 19:52:08 -0400 Subject: [PATCH 4/4] Disable `mixin.perf.release_protochunks` when Moonrise is present Fixes #652 --- .../embeddedt/modernfix/core/config/ModernFixEarlyConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java b/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java index 3743d065..7bc8a9e6 100644 --- a/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java +++ b/src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java @@ -241,7 +241,7 @@ public class ModernFixEarlyConfig { disableIfModPresent("mixin.bugfix.item_cache_flag", "lithium", "canary", "radium"); // DimThread makes changes to the server chunk manager (understandably), C2ME probably does the same disableIfModPresent("mixin.bugfix.chunk_deadlock", "c2me", "dimthread"); - disableIfModPresent("mixin.perf.release_protochunks", "c2me"); + disableIfModPresent("mixin.perf.release_protochunks", "c2me", "moonrise"); disableIfModPresent("mixin.launch.class_search_cache", "optifine"); disableIfModPresent("mixin.perf.faster_texture_stitching", "optifine"); disableIfModPresent("mixin.bugfix.entity_pose_stack", "optifine");