From fd7aeb5a78a55cf8f5f86847073308189db760ea Mon Sep 17 00:00:00 2001 From: Peter253545 <58088721+Peter253545@users.noreply.github.com> Date: Fri, 21 Jun 2024 02:45:33 +0100 Subject: [PATCH 1/3] feat: mc 1.21 --- build.gradle.kts | 10 +++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- libs.versions.toml | 12 ++++++------ .../dev/ashhhleyyy/playerpronouns/impl/Config.java | 2 +- .../playerpronouns/impl/PlayerPronouns.java | 4 ++-- src/main/resources/fabric.mod.json | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4154b8f..fc79971 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,10 @@ plugins { - id("fabric-loom") version "1.5.+" + id("fabric-loom") version "1.7-SNAPSHOT" id("com.modrinth.minotaur") version "2.+" `maven-publish` } -version = "2.1.0+1.20.4" +version = "2.1.0+1.21" group = "dev.ashhhleyyy" repositories { @@ -51,15 +51,15 @@ tasks.processResources { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 withSourcesJar() } tasks.withType { options.encoding = "UTF-8" - options.release.set(17) + options.release.set(21) } tasks.jar { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 1af9e09..a441313 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/libs.versions.toml b/libs.versions.toml index 463b0a4..1609a47 100644 --- a/libs.versions.toml +++ b/libs.versions.toml @@ -1,13 +1,13 @@ [versions] -minecraft = "1.20.4" -yarn = "1.20.4+build.3" +minecraft = "1.21" +yarn = "1.21+build.2" -fabric-loader = "0.15.3" -fabric-api = "0.95.3+1.20.4" +fabric-loader = "0.15.11" +fabric-api = "0.100.3+1.21" -placeholder-api = "2.3.0+1.20.3" +placeholder-api = "2.4.0-pre.2+1.21" -fabric-permissions = "0.2-SNAPSHOT" +fabric-permissions = "0.3.1" [libraries] minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" } diff --git a/src/main/java/dev/ashhhleyyy/playerpronouns/impl/Config.java b/src/main/java/dev/ashhhleyyy/playerpronouns/impl/Config.java index 4f30da9..fff6720 100644 --- a/src/main/java/dev/ashhhleyyy/playerpronouns/impl/Config.java +++ b/src/main/java/dev/ashhhleyyy/playerpronouns/impl/Config.java @@ -86,7 +86,7 @@ public class Config { String s = Files.readString(path); JsonElement ele = JsonParser.parseString(s); DataResult result = CODEC.decode(JsonOps.INSTANCE, ele).map(Pair::getFirst); - Optional> err = result.error(); + Optional> err = result.error(); err.ifPresent(e -> PlayerPronouns.LOGGER.warn("Failed to load config: {}", e.message())); return result.result().orElseGet(Config::new); } catch (IOException e) { diff --git a/src/main/java/dev/ashhhleyyy/playerpronouns/impl/PlayerPronouns.java b/src/main/java/dev/ashhhleyyy/playerpronouns/impl/PlayerPronouns.java index b648ded..88ea171 100644 --- a/src/main/java/dev/ashhhleyyy/playerpronouns/impl/PlayerPronouns.java +++ b/src/main/java/dev/ashhhleyyy/playerpronouns/impl/PlayerPronouns.java @@ -138,10 +138,10 @@ public class PlayerPronouns implements ModInitializer, PronounsApi.PronounReader PronounsCommand.register(dispatcher); }); - Placeholders.register(new Identifier(MOD_ID, "pronouns"), (ctx, argument) -> + Placeholders.register(Identifier.of(MOD_ID, "pronouns"), (ctx, argument) -> fromContext(ctx, argument, true)); - Placeholders.register(new Identifier(MOD_ID, "raw_pronouns"), (ctx, argument) -> + Placeholders.register(Identifier.of(MOD_ID, "raw_pronouns"), (ctx, argument) -> fromContext(ctx, argument, false)); PronounsApi.initReader(this); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 32fb639..ce0018e 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -22,7 +22,7 @@ "depends": { "fabricloader": "*", "fabric-api": "*", - "minecraft": ">=1.20.4", + "minecraft": ">=1.21", "placeholder-api": "*", "fabric-permissions-api-v0": "*" } From b4df3e92bc4c89cc51ff46dacb3f24dc31a87f2e Mon Sep 17 00:00:00 2001 From: Peter253545 <58088721+Peter253545@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:51:59 +0100 Subject: [PATCH 2/3] chore: bump placeholder-api Co-authored-by: Ash --- libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs.versions.toml b/libs.versions.toml index 1609a47..e6c3387 100644 --- a/libs.versions.toml +++ b/libs.versions.toml @@ -5,7 +5,7 @@ yarn = "1.21+build.2" fabric-loader = "0.15.11" fabric-api = "0.100.3+1.21" -placeholder-api = "2.4.0-pre.2+1.21" +placeholder-api = "2.4.0+1.21" fabric-permissions = "0.3.1" From e949e3d56d30a0db8378cc1e63b1cef0f7068e7c Mon Sep 17 00:00:00 2001 From: Peter253545 <58088721+Peter253545@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:58:16 +0100 Subject: [PATCH 3/3] fix: java version in gh action --- .github/workflows/build.yml | 4 ++-- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2eaf8cb..1af0979 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,10 +9,10 @@ jobs: uses: actions/checkout@v2 - name: Validate gradle wrapper uses: gradle/wrapper-validation-action@v1 - - name: Setup JDK 17 + - name: Setup JDK 21 uses: actions/setup-java@v1 with: - java-version: 17 + java-version: 21 - name: Ensure gradlew is executable run: chmod +x ./gradlew - name: Build with gradle diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 043b52a..308d353 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v1 with: - java-version: 17 + java-version: 21 - name: Grant execute permission for gradlew run: chmod +x gradlew