Merge pull request #15 from Peter253545/1.21

feat: mc 1.21
This commit is contained in:
Ashhhleyyy 2024-07-02 22:56:14 +01:00 committed by GitHub
commit d0163ba979
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 19 additions and 19 deletions

View file

@ -9,10 +9,10 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Validate gradle wrapper - name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1 uses: gradle/wrapper-validation-action@v1
- name: Setup JDK 17 - name: Setup JDK 21
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 17 java-version: 21
- name: Ensure gradlew is executable - name: Ensure gradlew is executable
run: chmod +x ./gradlew run: chmod +x ./gradlew
- name: Build with gradle - name: Build with gradle

View file

@ -23,7 +23,7 @@ jobs:
- name: Set up JDK - name: Set up JDK
uses: actions/setup-java@v1 uses: actions/setup-java@v1
with: with:
java-version: 17 java-version: 21
- name: Grant execute permission for gradlew - name: Grant execute permission for gradlew
run: chmod +x gradlew run: chmod +x gradlew

View file

@ -1,10 +1,10 @@
plugins { plugins {
id("fabric-loom") version "1.5.+" id("fabric-loom") version "1.7-SNAPSHOT"
id("com.modrinth.minotaur") version "2.+" id("com.modrinth.minotaur") version "2.+"
`maven-publish` `maven-publish`
} }
version = "2.1.0+1.20.4" version = "2.1.0+1.21"
group = "dev.ashhhleyyy" group = "dev.ashhhleyyy"
repositories { repositories {
@ -51,15 +51,15 @@ tasks.processResources {
} }
java { java {
sourceCompatibility = JavaVersion.VERSION_17 sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_21
withSourcesJar() withSourcesJar()
} }
tasks.withType<JavaCompile> { tasks.withType<JavaCompile> {
options.encoding = "UTF-8" options.encoding = "UTF-8"
options.release.set(17) options.release.set(21)
} }
tasks.jar { tasks.jar {

View file

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View file

@ -1,13 +1,13 @@
[versions] [versions]
minecraft = "1.20.4" minecraft = "1.21"
yarn = "1.20.4+build.3" yarn = "1.21+build.2"
fabric-loader = "0.15.3" fabric-loader = "0.15.11"
fabric-api = "0.95.3+1.20.4" fabric-api = "0.100.3+1.21"
placeholder-api = "2.3.0+1.20.3" placeholder-api = "2.4.0+1.21"
fabric-permissions = "0.2-SNAPSHOT" fabric-permissions = "0.3.1"
[libraries] [libraries]
minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" } minecraft = { module = "com.mojang:minecraft", version.ref = "minecraft" }

View file

@ -86,7 +86,7 @@ public class Config {
String s = Files.readString(path); String s = Files.readString(path);
JsonElement ele = JsonParser.parseString(s); JsonElement ele = JsonParser.parseString(s);
DataResult<Config> result = CODEC.decode(JsonOps.INSTANCE, ele).map(Pair::getFirst); DataResult<Config> result = CODEC.decode(JsonOps.INSTANCE, ele).map(Pair::getFirst);
Optional<DataResult.PartialResult<Config>> err = result.error(); Optional<DataResult.Error<Config>> err = result.error();
err.ifPresent(e -> PlayerPronouns.LOGGER.warn("Failed to load config: {}", e.message())); err.ifPresent(e -> PlayerPronouns.LOGGER.warn("Failed to load config: {}", e.message()));
return result.result().orElseGet(Config::new); return result.result().orElseGet(Config::new);
} catch (IOException e) { } catch (IOException e) {

View file

@ -138,10 +138,10 @@ public class PlayerPronouns implements ModInitializer, PronounsApi.PronounReader
PronounsCommand.register(dispatcher); 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)); 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)); fromContext(ctx, argument, false));
PronounsApi.initReader(this); PronounsApi.initReader(this);

View file

@ -22,7 +22,7 @@
"depends": { "depends": {
"fabricloader": "*", "fabricloader": "*",
"fabric-api": "*", "fabric-api": "*",
"minecraft": ">=1.20.4", "minecraft": ">=1.21",
"placeholder-api": "*", "placeholder-api": "*",
"fabric-permissions-api-v0": "*" "fabric-permissions-api-v0": "*"
} }