From 851d46586ddb49304bc6a105c3339f8fb1011df0 Mon Sep 17 00:00:00 2001 From: paizi Date: Sat, 31 Aug 2024 10:53:56 +0800 Subject: [PATCH] Upgrade to Minecraft 1.21 --- build.gradle | 8 ++++---- gradle.properties | 8 ++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew.bat | 2 +- .../takaranoao/mods/autoreconnector/AutoConnectorMod.java | 2 +- src/client/resources/autoreconnector.mixins.json | 2 +- src/client/resources/fabric.mod.json | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 9751656..953b038 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.5-SNAPSHOT' + id 'fabric-loom' version '1.7-SNAPSHOT' id 'maven-publish' } @@ -54,7 +54,7 @@ processResources { } tasks.withType(JavaCompile).configureEach { - it.options.release = 17 + it.options.release = 21 } java { @@ -63,8 +63,8 @@ java { // If you remove this line, sources will not be generated. withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } jar { diff --git a/gradle.properties b/gradle.properties index 5930b86..a550745 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,12 +2,12 @@ org.gradle.jvmargs=-Xmx8G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.20.4 -yarn_mappings=1.20.4+build.3 -loader_version=0.15.7 +minecraft_version=1.21 +yarn_mappings=1.21+build.9 +loader_version=0.16.3 #Fabric api -fabric_version=0.96.3+1.20.4 +fabric_version=0.102.0+1.21 # Mod Properties mod_version=1.1.1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a595206..e1adfb4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ 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.10-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 9618d8d..2c47ca8 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -30,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" "-Dfile.encoding=GBK" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/src/client/java/com/takaranoao/mods/autoreconnector/AutoConnectorMod.java b/src/client/java/com/takaranoao/mods/autoreconnector/AutoConnectorMod.java index 8c4f69a..b4e04db 100644 --- a/src/client/java/com/takaranoao/mods/autoreconnector/AutoConnectorMod.java +++ b/src/client/java/com/takaranoao/mods/autoreconnector/AutoConnectorMod.java @@ -28,7 +28,7 @@ public static void clientTick() { if (disconnectTick == MAX_TICK && lastestServerEntry != null) { System.out.println(disconnectTick); mc.disconnect(); - ConnectScreen.connect(new TitleScreen(), mc, ServerAddress.parse(lastestServerEntry.address), lastestServerEntry, false); + ConnectScreen.connect(new TitleScreen(), mc, ServerAddress.parse(lastestServerEntry.address), lastestServerEntry, false, null); disconnectTick = 0; } } else { diff --git a/src/client/resources/autoreconnector.mixins.json b/src/client/resources/autoreconnector.mixins.json index b1dbd80..5923606 100644 --- a/src/client/resources/autoreconnector.mixins.json +++ b/src/client/resources/autoreconnector.mixins.json @@ -2,7 +2,7 @@ "required": true, "package": "com.takaranoao.mods.autoreconnector.mixins", "minVersion": "0.8", - "compatibilityLevel": "JAVA_17", + "compatibilityLevel": "JAVA_21", "mixins": [ ], "client": [ diff --git a/src/client/resources/fabric.mod.json b/src/client/resources/fabric.mod.json index ad49a75..c35a133 100644 --- a/src/client/resources/fabric.mod.json +++ b/src/client/resources/fabric.mod.json @@ -23,10 +23,10 @@ "autoreconnector.mixins.json" ], "depends": { - "fabricloader": ">=0.11.3", + "fabricloader": ">=0.16.0", "fabric": "*", - "minecraft": ">=1.20.1", - "java": ">=17" + "minecraft": ">=1.21", + "java": ">=21" }, "suggests": { "flamingo": "*"