Skip to content

Commit fd4fb03

Browse files
committed
Update to mc1.21.9
1 parent d77b797 commit fd4fb03

File tree

14 files changed

+300
-50
lines changed

14 files changed

+300
-50
lines changed

.github/workflows/check-build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Builds the project on Linux and Windows as a partial defense against bad commits
1+
# Builds the project on Linux and Windows, as a first line of defense against bad commits.
22
name: Check Build
33

44
on:
@@ -18,8 +18,13 @@ jobs:
1818
build:
1919
strategy:
2020
matrix:
21-
java: [21]
22-
os: [ubuntu-latest, windows-latest]
21+
java: [
22+
21
23+
]
24+
os: [
25+
ubuntu-latest,
26+
windows-latest
27+
]
2328
runs-on: ${{ matrix.os }}
2429
steps:
2530
- name: Checkout repository
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# A CurseForge-only version of the normal release workflow.
2+
name: Release-Platform-CurseForge
3+
4+
on:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
strategy:
13+
matrix:
14+
java: [
15+
21
16+
]
17+
os: [
18+
ubuntu-latest
19+
]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- name: Validate Gradle wrapper
27+
uses: gradle/wrapper-validation-action@v3
28+
- name: Setup JDK ${{ matrix.java }}
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: zulu
32+
java-version: ${{ matrix.java }}
33+
- name: Make Gradle wrapper executable
34+
if: ${{ runner.os != 'Windows' }}
35+
run: chmod +x ./gradlew
36+
- name: Build
37+
run: ./gradlew build publishCurseforge --stacktrace
38+
env:
39+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
40+
- name: Capture build artifacts
41+
if: ${{ runner.os == 'Linux' && matrix.java == '21' }}
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: artifacts
45+
path: |
46+
**/build/libs/
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# A GitHub-only version of the normal release workflow.
2+
name: Release-Platform-GitHub
3+
4+
on:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
strategy:
13+
matrix:
14+
java: [
15+
21
16+
]
17+
os: [
18+
ubuntu-latest
19+
]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- name: Validate Gradle wrapper
27+
uses: gradle/wrapper-validation-action@v3
28+
- name: Setup JDK ${{ matrix.java }}
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: zulu
32+
java-version: ${{ matrix.java }}
33+
- name: Make Gradle wrapper executable
34+
if: ${{ runner.os != 'Windows' }}
35+
run: chmod +x ./gradlew
36+
- name: Build
37+
run: ./gradlew build publishGithub --stacktrace
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
- name: Capture build artifacts
41+
if: ${{ runner.os == 'Linux' && matrix.java == '21' }}
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: artifacts
45+
path: |
46+
**/build/libs/
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# A Modrinth-only version of the normal release workflow.
2+
name: Release-Platform-Modrinth
3+
4+
on:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
strategy:
13+
matrix:
14+
java: [
15+
21
16+
]
17+
os: [
18+
ubuntu-latest
19+
]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- name: Validate Gradle wrapper
27+
uses: gradle/wrapper-validation-action@v3
28+
- name: Setup JDK ${{ matrix.java }}
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: zulu
32+
java-version: ${{ matrix.java }}
33+
- name: Make Gradle wrapper executable
34+
if: ${{ runner.os != 'Windows' }}
35+
run: chmod +x ./gradlew
36+
- name: Build
37+
run: ./gradlew build publishModrinth --stacktrace
38+
env:
39+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
40+
- name: Capture build artifacts
41+
if: ${{ runner.os == 'Linux' && matrix.java == '21' }}
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: artifacts
45+
path: |
46+
**/build/libs/
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# A Fabric-only version of the normal release workflow.
2+
name: Release-Subproject-Fabric
3+
4+
on:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
strategy:
13+
matrix:
14+
java: [
15+
21
16+
]
17+
os: [
18+
ubuntu-latest
19+
]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- name: Validate Gradle wrapper
27+
uses: gradle/wrapper-validation-action@v3
28+
- name: Setup JDK ${{ matrix.java }}
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: zulu
32+
java-version: ${{ matrix.java }}
33+
- name: Make Gradle wrapper executable
34+
if: ${{ runner.os != 'Windows' }}
35+
run: chmod +x ./gradlew
36+
- name: Build
37+
run: ./gradlew build fabric:publishMods --stacktrace
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
41+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
42+
- name: Capture build artifacts
43+
if: ${{ runner.os == 'Linux' && matrix.java == '21' }}
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: artifacts
47+
path: |
48+
**/build/libs/
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# A NeoForge-only version of the normal release workflow.
2+
name: Release-Subproject-NeoForge
3+
4+
on:
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
strategy:
13+
matrix:
14+
java: [
15+
21
16+
]
17+
os: [
18+
ubuntu-latest
19+
]
20+
runs-on: ${{ matrix.os }}
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- name: Validate Gradle wrapper
27+
uses: gradle/wrapper-validation-action@v3
28+
- name: Setup JDK ${{ matrix.java }}
29+
uses: actions/setup-java@v4
30+
with:
31+
distribution: zulu
32+
java-version: ${{ matrix.java }}
33+
- name: Make Gradle wrapper executable
34+
if: ${{ runner.os != 'Windows' }}
35+
run: chmod +x ./gradlew
36+
- name: Build
37+
run: ./gradlew build neoforge:publishMods --stacktrace
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
41+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
42+
- name: Capture build artifacts
43+
if: ${{ runner.os == 'Linux' && matrix.java == '21' }}
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: artifacts
47+
path: |
48+
**/build/libs/

