From d6d7cddd22e703ef12d1d7dee965bd65628f98be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Pe=CC=81rez=20Rodri=CC=81guez?= Date: Wed, 15 Dec 2021 21:05:08 +0100 Subject: [PATCH] Update to Minecraft 1.18.1 I had to update gradle, modmenu, and pircbotx (it used a field that had a name change in Java 1.17, and crashed when I tried to start the bot with this new Java version). --- build.gradle | 30 +++++++------------ gradle.properties | 13 ++++---- gradle/wrapper/gradle-wrapper.properties | 4 +-- .../to/pabli/twitchchat/config/ModConfig.java | 6 ++-- 4 files changed, 21 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index 69233e1..5e7f44b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,10 @@ plugins { - id 'fabric-loom' version '0.8-SNAPSHOT' + id 'fabric-loom' version '0.10-SNAPSHOT' id 'maven-publish' } -sourceCompatibility = JavaVersion.VERSION_16 -targetCompatibility = JavaVersion.VERSION_16 +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 archivesBaseName = project.archives_base_name version = project.mod_version @@ -14,10 +14,8 @@ repositories { maven { url = 'https://minecraft.curseforge.com/api/maven' } maven { url = 'https://maven.shedaniel.me/' } maven { url = 'https://maven.terraformersmc.com/'} - maven { - name = 'CottonMC' - url = 'https://server.bbkr.space/artifactory/libs-release' - } + maven { url 'https://jitpack.io' } + } dependencies { @@ -44,8 +42,8 @@ dependencies { modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}" // irc - implementation 'org.pircbotx:pircbotx:2.1' - include 'org.pircbotx:pircbotx:2.1' + implementation 'com.github.pircbotx:pircbotx:12f5639c5d' + include 'com.github.pircbotx:pircbotx:12f5639c5d' // pircbotx needs this 🤷‍ include group: 'org.slf4j', name: 'slf4j-api', version: '1.7.13' @@ -71,8 +69,8 @@ tasks.withType(JavaCompile).configureEach { // If Javadoc is generated, this must be specified in that task too. it.options.encoding = "UTF-8" - // Minecraft 1.17 (21w19a) upwards uses Java 16. - it.options.release = 16 + // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. + it.options.release = 17 } java { @@ -92,13 +90,7 @@ jar { publishing { publications { mavenJava(MavenPublication) { - // add all the jars that should be included when publishing to maven - artifact(remapJar) { - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } + from components.java } } @@ -109,4 +101,4 @@ publishing { // The repositories here will be used for publishing your artifact, not for // retrieving dependencies. } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 4974980..d4e47d1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,18 +3,17 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=1.17 - yarn_mappings=1.17+build.7 - loader_version=0.11.3 + minecraft_version=1.18.1 + yarn_mappings=1.18.1+build.5 + loader_version=0.12.12 # Mod Properties - mod_version=0.11.2b + mod_version=0.12.0b maven_group=to.pabli archives_base_name=twitchchat # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api - fabric_version=0.35.0+1.17 + fabric_version=0.44.0+1.18 cloth_config_version=5.0.34 - mod_menu_version=2.0.2 - cotton_client_commands_version=1.0.1+1.16-rc1 + mod_menu_version=3.0.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 573fe49..ffed3a2 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-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists \ No newline at end of file +zipStorePath=wrapper/dists diff --git a/src/main/java/to/pabli/twitchchat/config/ModConfig.java b/src/main/java/to/pabli/twitchchat/config/ModConfig.java index 320bce5..b497960 100644 --- a/src/main/java/to/pabli/twitchchat/config/ModConfig.java +++ b/src/main/java/to/pabli/twitchchat/config/ModConfig.java @@ -43,8 +43,7 @@ public class ModConfig { public ModConfig() { this.configFile = FabricLoader .getInstance() - .getConfigDirectory() - .toPath() + .getConfigDir() .resolve("twitchchat.json") .toFile(); this.channel = DEFAULT_CHANNEL; @@ -70,8 +69,7 @@ public void load() { try { String jsonStr = new String(Files.readAllBytes(this.configFile.toPath())); if (!jsonStr. equals("")) { - JsonParser jsonParser = new JsonParser(); - JsonObject jsonObject = (JsonObject) jsonParser.parse(jsonStr); + JsonObject jsonObject = (JsonObject) JsonParser.parseString(jsonStr); this.channel = jsonObject.has("channel") ? jsonObject.getAsJsonPrimitive("channel").getAsString() : DEFAULT_CHANNEL;