From 38a02f0f06da007d1487de5243636a4450dbf49c Mon Sep 17 00:00:00 2001 From: Emma Waffle Date: Wed, 29 Sep 2021 18:54:33 -0400 Subject: [PATCH] Update to 1.17.1 This is mostly buildscript, because the mod itself works fine on 1.17.1 and 1.18 snapshots with no changes. HOWEVER, this moves to the new Mod Menu and AutoConfig packages, and no longer bundles Cloth Config (it's a massive dependency and requires updates like this when they shouldn't be needed). --- build.gradle | 32 +++++++------------ gradle.properties | 19 ++++++----- .../timechanger/TimeChangerClient.java | 4 +-- .../config/ModMenuIntegration.java | 6 ++-- .../timechanger/config/TimeChangerConfig.java | 6 ++-- 5 files changed, 28 insertions(+), 39 deletions(-) diff --git a/build.gradle b/build.gradle index c0e4cd7..6e58347 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.5-SNAPSHOT' + id 'fabric-loom' version '0.9.+' id 'maven-publish' } @@ -14,41 +14,32 @@ minecraft { } repositories { - maven { url "https://jitpack.io" } + maven { url "https://maven.terraformersmc.com" } + maven { url "https://maven.shedaniel.me" } } dependencies { //to change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - modCompile "net.fabricmc:fabric-loader:${project.loader_version}" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - - modImplementation ("me.sargunvohra.mcmods:autoconfig1u:${project.auto_config_version}"){ + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + + modImplementation ("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}"){ exclude module: "fabric-api" } - modImplementation ("me.shedaniel.cloth:config-2:${project.cloth_config_version}"){ + modImplementation ("com.terraformersmc:modmenu:${project.mod_menu_version}"){ exclude module: "fabric-api" } - modImplementation ("io.github.prospector:modmenu:${project.mod_menu_version}"){ - exclude module: "fabric-api" - } - include "me.sargunvohra.mcmods:autoconfig1u:${project.auto_config_version}" - include "me.shedaniel.cloth:config-2:${project.cloth_config_version}" } processResources { inputs.property "version", project.version - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" + filesMatching("fabric.mod.json") { expand "version": project.version } - - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } } // ensure that the encoding is set to UTF-8, no matter what the system default is @@ -61,9 +52,8 @@ tasks.withType(JavaCompile) { // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // if it is present. // If you remove this task, sources will not be generated. -task sourcesJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource +java { + withSourcesJar() } jar { diff --git a/gradle.properties b/gradle.properties index 25a84bc..e3d3086 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,20 +2,19 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties - # check these on https://fabricmc.net/use - minecraft_version=1.16.4 - yarn_mappings=1.16.4+build.7 - loader_version=0.10.8 + # check these on https://fabricmc.net/versions.html + minecraft_version=1.17.1 + yarn_mappings=1.17.1+build.61 + loader_version=0.11.7 # Mod Properties - mod_version = 1.0.0 + mod_version = 1.0.1 maven_group = eu.midnightdust archives_base_name = timechanger # 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.26.1+1.16 - - auto_config_version = 3.3.1 - cloth_config_version = 4.8.3 - mod_menu_version = 1.14.6+build.31 \ No newline at end of file + fabric_version=0.40.1+1.17 + + cloth_config_version = 5.0.38 + mod_menu_version = 2.1.1 \ No newline at end of file diff --git a/src/main/java/eu/midnightdust/timechanger/TimeChangerClient.java b/src/main/java/eu/midnightdust/timechanger/TimeChangerClient.java index 66bc6f3..1c49321 100644 --- a/src/main/java/eu/midnightdust/timechanger/TimeChangerClient.java +++ b/src/main/java/eu/midnightdust/timechanger/TimeChangerClient.java @@ -1,8 +1,8 @@ package eu.midnightdust.timechanger; import eu.midnightdust.timechanger.config.TimeChangerConfig; -import me.sargunvohra.mcmods.autoconfig1u.AutoConfig; -import me.sargunvohra.mcmods.autoconfig1u.serializer.JanksonConfigSerializer; +import me.shedaniel.autoconfig.AutoConfig; +import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer; import net.fabricmc.api.ClientModInitializer; public class TimeChangerClient implements ClientModInitializer { diff --git a/src/main/java/eu/midnightdust/timechanger/config/ModMenuIntegration.java b/src/main/java/eu/midnightdust/timechanger/config/ModMenuIntegration.java index c59c7bf..a6211ba 100644 --- a/src/main/java/eu/midnightdust/timechanger/config/ModMenuIntegration.java +++ b/src/main/java/eu/midnightdust/timechanger/config/ModMenuIntegration.java @@ -1,8 +1,8 @@ package eu.midnightdust.timechanger.config; -import io.github.prospector.modmenu.api.ConfigScreenFactory; -import io.github.prospector.modmenu.api.ModMenuApi; -import me.sargunvohra.mcmods.autoconfig1u.AutoConfig; +import com.terraformersmc.modmenu.api.ConfigScreenFactory; +import com.terraformersmc.modmenu.api.ModMenuApi; +import me.shedaniel.autoconfig.AutoConfig; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; diff --git a/src/main/java/eu/midnightdust/timechanger/config/TimeChangerConfig.java b/src/main/java/eu/midnightdust/timechanger/config/TimeChangerConfig.java index 2afa039..2c67015 100644 --- a/src/main/java/eu/midnightdust/timechanger/config/TimeChangerConfig.java +++ b/src/main/java/eu/midnightdust/timechanger/config/TimeChangerConfig.java @@ -1,8 +1,8 @@ package eu.midnightdust.timechanger.config; -import me.sargunvohra.mcmods.autoconfig1u.ConfigData; -import me.sargunvohra.mcmods.autoconfig1u.annotation.Config; -import me.sargunvohra.mcmods.autoconfig1u.shadowed.blue.endless.jankson.Comment; +import me.shedaniel.autoconfig.ConfigData; +import me.shedaniel.autoconfig.annotation.Config; +import me.shedaniel.cloth.clothconfig.shadowed.blue.endless.jankson.Comment; import java.util.ArrayList; import java.util.List;