.github/workflows/release.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
# Builds the project and publishes the artifacts to GitHub, Modrinth and CurseForge
2-
# Modrinth publishing requires a Modrinth PAT MODRINTH_TOKEN
3-
# Will skip without error if not present
4-
# CurseForge publishing requires a CurseForge API token CURSEFORGE_TOKEN
5-
# Will skip without error if not present
1+
# Builds the project and publishes the artifacts to GitHub, Modrinth and CurseForge.
2+
# Modrinth publishing requires a Modrinth PAT `MODRINTH_TOKEN`
3+
# Will skip without error if not present.
4+
# CurseForge publishing requires a CurseForge API token `CURSEFORGE_TOKEN`
5+
# Will skip without error if not present.
6+
# Preference using the root gradle.properties file to configure releases.
67
name: Release
78

89
on:
@@ -15,8 +16,12 @@ jobs:
1516
release:
1617
strategy:
1718
matrix:
18-
java: [21]
19-
os: [ubuntu-latest]
19+
java: [
20+
21
21+
]
22+
os: [
23+
ubuntu-latest
24+
]
2025
runs-on: ${{ matrix.os }}
2126
steps:
2227
- name: Checkout repository
@@ -34,11 +39,7 @@ jobs:
3439
if: ${{ runner.os != 'Windows' }}
3540
run: chmod +x ./gradlew
3641
- name: Build
37-
# run: ./gradlew build neoforge:publishGithub fabric:publishGithub --stacktrace
38-
# run: ./gradlew build neoforge:publishGithub neoforge:publishModrinth fabric:publishGithub fabric:publishModrinth --stacktrace
39-
# run: ./gradlew build neoforge:publishGithub neoforge:publishModrinth neoforge:publishCurseforge fabric:publishGithub fabric:publishModrinth fabric:publishCurseforge --stacktrace
40-
# run: ./gradlew build fabric:publishGithub fabric:publishModrinth fabric:publishCurseforge --stacktrace
41-
run: ./gradlew build neoforge:publishGithub neoforge:publishModrinth neoforge:publishCurseforge --stacktrace
42+
run: ./gradlew build neoforge:publishModrinth neoforge:publishCurseforge neoforge:publishGithub fabric:publishModrinth fabric:publishCurseforge fabric:publishGithub --stacktrace
4243
env:
4344
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4445
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
@@ -49,4 +50,4 @@ jobs:
4950
with:
5051
name: artifacts
5152
path: |
52-
**/build/libs/
53+
**/build/libs/

