From 719ebd222881ab373c95e5342ad37490bdba0574 Mon Sep 17 00:00:00 2001 From: F53 Date: Thu, 30 May 2024 16:07:51 -0600 Subject: [PATCH] stop bundling dependencies, bump version number, set compile target to 1.21-pre1 --- build.gradle | 135 ++++++++++++++--------------- gradle.properties | 8 +- src/main/resources/fabric.mod.json | 28 +++--- 3 files changed, 84 insertions(+), 87 deletions(-) diff --git a/build.gradle b/build.gradle index 7e2dce6..1ca9818 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' - id 'maven-publish' + id 'fabric-loom' version '1.6-SNAPSHOT' + id 'maven-publish' } sourceCompatibility = JavaVersion.VERSION_17 @@ -11,103 +11,94 @@ version = project.mod_version group = project.maven_group loom { - accessWidenerPath = file("src/main/resources/horsebuff.accesswidener") + accessWidenerPath = file("src/main/resources/horsebuff.accesswidener") } configurations { - modIncludeImplementation + modIncludeImplementation - include.extendsFrom modIncludeImplementation - modImplementation.extendsFrom modIncludeImplementation + include.extendsFrom modIncludeImplementation + modImplementation.extendsFrom modIncludeImplementation } repositories { - // Cloth Config - maven { url "https://maven.shedaniel.me/" } + // Cloth Config + maven { url "https://maven.shedaniel.me/" } - // Mod Menu - maven { url "https://maven.terraformersmc.com/" } + // Mod Menu + maven { url "https://maven.terraformersmc.com/" } - // Mixin Extras - maven { url 'https://jitpack.io' } + // Mixin Extras + maven { url 'https://jitpack.io' } } dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - - // Fabric API - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - modIncludeImplementation(fabricApi.module("fabric-api-base", project.fabric_version)) - modIncludeImplementation(fabricApi.module("fabric-rendering-data-attachment-v1", project.fabric_version)) - modIncludeImplementation(fabricApi.module("fabric-lifecycle-events-v1", project.fabric_version)) - modIncludeImplementation(fabricApi.module("fabric-registry-sync-v0", project.fabric_version)) - modIncludeImplementation(fabricApi.module("fabric-key-binding-api-v1", project.fabric_version)) - - // Cloth Config - modIncludeImplementation("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}"){ - exclude(group: "net.fabricmc.fabric-api") - } - // Cloth devs wont update fabric api, so you cant use it certain versions without excluding it's fabric api - // but because you excluded its instance of fabric api, you need to re-add the bits it uses - modIncludeImplementation(fabricApi.module("fabric-screen-api-v1", project.fabric_version)) - modIncludeImplementation(fabricApi.module("fabric-resource-loader-v0", project.fabric_version)) - - // Mod Menu - modImplementation("com.terraformersmc:modmenu:${project.mod_menu_version}") - - // Mixin Extras - include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}"))) + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" + + // Fabric API + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + + // Cloth Config + modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { + exclude(group: "net.fabricmc.fabric-api") + } + + // Mod Menu + modImplementation("com.terraformersmc:modmenu:${project.mod_menu_version}") + + // Mixin Extras + include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.mixinextras_version}"))) } processResources { - inputs.property "version", project.version + inputs.property "version", project.version - filesMatching("fabric.mod.json") { - expand "version": project.version - } + filesMatching("fabric.mod.json") { + expand "version": project.version + } } tasks.withType(JavaCompile).configureEach { - // set encode to UTF-8, fixes some edge cases with special characters not displaying correctly - // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html - // If Javadoc is generated, this must be specified in that task too. - it.options.encoding = "UTF-8" + // set encode to UTF-8, fixes some edge cases with special characters not displaying correctly + // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html + // If Javadoc is generated, this must be specified in that task too. + it.options.encoding = "UTF-8" - it.options.release = 17 + it.options.release = 17 } java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // If you remove this line, sources will not be generated. - withSourcesJar() + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // If you remove this line, sources will not be generated. + withSourcesJar() } jar { - from("LICENSE") { - rename { "${it}_${project.archivesBaseName}"} - } + from("LICENSE") { + rename { "${it}_${project.archivesBaseName}" } + } } // configure the maven publication publishing { - publications { - mavenJava(MavenPublication) { - // add all the jars that should be included when publishing to maven - artifact(remapJar) { - builtBy remapJar - } - artifact(sourcesJar) { - builtBy remapSourcesJar - } - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - // Notice: This block does NOT have the same function as the block in the top level. - // The repositories here will be used for publishing your artifact, not for - // retrieving dependencies. - } + publications { + mavenJava(MavenPublication) { + // add all the jars that should be included when publishing to maven + artifact(remapJar) { + builtBy remapJar + } + artifact(sourcesJar) { + builtBy remapSourcesJar + } + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + // Notice: This block does NOT have the same function as the block in the top level. + // The repositories here will be used for publishing your artifact, not for + // retrieving dependencies. + } } diff --git a/gradle.properties b/gradle.properties index 2763cb7..df0ec67 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/develop/ -minecraft_version=24w21b -yarn_mappings=24w21b+build.8 +minecraft_version=1.21-pre1 +yarn_mappings=1.21-pre1+build.3 loader_version=0.15.11 # Mod Properties -mod_version=2.1.6 +mod_version=2.1.7 maven_group=com.HorseBuff archives_base_name=HorseBuff # Dependencies -fabric_version=0.99.1+1.21 +fabric_version=0.99.4+1.21 cloth_config_version=14.0.126 mod_menu_version=10.0.0-beta.1 mixinextras_version=0.3.5 \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 64d39b1..1abb737 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -2,9 +2,7 @@ "schemaVersion": 1, "id": "horsebuff", "version": "${version}", - - "accessWidener" : "horsebuff.accesswidener", - + "accessWidener": "horsebuff.accesswidener", "name": "HorseBuff", "description": "Makes Horses better by removing stupid things", "authors": [ @@ -14,23 +12,31 @@ "homepage": "https://modrinth.com/mod/horsebuff", "sources": "https://github.com/CodeF53/Horse-Buff" }, - "license": "CC BY-NC-SA", "icon": "assets/horsebuff/icon.png", - "environment": "*", "entrypoints": { - "main": [ "net.F53.HorseBuff.HorseBuffInit" ], - "client": [ "net.F53.HorseBuff.ClientInit" ], - "modmenu": [ "net.F53.HorseBuff.config.ModMenuIntegration" ] + "main": [ + "net.F53.HorseBuff.HorseBuffInit" + ], + "client": [ + "net.F53.HorseBuff.ClientInit" + ], + "modmenu": [ + "net.F53.HorseBuff.config.ModMenuIntegration" + ] }, "mixins": [ "horsebuff.mixins.json" ], - "depends": { "fabricloader": ">=0.15.11", - "minecraft": ">=1.20.6", - "java": ">=17" + "minecraft": ">=1.21-", + "java": ">=17", + "fabric-api": "*", + "cloth-config": "*" + }, + "suggests": { + "modmenu": "*" } }