Skip to content

Commit 5d6bbba

Browse files
authored
feat: 1.21.10 Lexforge support (#334)
* fix: LF Line Endings and 1.21.10 Forge * test: Add CI for unreleased mc-runtime-test versions * test: checkout repo to use local workflow to build mc-runtime-test * test: check for workflow file
1 parent 10e9192 commit 5d6bbba

File tree

3 files changed

+150
-0
lines changed

3 files changed

+150
-0
lines changed
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Build mc-runtime-test
2+
on:
3+
workflow_call:
4+
inputs:
5+
branch:
6+
description: 'The branch of mc-runtime-test to check out'
7+
default: 'main'
8+
required: false
9+
type: string
10+
dir:
11+
description: 'The directory of mc-runtime-test to build in'
12+
default: '1_21_5'
13+
required: true
14+
type: string
15+
java:
16+
description: 'The Java version to use'
17+
default: 21
18+
required: true
19+
type: number
20+
mc:
21+
description: 'The Minecraft version to build for'
22+
default: '1.21.5'
23+
required: true
24+
type: string
25+
lex:
26+
description: 'The LexForge version to build for'
27+
default: '55.0.3'
28+
required: true
29+
type: string
30+
neo:
31+
description: 'The NeoForge version to build for'
32+
default: '24-beta'
33+
required: true
34+
type: string
35+
36+
jobs:
37+
build:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
repository: headlesshq/mc-runtime-test
44+
ref: ${{ inputs.branch }}
45+
46+
- name: Get commit SHA of checked-out repo
47+
id: commit
48+
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
49+
50+
- name: Cache build
51+
id: cache
52+
uses: actions/cache@v4
53+
with:
54+
path: ${{ inputs.dir }}/build
55+
key: mcrt-${{ inputs.dir }}-${{ inputs.java }}-${{ inputs.mc }}-${{ steps.commit.outputs.sha }}
56+
57+
- if: steps.cache.outputs.cache-hit != 'true'
58+
name: Setup Java
59+
uses: actions/setup-java@v4
60+
with:
61+
distribution: temurin
62+
java-version: ${{ inputs.java }}
63+
64+
- if: steps.cache.outputs.cache-hit != 'true'
65+
name: Setup Gradle
66+
uses: gradle/actions/setup-gradle@v5
67+
with:
68+
workflow-job-context: '{}' # FIXME: avoid this cache duplication workaround
69+
70+
- if: steps.cache.outputs.cache-hit != 'true'
71+
name: Gradle build
72+
run: >
73+
./gradlew build --stacktrace
74+
-Pminecraft_version=${{ inputs.mc }}
75+
-Plexforge_version=${{ inputs.lex }}
76+
-Pneoforge_version=${{ inputs.neo }}
77+
working-directory: ${{ inputs.dir }}
78+
79+
- name: Display structure of built files
80+
run: ls -R
81+
82+
# TODO: artifact for each modlauncher
83+
- name: Upload artifacts
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: mcrt-${{ inputs.mc }}
87+
path: ${{ inputs.dir }}/build/libs/*.jar

.github/workflows/lifecycle.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,63 @@ jobs:
464464
headlessmc-command: --retries 2 --jvm -Djava.awt.headless=true
465465
download-hmc: false
466466

467+
# https://github.com/headlesshq/headlessmc/issues/333
468+
build-mc-runtime-test:
469+
strategy:
470+
matrix:
471+
version:
472+
- { branch: 80-1216, dir: 1_20_5, mc: 1.21.6, lex: 56.0.9, neo: 19-beta, java: 21 }
473+
runs-on: ubuntu-latest
474+
steps:
475+
- uses: actions/checkout@v4
476+
- name: Display structure of downloaded files
477+
run: ls -R .github/
478+
- name: Build
479+
uses: ./.github/workflows/build-runtime-test.yml
480+
with:
481+
branch: ${{ matrix.branch }}
482+
dir: ${{ matrix.dir }}
483+
mc: ${{ matrix.mc }}
484+
lex: ${{ matrix.lex }}
485+
neo: ${{ matrix.neo }}
486+
java: ${{ matrix.java }}
487+
488+
mc-runtime-test:
489+
strategy:
490+
matrix:
491+
version:
492+
- { mc: 1.21.6, type: lexforge, modloader: forge, regex: .*forge.*, java: 21 }
493+
- { mc: 1.21.6, type: neoforge, modloader: neoforge, regex: .*neoforge.*, java: 21 }
494+
- { mc: 1.21.6, type: fabric, modloader: fabric, regex: .*fabric.*, java: 21 }
495+
runs-on: ubuntu-latest
496+
needs: [build-java-8, build-mc-runtime-test]
497+
steps:
498+
- name: Install Java
499+
uses: actions/setup-java@v4
500+
with:
501+
java-version: ${{ matrix.version.java }}
502+
distribution: "temurin"
503+
- uses: actions/download-artifact@v4
504+
with:
505+
name: mcrt-${{ matrix.version.mc }}
506+
path: .
507+
508+
- uses: actions/download-artifact@v4
509+
with:
510+
name: launcher-wrapper-java8-jar
511+
path: .
512+
513+
- name: Display structure of downloaded files
514+
run: ls -R
515+
516+
- name: Copy launcher jar
517+
# rename because mc-runtime-test matches a jar with headlessmc-launcher-<version>.jar
518+
run: cp launcher-jar/headlessmc-launcher.jar headlessmc-launcher-0.0.0.jar
519+
520+
# TODO: configure HeadlessMc
521+
# TODO: put downloaded mc-runtime-test jar in mods
522+
# TODO: run
523+
467524
server-test:
468525
strategy:
469526
matrix:

headlessmc-lwjgl/src/main/java/io/github/headlesshq/headlessmc/lwjgl/redirections/LwjglRedirections.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ public static void register(RedirectionManager manager) {
332332

333333
return 0;
334334
});
335+
336+
// Forge 1.21.10
337+
//java.lang.IllegalArgumentException: mipLevels must be at least 1
338+
// at TRANSFORMER/minecraft@1.21.10/com.mojang.blaze3d.opengl.GlDevice.createTexture(GlDevice.java:119) ~[forge-1.21.10-60.0.17-client.jar:?]
339+
manager.redirect("Lorg/lwjgl/opengl/GL11C;glGenTextures()I",
340+
(obj, desc, type, args) -> 1);
335341
}
336342

337343
}

0 commit comments

Comments
 (0)