Skip to content

Commit 0af02a4

Browse files
committed
Merge branch 'v4-mc-1.21.11' into 'master'
2 parents a33f136 + 7acbccc commit 0af02a4

25 files changed

Lines changed: 516 additions & 580 deletions

‎.github/workflows/build.yml‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build Enhanced Keybinds
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: build-${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 30
21+
22+
steps:
23+
- name: Check out repository
24+
uses: actions/checkout@v7
25+
26+
- name: Set up Java 21
27+
uses: actions/setup-java@v5
28+
with:
29+
distribution: temurin
30+
java-version: "21"
31+
32+
- name: Set up Gradle
33+
uses: gradle/actions/setup-gradle@v6
34+
with:
35+
gradle-version: "9.6.1"
36+
37+
- name: Build Enhanced Keybinds
38+
run: gradle --no-daemon --no-watch-fs build
39+
40+
- name: Upload compiled JAR
41+
uses: actions/upload-artifact@v7
42+
with:
43+
name: enhancedkeybinds-${{ github.sha }}
44+
path: |
45+
build/libs/*.jar
46+
!build/libs/*-sources.jar
47+
if-no-files-found: error
48+
retention-days: 14

‎.github/workflows/publish.yml‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Publish Enhanced Keybinds
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
dry_run:
10+
description: Validate uploads without publishing
11+
required: true
12+
type: boolean
13+
default: true
14+
15+
permissions:
16+
contents: read
17+
18+
concurrency:
19+
group: publish-${{ github.ref }}
20+
cancel-in-progress: false
21+
22+
jobs:
23+
publish:
24+
runs-on: ubuntu-latest
25+
timeout-minutes: 45
26+
environment: publishing
27+
env:
28+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
29+
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
30+
PUBLISH_DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run || false }}
31+
32+
steps:
33+
- name: Check out repository
34+
uses: actions/checkout@v7
35+
36+
- name: Verify release tag matches mod version
37+
if: github.event_name == 'push'
38+
shell: bash
39+
run: |
40+
mod_version="$(sed -n 's/^version=//p' gradle.properties)"
41+
if [[ "$GITHUB_REF_NAME" != "v$mod_version" ]]; then
42+
echo "Tag $GITHUB_REF_NAME must match version $mod_version (expected v$mod_version)."
43+
exit 1
44+
fi
45+
46+
- name: Set up Java 21
47+
uses: actions/setup-java@v5
48+
with:
49+
distribution: temurin
50+
java-version: "21"
51+
52+
- name: Set up Gradle
53+
uses: gradle/actions/setup-gradle@v6
54+
with:
55+
gradle-version: "9.6.1"
56+
57+
- name: Build Enhanced Keybinds
58+
run: gradle --no-daemon --no-watch-fs build
59+
60+
- name: Upload compiled JAR
61+
uses: actions/upload-artifact@v7
62+
with:
63+
name: enhancedkeybinds-${{ github.run_id }}
64+
path: |
65+
build/libs/*.jar
66+
!build/libs/*-sources.jar
67+
if-no-files-found: error
68+
retention-days: 30
69+
70+
- name: Publish to Modrinth and CurseForge
71+
run: gradle --no-daemon --no-watch-fs publishMods

‎CHANGELOG.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Enhanced Keybinds v4
2+
3+
- Updated README.md, added CHANGELOG.md, and bumped versions
4+
- Updated the mod icon and contributor credits in metadata
5+
- Added the Mod Publish Gradle plugin for auto-publishing
6+
- Added GitHub Actions workflows for building and publishing releases
7+
- Added a native keybind search bar carried over from More Search Bars
8+
- Added searching by keybind name, category, and assigned key
9+
- Added Ctrl+F to focus search and Escape to unfocus it
10+
- Added config load/save error logging
11+
- Removed duplicated mouse hit-testing and startup logs
12+
- Combined search with Unbound and Conflicts filters
13+
- Removed obsolete More Search Bars compatibility code
14+
- Removed unnecessary AMECS reflection
15+
- Optimized search and conflict-filter performance
16+
- Optimized individual skin-layer keybind handling

‎README.md‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# CoolAid's Enhanced Keybinds
2-
![](https://img.shields.io/badge/Loaders-Fabric/Quilt-blue?style=for-the-badge)
3-
![](https://img.shields.io/badge/Versions-1.21.11_|_26.1.x_|_26.2.x-blue?style=for-the-badge)
2+
![](https://img.shields.io/badge/Loaders-Fabric-blue?style=for-the-badge)
3+
![](https://img.shields.io/badge/Versions-1.21.11_|_26.1_|_26.2-blue?style=for-the-badge)
44
![](https://img.shields.io/badge/Environments-Client-blue?style=for-the-badge)
55

66
### Allows you to assign modifier keys to a keybind, and adds many new keybinds from various vanilla options!
77
- **Modifier Keys (Ctrl, Alt, Shift, Win) which can be combined with other keys for more keybind combinations, thanks to [Siphalor's Amecs](https://github.com/Siphalor/amecs/tree/cross-version/amecs-key-modifiers) key modifier implementation**
88
- **Adds new keybinds for vanilla settings from the accessibility, skin customization, and controls menus!**
9-
- **Keybinds screen adds additional buttons to filter *Unbound Keys* and *Key Conflicts*, and includes a confirmation button when attempting to *Reset All Keys***
9+
- **Keybinds screen adds a search bar, buttons to filter *Unbound Keys* and *Key Conflicts*, and a confirmation button when attempting to *Reset All Keys***
1010
- **Functions completely client-side, with Mod Menu and YACL integration for configuration**
1111
- **All keybinds `unbound` by default, and this mod's new keybinds can be enabled or disabled entirely from the config (restart required)**
1212

@@ -33,6 +33,3 @@ Probably not, but maybe. If it's requested then I'm more likely to get around to
3333

3434
### NeoForge support?
3535
Not anytime soon.
36-
37-
## Looking for a server host?
38-
![server hosting partner](https://cdn.modrinth.com/data/cached_images/8e85210a65b7c17998987c57b7571ba2fbd19bfb.png)

‎build.gradle‎

Lines changed: 62 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,28 @@
11
plugins {
2-
id 'net.fabricmc.fabric-loom' version '1.15-SNAPSHOT'
2+
id 'fabric-loom' version '1.15-SNAPSHOT'
3+
id 'me.modmuss50.mod-publish-plugin' version '2.1.1'
34
id 'maven-publish'
45
}
56

6-
version = project.version
77
group = project.maven_group
88

9+
def modVersion = project.version
10+
def minecraftVersion = project.minecraft_version
11+
def loaderVersion = project.loader_version
12+
def archivesBaseName = project.archives_base_name
13+
def releaseVersion = modVersion.toString().split('\\+', 2)[0]
14+
915
base {
10-
archivesName = project.archives_base_name
16+
archivesName = archivesBaseName
1117
}
1218

13-
14-
1519
repositories {
16-
// Add repositories to retrieve artifacts from in here.
17-
// You should only use this when depending on other mods because
18-
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
19-
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
20-
// for more information about repositories.
21-
2220
maven { url = "https://maven.terraformersmc.com/releases" }
2321
maven { url = "https://maven.isxander.dev/releases" }
2422

2523
maven {
26-
url "https://maven.siphalor.de/"
27-
name "Siphalor's Maven"
28-
}
29-
}
30-
31-
loom {
32-
runs {
33-
client {
34-
vmArg "--enable-native-access=ALL-UNNAMED"
35-
vmArg "--sun-misc-unsafe-memory-access=allow"
36-
property "joml.nounsafe", "true"
37-
}
24+
url = "https://maven.siphalor.de/"
25+
name = "Siphalor's Maven"
3826
}
3927
}
4028

@@ -45,75 +33,88 @@ tasks.withType(JavaExec).configureEach {
4533
}
4634

4735
dependencies {
48-
// To change the versions see the gradle.properties file
4936
minecraft "com.mojang:minecraft:${project.minecraft_version}"
37+
mappings loom.officialMojangMappings()
5038

51-
implementation "net.fabricmc:fabric-loader:${project.loader_version}"
52-
implementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
53-
implementation "dev.isxander:yet-another-config-lib:${project.yacl_version}"
54-
implementation "com.terraformersmc:modmenu:${project.modmenu_version}"
55-
implementation "de.siphalor.amecs.amecs-key-modifiers:${project.amecs_version}"
56-
39+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
40+
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
41+
modImplementation "dev.isxander:yet-another-config-lib:${project.yacl_version}"
42+
modImplementation "de.siphalor.amecs.amecs-key-modifiers:${project.amecs_version}"
43+
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
5744

58-
include("de.siphalor.amecs.amecs-key-modifiers:${project.amecs_version}")
45+
include "de.siphalor.amecs.amecs-key-modifiers:${project.amecs_version}"
5946
}
6047

6148
processResources {
62-
inputs.property "version", project.version
63-
inputs.property "minecraft_version", project.minecraft_version
64-
inputs.property "loader_version", project.loader_version
65-
filteringCharset "UTF-8"
49+
inputs.property "version", modVersion
50+
inputs.property "minecraft_version", minecraftVersion
51+
inputs.property "loader_version", loaderVersion
52+
filteringCharset = "UTF-8"
6653

6754
filesMatching("fabric.mod.json") {
68-
expand "version": project.version,
69-
"minecraft_version": project.minecraft_version,
70-
"loader_version": project.loader_version
55+
expand "version": modVersion,
56+
"minecraft_version": minecraftVersion,
57+
"loader_version": loaderVersion
7158
}
7259
}
7360

74-
def targetJavaVersion = 25
61+
def targetJavaVersion = 21
7562
tasks.withType(JavaCompile).configureEach {
76-
// ensure that the encoding is set to UTF-8, no matter what the system default is
77-
// this fixes some edge cases with special characters not displaying correctly
78-
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
79-
// If Javadoc is generated, this must be specified in that task too.
8063
it.options.encoding = "UTF-8"
81-
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible()) {
82-
it.options.release.set(targetJavaVersion)
83-
}
64+
it.options.release.set(targetJavaVersion)
8465
}
8566

8667
java {
8768
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
8869
if (JavaVersion.current() < javaVersion) {
8970
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
9071
}
91-
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
92-
// if it is present.
93-
// If you remove this line, sources will not be generated.
9472
withSourcesJar()
9573
}
9674

9775
jar {
98-
from("LICENSE") {
99-
rename { "${it}_${project.archives_base_name}"}
76+
from("LICENSE.txt") {
77+
rename { "LICENSE_${archivesBaseName}" }
78+
}
79+
from("CHANGELOG.md")
80+
}
81+
82+
publishMods {
83+
file = remapJar.archiveFile
84+
changelog = providers.fileContents(layout.projectDirectory.file("CHANGELOG.md")).asText
85+
type = STABLE
86+
displayName = "Enhanced Keybinds v${releaseVersion} for ${minecraftVersion}"
87+
modLoaders.add("fabric")
88+
dryRun = providers.environmentVariable("PUBLISH_DRY_RUN")
89+
.map { it.toBoolean() }
90+
.orElse(false)
91+
92+
modrinth {
93+
projectId = "enhanced-keybinds"
94+
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
95+
minecraftVersions.add(minecraftVersion)
96+
environment = CLIENT_ONLY
97+
requires("fabric-api", "yacl")
98+
embeds("amecs")
99+
}
100+
101+
curseforge {
102+
projectId = "1207805"
103+
projectSlug = "enhancedkeybinds"
104+
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
105+
minecraftVersions.add(minecraftVersion)
106+
client = true
107+
requires("fabric-api", "yacl")
108+
embeds("amecs")
100109
}
101110
}
102111

103-
// configure the maven publication
104112
publishing {
105113
publications {
106114
create("mavenJava", MavenPublication) {
107-
artifactId = project.archives_base_name
115+
artifactId = archivesBaseName
108116
from components.java
109117
}
110118
}
111119

112-
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing.
113-
repositories {
114-
// Add repositories to publish to here.
115-
// Notice: This block does NOT have the same function as the block in the top level.
116-
// The repositories here will be used for publishing your artifact, not for
117-
// retrieving dependencies.
118-
}
119-
}
120+
}

‎gradle.properties‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Done to increase the memory available to Gradle.
22
org.gradle.jvmargs=-Xmx1G
33
# Fabric Properties
4-
minecraft_version=26.2
5-
loader_version=0.18.4
4+
minecraft_version=1.21.11
5+
loader_version=0.18.2
66
# Mod Properties
7-
version=3.2.0+26.2.x
7+
version=4.0.0+1.21.11
88
maven_group=me.coolaid
99
archives_base_name=enhancedkeybinds
1010
# Dependencies
11-
fabric_version=0.152.2+26.2
12-
modmenu_version=20.0.0-beta.2
13-
yacl_version=3.9.4+26.2-fabric
14-
amecs_version=amecs-key-modifiers-mc26.2.0:1.0.2
11+
fabric_version=0.141.5+1.21.11
12+
modmenu_version=17.0.0
13+
yacl_version=3.8.2+1.21.11-fabric
14+
amecs_version=amecs-key-modifiers-mc1.21.9:1.0.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
1+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip

‎src/main/java/me/coolaid/enhancedkeybinds/EnhancedKeybinds.java‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
public class EnhancedKeybinds implements ClientModInitializer {
1313

14-
public static final String MOD_ID = "Enhanced Keybinds";
14+
public static final String MOD_ID = "enhancedkeybinds";
1515
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
1616

1717
@Override
@@ -22,8 +22,6 @@ public void onInitializeClient() {
2222
IndividualSkinLayerTogglesBinds.init();
2323
ControllingAmecsCompat.init();
2424

25-
LOGGER.info("The Keybinds are Enhancing... Check out my Hardcore World on Twitch");
26-
LOGGER.info("Thank you Siphalor for the Amecs key modifiers implementation!");
27-
LOGGER.info("And shout out to my friends for the mod assets! :D");
25+
LOGGER.info("Enhanced Keybinds initialized");
2826
}
2927
}

0 commit comments

Comments
 (0)