From 200135260e0226d64bb86e01240c4432cf0fcf93 Mon Sep 17 00:00:00 2001 From: NotRyken <127091011+NotRyken@users.noreply.github.com> Date: Sat, 21 Sep 2024 21:58:02 +0800 Subject: [PATCH] Sync with Framework, close #12 --- .github/workflows/check-build.yml | 2 +- .github/workflows/release.yml | 11 +- .github/workflows/sync-labels.yml | 2 +- .gitignore | 1 + README.md | 1 - build.gradle | 121 +------------- buildSrc/build.gradle | 3 + .../src/main/groovy/multiloader-common.gradle | 152 ++++++++++++++++++ .../src/main/groovy/multiloader-loader.gradle | 44 +++++ changelog.md | 2 +- common/build.gradle | 39 +++-- .../resources/META-INF/accesstransformer.cfg | 1 + .../assets/clientsort/lang/en_us.json | 60 +++---- fabric/build.gradle | 46 ++---- fabric/src/main/resources/fabric.mod.json | 2 +- gradle.properties | 65 ++++---- neoforge/build.gradle | 68 ++++---- .../resources/META-INF/accesstransformer.cfg | 0 settings.gradle | 34 ++-- 19 files changed, 379 insertions(+), 275 deletions(-) create mode 100644 buildSrc/build.gradle create mode 100644 buildSrc/src/main/groovy/multiloader-common.gradle create mode 100644 buildSrc/src/main/groovy/multiloader-loader.gradle create mode 100644 common/src/main/resources/META-INF/accesstransformer.cfg delete mode 100644 neoforge/src/main/resources/META-INF/accesstransformer.cfg diff --git a/.github/workflows/check-build.yml b/.github/workflows/check-build.yml index ec8ae35..4a4f98d 100644 --- a/.github/workflows/check-build.yml +++ b/.github/workflows/check-build.yml @@ -1,4 +1,4 @@ -# Builds the project on Linux and Windows as a partial defence against bad commits +# Builds the project on Linux and Windows as a partial defense against bad commits name: Check Build on: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 585420e..2453a08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,12 @@ -# Builds the project and publishes the artifacts to GitHub and Modrinth -# Requires GITHUB_TOKEN to have write permissions; if not, replace it with a custom token -# Requires a Modrinth PAT MODRINTH_TOKEN +# Builds the project and publishes the artifacts to GitHub, Modrinth and CurseForge +# Modrinth publishing requires a Modrinth PAT MODRINTH_TOKEN +# Will skip without error if not present +# CurseForge publishing requires a CurseForge API token CURSEFORGE_TOKEN +# Will skip without error if not present name: Release -on: [workflow_dispatch] +on: + workflow_dispatch: permissions: contents: write diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 471d028..7d3c291 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -1,4 +1,4 @@ -# Synchronizes the repo's labels with labels.yml +# Synchronizes the repo's labels with a centralized labels.yml # Requires GITHUB_TOKEN to have write permissions; if not, replace it with a custom token name: Sync Labels diff --git a/.gitignore b/.gitignore index 6f56452..4ecc163 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ run/ runs/ out/ classes/ +.eclipse/ # IDEA .idea/ diff --git a/README.md b/README.md index 2c11b42..a9576ee 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ A standalone implementation of Siphalor's [Mouse Wheelie](https://github.com/Sip [![Latest Minecraft](https://img.shields.io/modrinth/game-versions/K0AkAin6?label=Latest%20Minecraft&color=%2300AF5C&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AYht+malUqDnYQEclQneyiIo6likWwUNoKrTqYXPoHTRqSFBdHwbXg4M9i1cHFWVcHV0EQ/AFxdnBSdJESv0sKLWI8uLuH97735e47QGhUmGp2RQFVs4xUPCZmc6ti4BU9CKCP1jGJmXoivZiB5/i6h4/vdxGe5V335xhQ8iYDfCJxlOmGRbxBPLtp6Zz3iUOsJCnE58STBl2Q+JHrsstvnIsOCzwzZGRS88QhYrHYwXIHs5KhEs8QhxVVo3wh67LCeYuzWqmx1j35C4N5bSXNdZqjiGMJCSQhQkYNZVRgIUK7RoqJFJ3HPPwjjj9JLplcZTByLKAKFZLjB/+D3701C9NTblIwBnS/2PbHOBDYBZp12/4+tu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mwGpscWn4o6Afs4GlhNNSWyBpL0B7xgPPAHMGGR/Q5ZAUAz4wxJJnQH91bs/XJ0l+G1O7raAPk8DFoboPHYCUv3hSUl/hPjDWuCCDP3sBZaE6HwYcFsGnWdFQJS7uwF/aE/jD3XuD4cDnu92nY9Po/Ptueg8nx6QyR/uS827/o7TfYt9l38Jr3hpa1+IzlcD10cwprxKIMwfWoBlkg4EvGuCz46dISSt8CVsbUTjiZ2AgTjk8gj0hxCdNwOjIh5HXj0gXZyabv0Qks9HxTGwWuKNC4E3zOxDYKakg0lp7TVgetw7qULV+KYDY5I+jykE+EISUDRRIaBCQIWACgEVAioE/DuOlTHeY4Mh4JcyJqAjIwGSDgNHyxD8kaAfUIR5wAdlSMD72ZhgM9BbRuB7HNPgCPA985wyIaHXd57tWaVBSS8DU4D2EgbfDlwuaVNO6wBJbUADibLU/hIC3kXi8HZyagUoNTIWRPyI/Dkz20j4mVuxRNozzJwISCKiC1hkZutJ1OUbiwz8RyQOUnZm81DWJTFJ3wI3mdm1wBpgYoGBf0Pi+P6dWPcCkrYA9cCtQGcBgB8kccgyIVfwOc2AFBL6gFYz2+SmMw84MYa09iLQJOnXoXYWSVVY0iH3hxd8wdGYR53Pk7Qrqg4jLYtL+s794Rr3h0kRdb2bxBH5uyVRD5D0MXCp+8O+IXR1wGV1cT7ARz4DQvzhLWCBryGGZ6HzZ4ClvjvNW+T9ZMj/47M8af0wK8Mjm13n38eRSmI7GvOfuMx2ItYE3NJG4jjd4sylsdcEHWCDG1uyyTXEDb4SlYC/AW0t3IQpiA17AAAAAElFTkSuQmCC)](https://modrinth.com/mod/K0AkAin6/versions) [![Loader](https://img.shields.io/badge/Available%20for-Fabric-dbd0b4?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAcBAMAAACNPbLgAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpX5UHMwgIpihOtlFRRxLFYtgobQVWnUwufQLmjQkKS6OgmvBwY/FqoOLs64OroIg+AHi6uKk6CIl/i8ptIj14Lgf7+497t4BQr3MNKsrAmi6bSZjUSmTXZUCr+iHiADG0Cszy4inFtPoOL7u4ePrXZhndT735xhQcxYDfBJxhBmmTbxBPLtpG5z3iUVWlFXic+JJky5I/Mh1xeM3zgWXBZ4pmunkPLFILBXaWGljVjQ14hnikKrplC9kPFY5b3HWylXWvCd/YTCnr6S4TnMUMSwhjgQkKKiihDJshGnVSbGQpP1oB/+I60+QSyFXCYwcC6hAg+z6wf/gd7dWfnrKSwpGge4Xx/kYBwK7QKPmON/HjtM4AfzPwJXe8lfqwNwn6bWWFjoCBreBi+uWpuwBlzvA8JMhm7Ir+WkK+TzwfkbflAWGboG+Na+35j5OH4A0dbV8AxwcAhMFyl7v8O6e9t7+PdPs7wd+dXKrd9SjeQAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+cLFAcgIbOcUjoAAAAbUExURQAAAB0tQTg0KoB6bZqSfq6mlLyynMa8pdvQtJRJT6UAAAABdFJOUwBA5thmAAAAAWJLR0QB/wIt3gAAAF5JREFUGNN10FENwCAMhOFqOQuzMAtYOAtYqGw6mkEvhL59yR9Ca5YDqyOC465eKYqQm6LoCkVwnwQOBYKdeA5l51zhFtrsnPmg6m3Z2akk15dFH1lWFQVxlUFv+2sAJlA9O7NwQRQAAAAASUVORK5CYII=)](https://fabricmc.net/) -[![Loader](https://img.shields.io/badge/Available%20for-Quilt-9115ff?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV/TiqIVBwuKOASsTnZREcdSxSJYKG2FVh1MLv2CJg1Jiouj4Fpw8GOx6uDirKuDqyAIfoC4ujgpukiJ/0sKLWI8OO7Hu3uPu3eA0Kgw1QxEAVWzjFQ8JmZzq2L3K/oQQgBjGJKYqSfSixl4jq97+Ph6F+FZ3uf+HP1K3mSATySOMt2wiDeIZzctnfM+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uaiRZ3bSHqtvbH16Pq+bowXBxHnZOf/+UsDPwpozF404dehcXUed4pLy6Ko2OO9HFBaqyFfT2/5vlyUvj429+evH62tKTr/z50tcsiq2gLiqVxGa5bZN7I1XSbpebBNJtJMnCoLApmnxWHizDx/nuOJr4tfgkf0iazcoA4GC0eTDZT5XDZHN0A8pVIwB46t1ePog1w8vZI1NYFZUAOPYRCTC6xwYgAHr6ALroaYAAkvZE3m7LknekaSc6MY1qCFWFJl7T/JX2GliWh8laL6oTdRWvC7T16anVs+c2BZ4/Wzk9zYY7Q7frgHJVt481d21jVUqzpr1r9vwRda4RsCrWVa66aVvLa+OsbW92cy9CH5Ju+mGxTToXZx8k+dNBOp4Mw8H7+80vZ22ImFcBxObq8Bkp3L+vnsuAAGDK49G3C7vf3/wGgBgAAAAgADJTHo2+a8TWUzKAoCnLy1GXwNtJUQmDtwHc3fSGRMPeyfnlUQ7KO9BNweV5fjTdBAwmXSAAAehOBggYdvpAkgBAf5wiiuPdukliAAA0dZwsmkg8AAAAQNEAAAAA+B8LzexYIpdh2QAAAABJRU5ErkJggg==)](https://neoforged.net/) [![Download on Modrinth](https://img.shields.io/modrinth/dt/K0AkAin6?label=Download%20on%20Modrinth&logo=modrinth&logoColor=%2300AF5C)](https://modrinth.com/mod/K0AkAin6) diff --git a/build.gradle b/build.gradle index b13dc00..4995303 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,6 @@ plugins { - id("java") - id("java-library") - id("idea") - id("maven-publish") - id("org.jetbrains.gradle.plugin.idea-ext") version("${ideaext_version}") // Required for NeoGradle + id("fabric-loom") version("${loom_version}") apply(false) + id("net.neoforged.moddev") version("${moddev_version}") apply(false) id("com.modrinth.minotaur") version("${minotaur_version}") id("net.darkhax.curseforgegradle") version("${curseforgegradle_version}") id("com.github.breadmoirai.github-release") version("${githubrelease_version}") @@ -14,113 +11,14 @@ subprojects { version = mod_version group = mod_group - apply(plugin: "java") - apply(plugin: "java-library") - apply(plugin: "idea") - apply(plugin: "maven-publish") - - if (project.name != "common") { + // Publishing + if (name != "common") { apply(plugin: "com.modrinth.minotaur") + apply(plugin: "net.darkhax.curseforgegradle") apply(plugin: "com.github.breadmoirai.github-release") apply(plugin: "org.ajoberstar.grgit.service") - } - - java.toolchain.languageVersion = JavaLanguageVersion.of(Integer.valueOf(java_version)) - - jar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_name}" } - } - manifest { - attributes([ - "Specification-Title" : mod_name, - "Specification-Vendor" : mod_owner, - "Specification-Version" : project.jar.archiveVersion, - "Implementation-Title" : project.name, - "Implementation-Version" : project.jar.archiveVersion, - "Implementation-Vendor" : mod_owner, - "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), - "Timestamp" : System.currentTimeMillis(), - "Built-On-Java" : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", - "Built-On-Minecraft" : minecraft_version - ]) - } - } - java.withSourcesJar() - sourcesJar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_name}" } - } - } - repositories { - maven { - name = "Modrinth" - url = "https://api.modrinth.com/maven" - } - maven { - name = "Shedaniel" - url = "https://maven.shedaniel.me/" - } - } - - tasks.withType(JavaCompile).configureEach { - it.options.encoding = "UTF-8" - it.options.getRelease().set(Integer.valueOf(java_version)) - } - - processResources { - def expandProps = [ - "project_group": project.group, - "mod_version": mod_version, - "mod_group": mod_group, - "mod_id": mod_id, - "mod_name": mod_name, - "mod_description": mod_description, - "mod_icon": "assets/" + mod_id + "/icon.png", - "mod_owner": mod_owner, - "mod_authors_list": asJsonList(mod_authors), - "mod_contributors_list": asJsonList(mod_contributors), - "mod_authors_string": mod_authors.replace(",", ", "), - "mod_contributors_string": mod_contributors.replace(",", ", "), - "mod_license": mod_license, - "mod_environment": mod_environment, - "java_version": java_version, - "java_versions_fabric_list": asJsonList(java_versions_fabric), - "java_versions_neoforge": java_versions_neoforge, - "minecraft_version": minecraft_version, - "minecraft_versions_fabric_list": asJsonList(minecraft_versions_fabric), - "minecraft_versions_neoforge": minecraft_versions_neoforge, - "fabric_loader_version": fabric_loader_version, - "fabric_loader_versions_list": asJsonList(fabric_loader_versions), - "fabric_api_version": fabric_api_version, - "fabric_api_versions_list": asJsonList(fabric_api_versions), - "neoforge_loader_versions": neoforge_loader_versions, - "neoforge_version": neoforge_version, - "neoforge_versions": neoforge_versions, - "clothconfig_version": clothconfig_version, - "clothconfig_versions_fabric_list": asJsonList(clothconfig_versions_fabric), - "clothconfig_versions_neoforge": clothconfig_versions_neoforge, - "modmenu_version": modmenu_version, - "modmenu_versions_list": asJsonList(modmenu_versions), - "homepage_url": homepage_url, - "sources_url": sources_url, - "issues_url": issues_url, - "contact_url": contact_url - ] - - filesMatching(["pack.mcmeta", "*.mod.json", "META-INF/*mods.toml", "*.mixins.json", "assets/"+mod_id+"/lang/*.json"]) { - expand expandProps - } - inputs.properties(expandProps) - } - - tasks.withType(GenerateModuleMetadata).configureEach { - enabled = false - } - - afterEvaluate { - if (name != "common") { + afterEvaluate { modrinth { token = System.getenv().MODRINTH_TOKEN ? System.getenv().MODRINTH_TOKEN : "empty" projectId = modrinth_id @@ -156,8 +54,7 @@ subprojects { tasks.modrinthSyncBody.onlyIf { System.getenv().MODRINTH_TOKEN } task curseforge(type: net.darkhax.curseforgegradle.TaskPublishCurseForge) { - apiToken = System.getenv().CURSEFORGE_TOKEN ? System.getenv().CURSEFORGE_TOKEN : "" - if (apiToken.isBlank()) return + apiToken = System.getenv().CURSEFORGE_TOKEN ? System.getenv().CURSEFORGE_TOKEN : "empty" disableVersionDetection() String module = project.name @@ -212,10 +109,6 @@ subprojects { } } -static asJsonList(String versions) { - return versions.split(",").collect { "\"$it\"" }.join(',') -} - static String capsLoader(String loader) { switch(loader) { case "fabric": return "Fabric" diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 0000000..fbd5c69 --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,3 @@ +plugins { + id("groovy-gradle-plugin") +} diff --git a/buildSrc/src/main/groovy/multiloader-common.gradle b/buildSrc/src/main/groovy/multiloader-common.gradle new file mode 100644 index 0000000..d069647 --- /dev/null +++ b/buildSrc/src/main/groovy/multiloader-common.gradle @@ -0,0 +1,152 @@ +plugins { + id("java-library") + id("maven-publish") +} + +base { + archivesName = "${mod_id}-${project.name}-${minecraft_version}" +} + +java { + toolchain.languageVersion = JavaLanguageVersion.of(java_version) + withSourcesJar() +// withJavadocJar() // Also uncomment javadocElements in capabilities below +} + +repositories { + mavenCentral() + // https://docs.gradle.org/current/userguide/declaring_repositories.html#declaring_content_exclusively_found_in_one_repository + exclusiveContent { + forRepository { + maven { + name = 'Sponge' + url = 'https://repo.spongepowered.org/repository/maven-public' + } + } + filter { includeGroupAndSubgroups('org.spongepowered') } + } + exclusiveContent { + forRepositories( + maven { + name = 'ParchmentMC' + url = 'https://maven.parchmentmc.org/' + }, + maven { + name = "NeoForge" + url = 'https://maven.neoforged.net/releases' + } + ) + filter { includeGroup('org.parchmentmc.data') } + } + maven { + name = "Modrinth" + url = "https://api.modrinth.com/maven" + } + maven { + name = "Shedaniel" + url = "https://maven.shedaniel.me/" + } +} + +// Declare capabilities on the outgoing configurations. +// Read more about capabilities here: https://docs.gradle.org/current/userguide/component_capabilities.html#sec:declaring-additional-capabilities-for-a-local-component +["apiElements", "runtimeElements", "sourcesElements", /*"javadocElements"*/].each { variant -> + configurations."$variant".outgoing { + capability("$group:${base.archivesName.get()}:$version") + capability("$group:$mod_id-${project.name}-${minecraft_version}:$version") + capability("$group:$mod_id:$version") + } + publishing.publications.configureEach { + suppressPomMetadataWarningsFor(variant) + } +} + +sourcesJar { + from(rootProject.file("LICENSE")) { + rename { "${it}_${mod_name}" } + } +} + +jar { + from(rootProject.file("LICENSE")) { + rename { "${it}_${mod_name}" } + } + + manifest { + attributes([ + "Specification-Title" : mod_name, + "Specification-Vendor" : mod_owner, + "Specification-Version" : project.jar.archiveVersion, + "Implementation-Title" : project.name, + "Implementation-Version" : project.jar.archiveVersion, + "Implementation-Vendor" : mod_owner, + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + "Timestamp" : System.currentTimeMillis(), + "Built-On-Java" : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", + "Built-On-Minecraft" : minecraft_version + ]) + } +} + +processResources { + def expandProps = [ + // Mod info + "mod_version": mod_version, + "mod_group": mod_group, + "mod_id": mod_id, + "mod_name": mod_name, + "mod_description": mod_description, + "mod_icon": "assets/" + mod_id + "/icon.png", + "mod_owner": mod_owner, + "mod_authors_list": asJsonList(mod_authors), + "mod_contributors_list": asJsonList(mod_contributors), + "mod_authors_string": mod_authors.replace(",", ", "), + "mod_contributors_string": mod_contributors.replace(",", ", "), + "mod_license": mod_license, + "mod_environment": mod_environment, + // Links + "homepage_url": homepage_url, + "sources_url": sources_url, + "issues_url": issues_url, + "contact_url": contact_url, + // Java + "java_version": java_version, + "java_versions_fabric_list": asJsonList(java_versions_fabric), + "java_versions_neoforge": java_versions_neoforge, + // Minecraft + "minecraft_versions_fabric_list": asJsonList(minecraft_versions_fabric), + "minecraft_versions_neoforge": minecraft_versions_neoforge, + // Fabric + "fabric_loader_versions_list": asJsonList(fabric_loader_versions), + "fabric_api_versions_list": asJsonList(fabric_api_versions), + // NeoForge + "neoforge_loader_versions": neoforge_loader_versions, + "neoforge_versions": neoforge_versions, + // Dependencies + "clothconfig_versions_fabric_list": asJsonList(clothconfig_versions_fabric), + "clothconfig_versions_neoforge": clothconfig_versions_neoforge, + "modmenu_versions_fabric_list": asJsonList(modmenu_versions), + ] + filesMatching(["pack.mcmeta", "*.mod.json", "META-INF/*mods.toml", "*.mixins.json"]) { + expand expandProps + } + inputs.properties(expandProps) +} + +publishing { + publications { + register("mavenJava", MavenPublication) { + artifactId base.archivesName.get() + from components.java + } + } + repositories { + maven { + url System.getenv("local_maven_url") + } + } +} + +static asJsonList(String versions) { + return versions.split(",").collect { "\"$it\"" }.join(",") +} diff --git a/buildSrc/src/main/groovy/multiloader-loader.gradle b/buildSrc/src/main/groovy/multiloader-loader.gradle new file mode 100644 index 0000000..fab1110 --- /dev/null +++ b/buildSrc/src/main/groovy/multiloader-loader.gradle @@ -0,0 +1,44 @@ +plugins { + id("multiloader-common") +} + +configurations { + commonJava{ + canBeResolved = true + } + commonResources{ + canBeResolved = true + } +} + +dependencies { + compileOnly(project(":common")) { + capabilities { + requireCapability "$group:$mod_id" + } + } + commonJava project(path: ":common", configuration: "commonJava") + commonResources project(path: ":common", configuration: "commonResources") +} + +tasks.named("compileJava", JavaCompile) { + dependsOn(configurations.commonJava) + source(configurations.commonJava) +} + +processResources { + dependsOn(configurations.commonResources) + from(configurations.commonResources) +} + +tasks.named("javadoc", Javadoc).configure { + dependsOn(configurations.commonJava) + source(configurations.commonJava) +} + +tasks.named("sourcesJar", Jar) { + dependsOn(configurations.commonJava) + from(configurations.commonJava) + dependsOn(configurations.commonResources) + from(configurations.commonResources) +} diff --git a/changelog.md b/changelog.md index 7d6c5ba..37cb70b 100644 --- a/changelog.md +++ b/changelog.md @@ -1 +1 @@ -- Fix a bug breaking middle-click drag in creative mode +- Fix config on recent NeoForge versions diff --git a/common/build.gradle b/common/build.gradle index b8acee1..2f5f9c5 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,26 +1,41 @@ plugins { - id("org.spongepowered.gradle.vanilla") version("${vanillagradle_version}") -} - -base { - archivesName = "${mod_name}-Common-${minecraft_version}" + id("multiloader-common") + id("net.neoforged.moddev") } dependencies { compileOnly("org.spongepowered:mixin:${mixin_version}") - compileOnly("io.github.llamalad7:mixinextras-common:${mixinextras_version}") annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}") - // Using NeoForge version here to avoid having to remap + // Mod dependencies use NeoForge version to avoid remapping complications implementation("me.shedaniel.cloth:cloth-config-neoforge:${clothconfig_version}") +} - implementation("maven.modrinth:fRiHVvU7:${emi_version_neoforge}") +neoForge { + version = neoforge_version // Shut up + neoFormVersion = neoform_version + // Automatically enable AccessTransformers if the file exists + def at = file("src/main/resources/META-INF/accesstransformer.cfg") + if (at.exists()) accessTransformers.from(at.absolutePath) + parchment { + minecraftVersion = parchment_minecraft_version + mappingsVersion = parchment_version + } } -minecraft { - version(minecraft_version) - if (file("src/main/resources/${mod_id}.accesswidener").exists()) { - accessWideners(file("src/main/resources/${mod_id}.accesswidener")) +configurations { + commonJava { + canBeResolved = false + canBeConsumed = true + } + commonResources { + canBeResolved = false + canBeConsumed = true } } + +artifacts { + commonJava sourceSets.main.java.sourceDirectories.singleFile + commonResources sourceSets.main.resources.sourceDirectories.singleFile +} diff --git a/common/src/main/resources/META-INF/accesstransformer.cfg b/common/src/main/resources/META-INF/accesstransformer.cfg new file mode 100644 index 0000000..f1fbf63 --- /dev/null +++ b/common/src/main/resources/META-INF/accesstransformer.cfg @@ -0,0 +1 @@ +# https://docs.neoforged.net/docs/advanced/accesstransformers/ diff --git a/common/src/main/resources/assets/clientsort/lang/en_us.json b/common/src/main/resources/assets/clientsort/lang/en_us.json index 230c61f..fa6db7e 100644 --- a/common/src/main/resources/assets/clientsort/lang/en_us.json +++ b/common/src/main/resources/assets/clientsort/lang/en_us.json @@ -1,38 +1,38 @@ { - "screen.${mod_id}.default": "ClientSort", - "screen.${mod_id}.options": "ClientSort Options", + "screen.clientsort.default": "ClientSort", + "screen.clientsort.options": "ClientSort Options", - "message.${mod_id}.install_cloth": "Install Cloth Config API to access mod options.", - "message.${mod_id}.go_modrinth": "View on Modrinth", + "message.clientsort.install_cloth": "Install Cloth Config API to access mod options.", + "message.clientsort.go_modrinth": "View on Modrinth", - "${mod_id}.key_group": "ClientSort", - "key.${mod_id}.sort": "Sort Inventory", + "clientsort.key_group": "ClientSort", + "key.clientsort.sort": "Sort Inventory", - "option.${mod_id}.general": "General", - "option.${mod_id}.interaction_rate_server": "Multiplayer Interaction Rate", - "option.${mod_id}.interaction_rate_client": "Singleplayer Interaction Rate", - "option.${mod_id}.interaction_rate.tooltip": "Reduce to sort faster, increase if you are experiencing packet rate issues", - "option.${mod_id}.hotbar_mode": "Hotbar Mode", - "option.${mod_id}.sorting": "Sorting", - "option.${mod_id}.sort_mode": "Sort Mode", - "option.${mod_id}.shift_sort_mode": "Shift Sort Mode", - "option.${mod_id}.ctrl_sort_mode": "Ctrl Sort Mode", - "option.${mod_id}.alt_sort_mode": "Alt Sort Mode", - "option.${mod_id}.optimized_creative_sorting": "Optimized Creative Sorting", + "option.clientsort.general": "General", + "option.clientsort.interaction_rate_server": "Multiplayer Interaction Rate", + "option.clientsort.interaction_rate_client": "Singleplayer Interaction Rate", + "option.clientsort.interaction_rate.tooltip": "Reduce to sort faster, increase if you are experiencing packet rate issues", + "option.clientsort.hotbar_mode": "Hotbar Mode", + "option.clientsort.sorting": "Sorting", + "option.clientsort.sort_mode": "Sort Mode", + "option.clientsort.shift_sort_mode": "Shift Sort Mode", + "option.clientsort.ctrl_sort_mode": "Ctrl Sort Mode", + "option.clientsort.alt_sort_mode": "Alt Sort Mode", + "option.clientsort.optimized_creative_sorting": "Optimized Creative Sorting", - "hotbar_mode.${mod_id}.merge": "Merge", - "hotbar_mode.${mod_id}.merge.tooltip": "Hotbar will be treated as part of the main inventory", - "hotbar_mode.${mod_id}.split": "Split", - "hotbar_mode.${mod_id}.split.tooltip": "Hotbar will be treated as a different inventory", - "hotbar_mode.${mod_id}.off": "Off", - "hotbar_mode.${mod_id}.off.tooltip": "Hotbar cannot be sorted", + "hotbar_mode.clientsort.merge": "Merge", + "hotbar_mode.clientsort.merge.tooltip": "Hotbar will be treated as part of the main inventory", + "hotbar_mode.clientsort.split": "Split", + "hotbar_mode.clientsort.split.tooltip": "Hotbar will be treated as a different inventory", + "hotbar_mode.clientsort.off": "Off", + "hotbar_mode.clientsort.off.tooltip": "Hotbar cannot be sorted", - "sort_order.${mod_id}.none": "None", - "sort_order.${mod_id}.alphabet": "Alphabet", - "sort_order.${mod_id}.creative": "Creative", - "sort_order.${mod_id}.quantity": "Quantity", - "sort_order.${mod_id}.raw_id": "Raw ID", + "sort_order.clientsort.none": "None", + "sort_order.clientsort.alphabet": "Alphabet", + "sort_order.clientsort.creative": "Creative", + "sort_order.clientsort.quantity": "Quantity", + "sort_order.clientsort.raw_id": "Raw ID", - "option.${mod_id}.error.low": "Too low", - "option.${mod_id}.error.high": "Too high" + "option.clientsort.error.low": "Too low", + "option.clientsort.error.high": "Too high" } \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index 795db0f..fd4730c 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,60 +1,42 @@ plugins { - id("fabric-loom") version("${loom_version}") -} - -base { - archivesName = "${mod_name}-Fabric-${minecraft_version}" + id("multiloader-loader") + id("fabric-loom") } dependencies { - compileOnly(project(":common")) minecraft("com.mojang:minecraft:${minecraft_version}") - mappings(loom.officialMojangMappings()) - - compileOnly("io.github.llamalad7:mixinextras-fabric:${mixinextras_version}") - annotationProcessor("io.github.llamalad7:mixinextras-fabric:${mixinextras_version}") + mappings loom.layered { + officialMojangMappings() + parchment("org.parchmentmc.data:parchment-${parchment_minecraft_version}:${parchment_version}@zip") + } modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}") modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}") - modImplementation("maven.modrinth:modmenu:${modmenu_version}") - + modImplementation("maven.modrinth:mOgUt4GM:${modmenu_version}") modImplementation("me.shedaniel.cloth:cloth-config-fabric:${clothconfig_version}") { exclude(group: "net.fabricmc.fabric-api") } - - modImplementation("maven.modrinth:fRiHVvU7:${emi_version_fabric}") } loom { - if (project(":common").file("src/main/resources/${mod_id}.accesswidener").exists()) { - accessWidenerPath = project(":common").file("src/main/resources/${mod_id}.accesswidener") - } + def aw = project(":common").file("src/main/resources/${mod_id}.accesswidener") + if (aw.exists()) accessWidenerPath.set(aw) mixin { - defaultRefmapName = "${mod_id}.refmap.json" + defaultRefmapName.set("${mod_id}.refmap.json") } runs { client { client() - setConfigName('Fabric Client') + setConfigName("Fabric Client") ideConfigGenerated(true) - runDir('runs/client') + runDir("runs/client") } server { server() - setConfigName('Fabric Server') + setConfigName("Fabric Server") ideConfigGenerated(true) - runDir('runs/server') + runDir("runs/server") } } } - -tasks.withType(JavaCompile).configureEach { - source(project(":common").sourceSets.main.allSource) -} -tasks.named("sourcesJar", Jar) { - from(project(":common").sourceSets.main.allSource) -} -processResources { - from project(":common").sourceSets.main.resources -} diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 98f67d9..dbfebde 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -35,7 +35,7 @@ }, "recommends": { - "modmenu": [$modmenu_versions_list], + "modmenu": [$modmenu_versions_fabric_list], "cloth-config": [$clothconfig_versions_fabric_list] }, diff --git a/gradle.properties b/gradle.properties index 928ccad..59a193b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ # Neo/Forge version ranges: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html # Project -mod_version=0.9.0 +mod_version=1.0.0 mod_group=dev.terminalmc mod_id=clientsort mod_name=ClientSort @@ -12,6 +12,12 @@ mod_authors=NotRyken mod_contributors=Siphalor mod_license=Apache-2.0 +# Links +homepage_url=https://modrinth.com/mod/K0AkAin6 +sources_url=https://github.com/TerminalMC/ClientSort +issues_url=https://github.com/TerminalMC/ClientSort/issues +contact_url=https://terminalmc.dev + # Environment mod_environment=client @@ -25,36 +31,32 @@ minecraft_version=1.21 minecraft_versions_fabric=>1.20.6 <1.22 minecraft_versions_neoforge=(1.20.6, 1.22) +# Parchment https://parchmentmc.org/docs/getting-started#choose-a-version +parchment_minecraft_version=1.21 +parchment_version=2024.07.28 + # Fabric https://fabricmc.net/develop/ -fabric_loader_version=0.15.11 +fabric_loader_version=0.16.5 fabric_loader_versions=>=0.15.0 -fabric_api_version=0.100.3+1.21 +fabric_api_version=0.102.0+1.21 fabric_api_versions=* # NeoForge https://projects.neoforged.net/neoforged/neoforge neoforge_loader_versions=[1,) -neoforge_version=21.0.21-beta -neoforge_versions=(20.6, 22) +neoforge_version=21.0.167 +neoforge_versions=[21.0.143, 22) +# NeoForm https://projects.neoforged.net/neoforged/neoform +neoform_version=1.21-20240613.152323 # Cloth Config https://modrinth.com/mod/9s6osm5g/versions -clothconfig_version=15.0.127 -clothconfig_versions_fabric=>14 -clothconfig_versions_neoforge=(14,) +clothconfig_version=15.0.140 +clothconfig_versions_fabric=>=15 +clothconfig_versions_neoforge=[15,) # ModMenu https://modrinth.com/mod/mOgUt4GM/versions -modmenu_version=11.0.1 +modmenu_version=11.0.2 modmenu_versions=>10 -# EMI https://modrinth.com/mod/fRiHVvU7/versions -emi_version_fabric=1.1.8+1.21+fabric -emi_version_neoforge=1.1.8+1.21+neoforge - -# Links -homepage_url=https://modrinth.com/mod/K0AkAin6 -sources_url=https://github.com/TerminalMC/ClientSort -issues_url=https://github.com/TerminalMC/ClientSort/issues -contact_url=https://terminalmc.dev - # GitHub, Modrinth, CurseForge releases # Plural properties expect CSV lists github_repo_owner=TerminalMC @@ -62,9 +64,9 @@ github_repo=ClientSort modrinth_id=K0AkAin6 curseforge_id=1049891 # 'release', 'alpha' or 'beta' -release_type=beta +release_type=release # Fabric -release_mod_loaders_fabric=fabric,quilt +release_mod_loaders_fabric=fabric release_game_versions_fabric=1.21,1.21.1 release_required_dep_ids_fabric_mr=P7dR8mSH,mOgUt4GM,9s6osm5g release_required_dep_ids_fabric_cf=fabric-api,modmenu,cloth-config @@ -75,28 +77,25 @@ release_required_dep_ids_neoforge_mr=9s6osm5g release_required_dep_ids_neoforge_cf=cloth-config # Mixin https://mvnrepository.com/artifact/org.spongepowered/mixin -mixin_version=0.8.5 +mixin_version=0.8.7 # MixinExtras https://github.com/LlamaLad7/MixinExtras/releases -mixinextras_version=0.3.5 +mixinextras_version=0.4.1 # Plugins -# idea-ext https://plugins.gradle.org/plugin/org.jetbrains.gradle.plugin.idea-ext -ideaext_version=1.1.8 +# Fabric Loom https://mvnrepository.com/artifact/net.fabricmc/fabric-loom +loom_version=1.7.4 +# ModDev https://plugins.gradle.org/plugin/net.neoforged.moddev +moddev_version=1.0.19 # Minotaur https://plugins.gradle.org/plugin/com.modrinth.minotaur minotaur_version=2.8.7 # CurseForgeGradle https://plugins.gradle.org/plugin/net.darkhax.curseforgegradle -curseforgegradle_version=1.1.24 +curseforgegradle_version=1.1.25 # github-release https://plugins.gradle.org/plugin/com.github.breadmoirai.github-release githubrelease_version=2.5.2 # grgit-service https://github.com/ajoberstar/grgit/releases grgitservice_version=5.2.2 -# VanillaGradle https://plugins.gradle.org/plugin/org.spongepowered.gradle.vanilla -vanillagradle_version=0.2.1-SNAPSHOT -# Fabric Loom https://mvnrepository.com/artifact/net.fabricmc/fabric-loom -loom_version=1.7.1 -# NeoGradle https://maven.neoforged.net/#/releases/net/neoforged/gradle/userdev -userdev_version=7.0.145 # Gradle -org.gradle.jvmargs=-Xmx3G +org.gradle.jvmargs=-Xmx4G org.gradle.daemon=false + diff --git a/neoforge/build.gradle b/neoforge/build.gradle index f8582ce..e04fc1b 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -1,40 +1,42 @@ plugins { - id("net.neoforged.gradle.userdev") version("${userdev_version}") -} - -base { - archivesName = "${mod_name}-NeoForge-${minecraft_version}" + id("multiloader-loader") + id("net.neoforged.moddev") } dependencies { - compileOnly(project(":common")) - implementation("net.neoforged:neoforge:${neoforge_version}") - - compileOnly("io.github.llamalad7:mixinextras-neoforge:${mixinextras_version}") - annotationProcessor("io.github.llamalad7:mixinextras-neoforge:${mixinextras_version}") - implementation("me.shedaniel.cloth:cloth-config-neoforge:${clothconfig_version}") - - implementation("maven.modrinth:fRiHVvU7:${emi_version_neoforge}") -} - -// Temporary workaround for a NeoGradle bug -tasks.named("test").configure { - enabled = false } -if (file("src/main/resources/META-INF/accesstransformer.cfg").exists()) { - minecraft.accessTransformers.file(file("src/main/resources/META-INF/accesstransformer.cfg")) -} - -Spec notNeoTask = { Task it -> !it.name.startsWith("neo") } as Spec - -tasks.withType(JavaCompile).matching(notNeoTask).configureEach { - source(project(":common").sourceSets.main.allSource) -} -tasks.named("sourcesJar", Jar) { - from(project(":common").sourceSets.main.allSource) -} -tasks.withType(ProcessResources).matching(notNeoTask).configureEach { - from project(":common").sourceSets.main.resources -} +neoForge { + version = neoforge_version + // Automatically enable neoforge AccessTransformers if the file exists + def at = project(":common").file("src/main/resources/META-INF/accesstransformer.cfg") + if (at.exists()) accessTransformers.from(at.absolutePath) + parchment { + minecraftVersion = parchment_minecraft_version + mappingsVersion = parchment_version + } + runs { + configureEach { + systemProperty("neoforge.enabledGameTestNamespaces", "${mod_id}") + // Unify the run config names with fabric + ideName = "NeoForge ${it.name.capitalize()} (${project.path})" + } + client { + client() + } + data { + data() + } + server { + server() + } + } + mods { + "${mod_id}" { + sourceSet sourceSets.main + } + } +} + +sourceSets.main.resources { srcDir "src/generated/resources" } diff --git a/neoforge/src/main/resources/META-INF/accesstransformer.cfg b/neoforge/src/main/resources/META-INF/accesstransformer.cfg deleted file mode 100644 index e69de29..0000000 diff --git a/settings.gradle b/settings.gradle index 8bd4668..478ccb0 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,19 +1,29 @@ pluginManagement { repositories { - mavenLocal() - mavenCentral() gradlePluginPortal() - maven { - name = "Fabric" - url = "https://maven.fabricmc.net/" - } - maven { - name = "NeoForge" - url = "https://maven.neoforged.net/releases/" + mavenCentral() + exclusiveContent { + forRepository { + maven { + name = 'Fabric' + url = uri('https://maven.fabricmc.net') + } + } + filter { + includeGroup('net.fabricmc') + includeGroup('fabric-loom') + } } - maven { - name = "Sponge" - url = "https://repo.spongepowered.org/repository/maven-public/" + exclusiveContent { + forRepository { + maven { + name = 'Sponge' + url = uri('https://repo.spongepowered.org/repository/maven-public') + } + } + filter { + includeGroupAndSubgroups("org.spongepowered") + } } } }