diff --git a/build.gradle b/build.gradle index d2d2b80..68172f6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,29 +1,17 @@ +//file:noinspection GroovyAssignabilityCheck +//file:noinspection GroovyAccessibility plugins { - id 'fabric-loom' version '1.7-SNAPSHOT' - id 'maven-publish' + id "maven-publish" + alias libs.plugins.loom } -version = project.mod_version -group = project.maven_group - -base { - archivesName = project.archives_base_name -} - -loom { - accessWidenerPath = file("src/main/resources/fireblanket.aw") -} +version = "$project.baseVersion+$project.branch" +archivesBaseName = "fireblanket" +group = "net.modfest" repositories { - maven { - url "https://api.modrinth.com/maven" - content { - includeGroup "maven.modrinth" - } - } - maven { - url "https://maven.enginehub.org/repo/" - } + maven { url "https://api.modrinth.com/maven" } + maven { url "https://maven.enginehub.org/repo/" } mavenCentral() } @@ -32,45 +20,45 @@ configurations { } 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" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - - // Fabric API. This is technically optional, but you probably want it anyway. - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" - - modImplementation "maven.modrinth:sodium:mc1.21-0.5.9" - - modImplementation "io.netty.incubator:netty-incubator-transport-classes-io_uring:0.0.15.Final" - modImplementation "io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.15.Final:linux-x86_64" - modImplementation "com.github.luben:zstd-jni:1.5.5-5" - - modImplementation "com.sk89q.worldedit:worldedit-core:7.3.3" - modImplementation "com.sk89q.worldedit:worldedit-fabric-mc1.21:7.4.0-SNAPSHOT" + minecraft libs.mc + mappings variantOf(libs.yarn) { classifier "v2" } + modImplementation libs.fl + modImplementation libs.fapi + modImplementation libs.sodium + + modImplementation libs.nettyIoUringClasses + modImplementation variantOf(libs.nettyIoUringNative) { classifier "linux-x86_64" } + modImplementation libs.zstd - shade("io.netty.incubator:netty-incubator-transport-classes-io_uring:0.0.15.Final") { transitive = false } - shade("io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.15.Final:linux-x86_64") { transitive = false } - shade("com.github.luben:zstd-jni:1.5.5-5") { transitive = false } + modImplementation libs.worldeditCore + modImplementation libs.worldeditFabric - // Uncomment the following line to enable the deprecated Fabric API modules. - // These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time. - - // modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}" + shade(libs.nettyIoUringClasses) { transitive = false } + shade(variantOf(libs.nettyIoUringNative) { classifier "linux-x86_64" }) { transitive = false } + shade(libs.zstd) { transitive = false } } processResources { - inputs.property "version", project.version - - filesMatching("fabric.mod.json") { - expand "version": project.version - } + final Map map = [ + "version": version.toString(), + "mc" : libs.versions.mc.get(), + "fl" : libs.versions.fl.get(), + "fapi" : libs.versions.fapi.get() + ] + + inputs.properties(map) + filesMatching("*.mod.json") { expand(map) } } tasks.withType(JavaCompile).configureEach { + it.options.encoding = "UTF-8" it.options.release = 21 } +loom { + accessWidenerPath = file("src/main/resources/fireblanket.aw") +} + sourceSets { dummy { compileClasspath += sourceSets.main.compileClasspath @@ -80,15 +68,9 @@ sourceSets { } } - java { - // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task - // if it is present. - // If you remove this line, sources will not be generated. withSourcesJar() - - sourceCompatibility = JavaVersion.VERSION_21 - targetCompatibility = JavaVersion.VERSION_21 + sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21 } jar { @@ -105,19 +87,10 @@ jar { } } -// configure the maven publication publishing { publications { mavenJava(MavenPublication) { from components.java } } - - // 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. - } -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index da69630..2f95772 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,11 @@ -# Done to increase the memory available to gradle. -org.gradle.jvmargs=-Xmx1G +# Gradle Properties +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.caching=true org.gradle.parallel=true - -# Fabric Properties -# check these on https://fabricmc.net/develop -minecraft_version=1.21 -yarn_mappings=1.21+build.2 -loader_version=0.15.11 - +org.gradle.caching.debug=false +org.gradle.configureondemand=true +# Enable advanced multi-module optimizations (share tiny-remaper instance between projects) +fabric.loom.multiProjectOptimisation=true # Mod Properties -mod_version=0.5.4 -maven_group=net.modfest -archives_base_name=fireblanket - -# Dependencies -fabric_version=0.100.4+1.21 +baseVersion = 0.5.4 +branch = 1.21 diff --git a/libs.versions.toml b/libs.versions.toml new file mode 100644 index 0000000..475034f --- /dev/null +++ b/libs.versions.toml @@ -0,0 +1,31 @@ +[versions] +loom = "1.7.+" + +mc = "1.21" +fl = "0.15.11" +yarn = "1.21+build.9" +fapi = "0.100.7+1.21" + +nettyIoUring = "0.0.15.Final" +zstd = "1.5.5-5" + +sodium = "mc1.21-0.5.9" +worldeditCore = "7.3.3" +worldeditFabric = "7.4.0-SNAPSHOT" + +[plugins] +loom = { id = "fabric-loom", version.ref = "loom" } + +[libraries] +mc = { group = "mojang", name = "minecraft", version.ref = "mc" } +fl = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fl" } +yarn = { group = "net.fabricmc", name = "yarn", version.ref = "yarn" } +fapi = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fapi" } + +nettyIoUringClasses = { group = "io.netty.incubator", name = "netty-incubator-transport-classes-io_uring", version.ref = "nettyIoUring" } +nettyIoUringNative = { group = "io.netty.incubator", name = "netty-incubator-transport-native-io_uring", version.ref = "nettyIoUring" } +zstd = { group = "com.github.luben", name = "zstd-jni", version.ref = "zstd" } + +sodium = { group = "maven.modrinth", name = "sodium", version.ref = "sodium" } +worldeditCore = { group = "com.sk89q.worldedit", name = "worldedit-core", version.ref = "worldeditCore" } +worldeditFabric = { group = "com.sk89q.worldedit", name = "worldedit-fabric-mc1.21", version.ref = "worldeditFabric" } diff --git a/settings.gradle b/settings.gradle index 75c4d72..593ea78 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,14 @@ pluginManagement { repositories { - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } - mavenCentral() + maven { url 'https://maven.fabricmc.net/' } gradlePluginPortal() } -} \ No newline at end of file +} + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("libs.versions.toml")) + } + } +} diff --git a/src/main/resources/assets/fireblanket/icon.png b/src/main/resources/assets/fireblanket/icon.png new file mode 100644 index 0000000..29f68d2 Binary files /dev/null and b/src/main/resources/assets/fireblanket/icon.png differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 967592a..932d9b6 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -3,14 +3,22 @@ "id": "fireblanket", "version": "${version}", "name": "Fireblanket", - "description": "Performance and bugfixing utilities for ModFest events.", + "description": "Performance, bugfixes, and utilities for ModFest events.", "authors": [ "jaskarth", "unascribed" ], + "contributors": [ + "Patbox", + "IThundxr" + ], "license": "AGPL-3.0-or-later", "icon": "assets/fireblanket/icon.png", - "environment": "*", + "contact": { + "homepage": "https://github.com/ModFest/fireblanket", + "issues": "https://github.com/ModFest/fireblanket/issues", + "sources": "https://github.com/ModFest/fireblanket" + }, "entrypoints": { "main": [ "net.modfest.fireblanket.Fireblanket" ], "client": [ "net.modfest.fireblanket.FireblanketClient" ] @@ -18,8 +26,8 @@ "mixins": [ "fireblanket.mixins.json" ], "accessWidener": "fireblanket.aw", "depends": { - "minecraft": "~1.21", - "java": ">=17", - "fabric-api": "*" + "minecraft": ">=${mc}", + "fabricloader": ">=${fl}", + "fabric-api": ">=${fapi}" } }