From e5be87682aa397d7ee8bf13de22a83125b03fbdc Mon Sep 17 00:00:00 2001 From: BlayTheNinth <1933180+BlayTheNinth@users.noreply.github.com> Date: Mon, 12 Aug 2024 21:31:28 +0200 Subject: [PATCH] build: Update to ModDevGradle, bump to 1.21.1 --- .github/workflows/publish-release.yml | 1 - CHANGELOG.md | 2 +- build.gradle | 6 +- .../src/main/groovy/multiloader-common.gradle | 13 ++++ common/build.gradle | 17 +++-- fabric/build.gradle | 5 +- forge/build.gradle | 2 +- gradle.properties | 19 +++-- gradle/wrapper/gradle-wrapper.properties | 2 +- neoforge/build.gradle | 73 ++++++++----------- repositories.gradle | 1 + settings.gradle | 18 +---- 12 files changed, 78 insertions(+), 81 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index e3ba029..38ac5aa 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -56,7 +56,6 @@ jobs: site: curseforge - loader: common site: modrinth - fail-fast: false steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f7ec53..2b42c9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1 @@ -- Fixed "Tried to load invalid item: 'No key id in MapLike[{}]'" when accessing an empty trash slot \ No newline at end of file +- Updated to Minecraft 1.21.1 \ No newline at end of file diff --git a/build.gradle b/build.gradle index 40bf589..98c4692 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,6 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' apply(false) - // id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' apply(false) // this causes ForgeGradle to fail in reobf - id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" // this is required for VanillaGradle and NeoForge to exist in harmony - id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' apply(false) + id 'fabric-loom' version '1.7-SNAPSHOT' apply(false) + id 'net.neoforged.moddev' version '0.1.110' apply(false) id 'net.darkhax.curseforgegradle' version '1.1.18' apply(false) id "com.modrinth.minotaur" version "2.+" apply(false) } diff --git a/buildSrc/src/main/groovy/multiloader-common.gradle b/buildSrc/src/main/groovy/multiloader-common.gradle index 28ed5bf..ab1221e 100644 --- a/buildSrc/src/main/groovy/multiloader-common.gradle +++ b/buildSrc/src/main/groovy/multiloader-common.gradle @@ -27,6 +27,19 @@ repositories { filter { includeGroupAndSubgroups("org.spongepowered") } } maven { url "https://maven.twelveiterations.com/repository/maven-public/" } + exclusiveContent { + forRepositories( + maven { + name = 'ParchmentMC' + url = 'https://maven.parchmentmc.org/' + }, + maven { + name = "NeoForge" + url = 'https://maven.neoforged.net/releases' + } + ) + filter { includeGroup('org.parchmentmc.data') } + } } dependencies { diff --git a/common/build.gradle b/common/build.gradle index f0d5fe8..762beb3 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,17 +1,22 @@ plugins { id 'multiloader-common' - id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' + id 'net.neoforged.moddev' } base { archivesName = "${mod_id}-common-${minecraft_version}" } -minecraft { - version(minecraft_version) - def aw = file("src/main/resources/${mod_id}.accesswidener") - if (aw.exists()) { - accessWideners(aw) +neoForge { + neoFormVersion = neo_form_version + // Automatically enable AccessTransformers if the file exists + def at = file('src/main/resources/META-INF/accesstransformer.cfg') + if (at.exists()) { + accessTransformers.add(at.absolutePath) + } + parchment { + minecraftVersion = parchment_minecraft + mappingsVersion = parchment_version } } diff --git a/fabric/build.gradle b/fabric/build.gradle index 965b2b7..ec56b2c 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -7,7 +7,10 @@ plugins { dependencies { minecraft "com.mojang:minecraft:${minecraft_version}" - mappings loom.officialMojangMappings() + mappings loom.layered { + officialMojangMappings() + parchment("org.parchmentmc.data:parchment-${parchment_minecraft}:${parchment_version}@zip") + } modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}" } diff --git a/forge/build.gradle b/forge/build.gradle index d7fd24e..962dc7c 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,7 +1,7 @@ plugins { id 'multiloader-loader' id 'net.minecraftforge.gradle' version '[6.0.25,6.2)' - id 'org.spongepowered.mixin' + id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' id 'net.darkhax.curseforgegradle' id "com.modrinth.minotaur" } diff --git a/gradle.properties b/gradle.properties index bb70243..5fe3f8f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ mod_id = trashslot mod_name = TrashSlot mod_main=TrashSlot description=Adds a trash slot to the inventory screen that allows deletion of unwanted items. -version = 21.0.2 +version = 21.1.0 group = net.blay09.mods homepage=https://mods.twelveiterations.com/mc/trashslot sources=https://github.com/TwelveIterationMods/TrashSlot @@ -18,28 +18,28 @@ modrinth_release_type = release modrinth_project_id = vRYk0bv7 # Minecraft -minecraft_version = 1.21 -minecraft_versions = 1.21 +minecraft_version = 1.21.1 +minecraft_versions = 1.21,1.21.1 minecraft_version_range = [1.21,) pack_format_number = 18 java_version = 21 # Balm -balm_version = 21.0.10-SNAPSHOT +balm_version = 21.0.14-SNAPSHOT balm_version_range = [21.0.0,) # Forge -forge_version = 51.0.0 +forge_version = 52.0.2 forge_version_range = [51,) forge_loader_version_range = [51,) # NeoForge -neoforge_version = 21.0.0-beta +neoforge_version = 21.1.8 neoforge_version_range = [21-beta,) neoforge_loader_version_range = [1,) # Fabric -fabric_version = 0.100.1+1.21 +fabric_version = 0.102.1+1.21.1 fabric_loader_version = 0.15.11 # Dependencies @@ -54,4 +54,7 @@ org.gradle.jvmargs=-Xmx3G org.gradle.daemon=false mod_author = BlayTheNinth credits = BlayTheNinth -kuma_version = [21.0,22) \ No newline at end of file +kuma_version = [21.0,22) +neo_form_version = 1.21.1-20240808.144430 +parchment_minecraft = 1.21 +parchment_version = 2024.06.23 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 48c0a02..0d18421 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 8c9d5a9..be6ce2e 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -1,6 +1,6 @@ plugins { id 'multiloader-loader' - id 'net.neoforged.gradle.userdev' version '7.0.142' + id 'net.neoforged.moddev' id 'net.darkhax.curseforgegradle' id "com.modrinth.minotaur" } @@ -9,60 +9,47 @@ base { archivesName = "${mod_id}-neoforge-${minecraft_version}" } -def at = file('src/main/resources/META-INF/accesstransformer.cfg') -if (at.exists()) { - minecraft.accessTransformers.file at -} - -runs { - configureEach { - // Recommended logging data for a userdev environment - // The markers can be added/remove as needed separated by commas. - // "SCAN": For mods scan. - // "REGISTRIES": For firing of registry events. - // "REGISTRYDUMP": For getting the contents of all registries. - systemProperty 'forge.logging.markers', 'REGISTRIES' - - // Recommended logging level for the console - // You can set various levels here. - // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels - systemProperty 'forge.logging.console.level', 'debug' - - modSource project.sourceSets.main +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.add(at.absolutePath) } - client { - // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. - systemProperty 'forge.enabledGameTestNamespaces', project.mod_id + parchment { + minecraftVersion = parchment_minecraft + mappingsVersion = parchment_version } - server { - systemProperty 'forge.enabledGameTestNamespaces', project.mod_id - programArgument '--nogui' - } + runs { + configureEach { + systemProperty('neoforge.enabledGameTestNamespaces', mod_id) + ideName = "NeoForge ${it.name.capitalize()} (${project.path})" + } - // This run config launches GameTestServer and runs all registered gametests, then exits. - // By default, the server will crash when no gametests are provided. - // The gametest system is also enabled by default for other run configs under the /test command. - gameTestServer { - systemProperty 'forge.enabledGameTestNamespaces', project.mod_id - } + client { + client() + } + + server { + server() + } - data { - // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it - // workingDirectory project.file('run-data') + data { + data() + } + } - // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. - programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() + mods { + "${mod_id}" { + sourceSet sourceSets.main + } } } sourceSets.main.resources { srcDir 'src/generated/resources' } -dependencies { - implementation "net.neoforged:neoforge:${neoforge_version}" -} - apply from: rootProject.file('repositories.gradle') apply from: 'dependencies.gradle' diff --git a/repositories.gradle b/repositories.gradle index 2f83bb0..0fa21f4 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -41,6 +41,7 @@ repositories { url = "https://jm.gserv.me/repository/maven-public/" content { includeGroup "info.journeymap" + includeGroup "mysticdrew" } } diff --git a/settings.gradle b/settings.gradle index 8833200..bce959e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,13 +17,12 @@ pluginManagement { exclusiveContent { forRepository { maven { - name = 'NeoForge' - url = uri("https://maven.neoforged.net/releases") + name = 'Sponge' + url = uri('https://repo.spongepowered.org/repository/maven-public') } } filter { - includeGroupAndSubgroups("net.neoforged") - includeGroup("codechicken") + includeGroupAndSubgroups("org.spongepowered") } } exclusiveContent { @@ -37,17 +36,6 @@ pluginManagement { includeGroupAndSubgroups("net.minecraftforge") } } - exclusiveContent { - forRepository { - maven { - name = 'Sponge Snapshots' - url = uri("https://repo.spongepowered.org/repository/maven-public") - } - } - filter { - includeGroupAndSubgroups("org.spongepowered") - } - } } }