.github/workflows/sync-labels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Synchronizes the repo's labels with a centralized labels.yml
2-
# Requires GITHUB_TOKEN to have write permissions; if not, replace it with a custom token
1+
# Synchronizes the repo's labels with a centralized `labels.yml` file.
2+
# Requires `GITHUB_TOKEN` to have write permissions; if not, replace it with a custom token.
33
name: Sync Labels
44

55
on:

common/src/main/java/dev/terminalmc/modlistmemory/ModListMemory.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import dev.terminalmc.modlistmemory.config.Config;
2020
import dev.terminalmc.modlistmemory.util.ModLogger;
2121
import net.minecraft.client.Minecraft;
22-
import net.minecraft.client.gui.screens.Screen;
22+
import net.minecraft.client.input.MouseButtonEvent;
2323
import net.minecraft.network.chat.Component;
2424
import net.minecraft.util.FormattedCharSequence;
2525

@@ -71,8 +71,8 @@ public static void onModOpened(String modId) {
7171
}
7272
}
7373

74-
public static boolean onModClicked(String modId) {
75-
if (ModListMemory.hasKeyDown(options().pinKey)) {
74+
public static boolean onModClicked(MouseButtonEvent click, String modId) {
75+
if (ModListMemory.hasKeyDown(click, options().pinKey)) {
7676
// Pin, or move to the top of the pin list
7777
options().recentMods.remove(modId);
7878
options().pinnedMods.remove(modId);
@@ -85,7 +85,7 @@ public static boolean onModClicked(String modId) {
8585
}
8686
return true;
8787
}
88-
else if (ModListMemory.hasKeyDown(options().unpinKey)
88+
else if (ModListMemory.hasKeyDown(click, options().unpinKey)
8989
&& options().pinnedMods.contains(modId)) {
9090
// Unpin
9191
options().pinnedMods.remove(modId);
@@ -97,11 +97,11 @@ && options().pinnedMods.contains(modId)) {
9797
return false;
9898
}
9999

100-
public static boolean hasKeyDown(Config.Key key) {
100+
public static boolean hasKeyDown(MouseButtonEvent click, Config.Key key) {
101101
return switch(key) {
102-
case CONTROL -> Screen.hasControlDown();
103-
case ALT -> Screen.hasAltDown();
104-
case SHIFT -> Screen.hasShiftDown();
102+
case CONTROL -> click.hasControlDown();
103+
case ALT -> click.hasAltDown();
104+
case SHIFT -> click.hasShiftDown();
105105
case NONE -> false;
106106
};
107107
}

fabric/src/main/java/dev/terminalmc/modlistmemory/mixin/MixinModListEntryRemap.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.terraformersmc.modmenu.gui.widget.entries.ModListEntry;
2121
import com.terraformersmc.modmenu.util.mod.Mod;
2222
import dev.terminalmc.modlistmemory.ModListMemory;
23+
import net.minecraft.client.input.MouseButtonEvent;
2324
import org.spongepowered.asm.mixin.Final;
2425
import org.spongepowered.asm.mixin.Mixin;
2526
import org.spongepowered.asm.mixin.Shadow;
@@ -41,8 +42,12 @@ public class MixinModListEntryRemap {
4142
method = "mouseClicked",
4243
at = @At("HEAD")
4344
)
44-
private void onMouseClicked(double mouseX, double mouseY, int delta, CallbackInfoReturnable<Boolean> cir) {
45-
if (ModListMemory.onModClicked(mod.getId())) {
45+
private void onMouseClicked(
46+
MouseButtonEvent click,
47+
boolean doubleClick,
48+
CallbackInfoReturnable<Boolean> cir
49+
) {
50+
if (ModListMemory.onModClicked(click, mod.getId())) {
4651
list.reloadFilters();
4752
}
4853
}

0 commit comments

Comments
 (0)