From 20fc1fd80d534bca6fc6b7d307fcbe236832fd7d Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Thu, 15 Apr 2021 17:17:49 +0200 Subject: [PATCH] Downgrade the fabric-resource-loader version to support versions older than 1.16.2 on fabric and add the minotaur plugin to publish to modrinth in the future --- build.gradle.kts | 28 +++++++++++++++++++++++ fabric/src/main/resources/fabric.mod.json | 2 +- gradle.properties | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6516254..859b0be 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import com.modrinth.minotaur.request.VersionType buildscript { dependencies { classpath("com.guardsquare:proguard-gradle:7.1.0-beta2") { @@ -12,6 +13,7 @@ plugins { id("com.github.johnrengelman.shadow") version "6.1.0" apply false id("architectury-plugin") version "3.0-SNAPSHOT" id("forgified-fabric-loom") version "0.7.0-SNAPSHOT" apply false + id("com.modrinth.minotaur") version "1.2.0" } group = "fr.username404" @@ -123,4 +125,30 @@ allprojects { } } } +} + +tasks { + val publishToModrinth = register("publishtoModrinth") { + val envStr: String? = System.getenv("MODRINTH") + onlyIf { envStr != null } + versionNumber = version.toString() + projectId = "OuGyGg6A" + token = envStr + addGameVersion(architectury.minecraft.dropLast(2)) + versionType = VersionType.ALPHA + detectLoaders = false + versionName = "${project.name} $versionNumber for Minecraft $gameVersions and higher" + with(fileTree("$rootDir/shrinkedJars/")) { + files.forEach { + with(it.name) { + when { + contains("fabric") -> uploadFile = it + contains("forge") -> additionalFiles.add(it) + } + } + } + } + addLoader("fabric"); addLoader("forge") + } + build.get().finalizedBy(publishToModrinth) } \ No newline at end of file diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index cdf7a58..8c9f5cb 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -30,7 +30,7 @@ "depends": { "fabricloader": ">=0.9.3", "fabric-resource-loader-v0": "*", - "minecraft": ">=1.16.2" + "minecraft": ">=1.16" }, "breaks": { "modmenu": "<1.15.0" diff --git a/gradle.properties b/gradle.properties index 519fb79..48929d2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,5 +10,5 @@ org.gradle.vfs.watch=true minecraft=1.16.5 forge_version=36.1.4 fabric_loader_version=0.11.3 -fabric_resource_loader_version=0.4.2+ca58154a7d +fabric_resource_loader_version=0.2.5+059ea8667c modmenu_version=1.16.9 \ No newline at end of file