Skip to content

Commit 334a91f

Browse files
committed
Merge remote-tracking branch 'origin/1.20' into 1.21.1
2 parents cae2af8 + 4e3ecf9 commit 334a91f

2 files changed

Lines changed: 78 additions & 1 deletion

File tree

.github/workflows/gradle.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
jobs:
1212
build:
1313
runs-on: ubuntu-22.04
14+
permissions:
15+
issues: write
1416
concurrency:
1517
group: release-${{ github.ref }}
1618
cancel-in-progress: true
@@ -52,6 +54,81 @@ jobs:
5254
env:
5355
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
5456
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
57+
- name: Capture mod version
58+
if: steps.check_branch.outputs.is_release == 'true'
59+
run: |
60+
echo "MOD_VERSION=$(./gradlew properties -q | grep '^version:' | awk '{print $2}')" >> $GITHUB_ENV
61+
echo "MC_VERSION=$(grep '^minecraft_version=' gradle.properties | cut -d= -f2)" >> $GITHUB_ENV
62+
- name: Comment on fixed issues
63+
if: steps.check_branch.outputs.is_release == 'true'
64+
uses: actions/github-script@v7
65+
with:
66+
script: |
67+
const { execSync } = require('child_process');
68+
69+
const branch = context.ref.replace('refs/heads/', '');
70+
const { data: runs } = await github.rest.actions.listWorkflowRuns({
71+
owner: context.repo.owner,
72+
repo: context.repo.repo,
73+
workflow_id: 'gradle.yml',
74+
branch,
75+
status: 'success',
76+
per_page: 1
77+
});
78+
79+
const logArgs = runs.workflow_runs.length > 0
80+
? `${runs.workflow_runs[0].head_sha}..${context.sha}`
81+
: `-1 ${context.sha}`;
82+
const log = execSync(`git log ${logArgs} --format=%s%n%b`, { encoding: 'utf8' });
83+
84+
const issueNumbers = new Set();
85+
const pattern = /(?:fix(?:es|ed)?|close[sd]?|resolve[sd]?)\s+#(\d+)/gi;
86+
let match;
87+
while ((match = pattern.exec(log)) !== null) {
88+
issueNumbers.add(parseInt(match[1]));
89+
}
90+
91+
if (issueNumbers.size === 0) {
92+
console.log('No fixed issues found in commits');
93+
return;
94+
}
95+
96+
const MARKER = '<!-- modernfix-fix-tracker -->';
97+
const modVersion = process.env.MOD_VERSION;
98+
const mcVersion = process.env.MC_VERSION;
99+
const newLine = `- ${modVersion} for Minecraft ${mcVersion}`;
100+
101+
for (const issueNumber of issueNumbers) {
102+
try {
103+
const { data: comments } = await github.rest.issues.listComments({
104+
owner: context.repo.owner,
105+
repo: context.repo.repo,
106+
issue_number: issueNumber,
107+
per_page: 100
108+
});
109+
110+
const existing = comments.find(c => c.body.includes(MARKER));
111+
if (existing) {
112+
await github.rest.issues.updateComment({
113+
owner: context.repo.owner,
114+
repo: context.repo.repo,
115+
comment_id: existing.id,
116+
body: existing.body + `\n${newLine}`
117+
});
118+
console.log(`Updated comment on issue #${issueNumber}`);
119+
} else {
120+
await github.rest.issues.createComment({
121+
owner: context.repo.owner,
122+
repo: context.repo.repo,
123+
issue_number: issueNumber,
124+
body: `${MARKER}\nThe fix for this issue has been released in the following versions of ModernFix:\n${newLine}`
125+
});
126+
console.log(`Created comment on issue #${issueNumber}`);
127+
}
128+
} catch (e) {
129+
console.log(`Could not comment on #${issueNumber}: ${e.message}`);
130+
}
131+
}
55132
- name: Upload Artifacts to GitHub
56133
uses: actions/upload-artifact@v4
57134
with:

src/main/java/org/embeddedt/modernfix/core/config/ModernFixEarlyConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private ModernFixEarlyConfig(File file) {
239239
disableIfModPresent("mixin.bugfix.item_cache_flag", "lithium", "canary", "radium");
240240
// DimThread makes changes to the server chunk manager (understandably), C2ME probably does the same
241241
disableIfModPresent("mixin.bugfix.chunk_deadlock", "c2me", "dimthread");
242-
disableIfModPresent("mixin.perf.release_protochunks", "c2me");
242+
disableIfModPresent("mixin.perf.release_protochunks", "c2me", "moonrise");
243243
disableIfModPresent("mixin.launch.class_search_cache", "optifine");
244244
disableIfModPresent("mixin.perf.faster_texture_stitching", "optifine");
245245
disableIfModPresent("mixin.bugfix.entity_pose_stack", "optifine");

0 commit comments

Comments
 (0)