From 19b122990cfbe6b9da9337ab35f4e2dd3f8b20e6 Mon Sep 17 00:00:00 2001 From: zontreck Date: Sat, 14 Sep 2024 19:44:43 -0700 Subject: [PATCH] Update build system fixes --- README.md | 2 +- build.gradle | 27 +++++++------------ gradle.properties | 4 +-- .../resources/META-INF/accesstransformer.cfg | 0 src/main/resources/META-INF/mods.toml | 2 +- 5 files changed, 14 insertions(+), 21 deletions(-) create mode 100644 src/main/resources/META-INF/accesstransformer.cfg diff --git a/README.md b/README.md index ae54ab5..c1e42bc 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,4 @@ If the mod becomes widely used, I will begin using deprecation notices. Compatibility ===== -1) Lightman's Currency \ No newline at end of file +1) Lightman's Currency (possible future compatibility) \ No newline at end of file diff --git a/build.gradle b/build.gradle index 7bcfef4..757a4f1 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,6 @@ plugins { id 'eclipse' id 'idea' id 'maven-publish' - id 'java-library' id 'net.minecraftforge.gradle' version '[6.0,6.2)' id 'org.parchmentmc.librarian.forgegradle' version '1.+' } @@ -23,6 +22,8 @@ java { configurations { provided compile.extendsFrom(provided) + implementation.extendsFrom(provided) + minecraftLibrary.extendsFrom(provided) } // Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17. @@ -43,12 +44,13 @@ minecraft { // // Use non-default mappings at your own risk. They may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: mapping_channel, version: "${parchment_version}-${minecraft_version}" + //mappings channel: mapping_channel, version: "${parchment_version}-${minecraft_version}" + mappings channel: mapping_channel, version: "${minecraft_version}" // When true, this property will have all Eclipse/IntelliJ IDEA run configurations run the "prepareX" task for the given run configuration before launching the game. // In most cases, it is not necessary to enable. - // enableEclipsePrepareRuns = true - // enableIdeaPrepareRuns = true + enableEclipsePrepareRuns = true + enableIdeaPrepareRuns = true // This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game. // It is REQUIRED to be set to true for this template to function. @@ -58,7 +60,7 @@ minecraft { // When true, this property will add the folder name of all declared run configurations to generated IDE run configurations. // The folder name can be set on a run configuration using the "folderName" property. // By default, the folder name of a run configuration is the name of the Gradle project containing it. - // generateRunFolders = true + generateRunFolders = true // This property enables access transformers for use in development. // They will be applied to the Minecraft artifact. @@ -66,7 +68,7 @@ minecraft { // However, it must be at "META-INF/accesstransformer.cfg" in the final mod jar to be loaded by Forge. // This default location is a best practice to automatically put the file in the right place in the final jar. // See https://docs.minecraftforge.net/en/latest/advanced/accesstransformers/ for more information. - // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') + accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. @@ -158,13 +160,7 @@ dependencies { minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" provided "dev.zontreck:LibAC:${libac}" - implementation "dev.zontreck:LibAC:${libac}" - minecraftLibrary "dev.zontreck:LibAC:${libac}" - - provided "dev.zontreck:EventsBus:${eventsbus}" - implementation "dev.zontreck:EventsBus:${eventsbus}" - minecraftLibrary "dev.zontreck:EventsBus:${eventsbus}" // Example mod dependency with JEI - using fg.deobf() ensures the dependency is remapped to your development mappings // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime @@ -201,7 +197,6 @@ tasks.named('processResources', ProcessResources).configure { } } - // Example for how to get properties into the manifest for reading at runtime. tasks.named('jar', Jar).configure { from { @@ -236,13 +231,12 @@ def MAVEN_USER = "AriasCreationsMavenUser" publishing { publications { - mavenJava(MavenPublication) { + register('mavenJava', MavenPublication) { artifact jar artifact sourcesJar artifact javadocJar } } - repositories { maven { url = "https://git.zontreck.com/api/packages/MinecraftMods/maven" @@ -256,7 +250,6 @@ publishing { } } - tasks.withType(JavaCompile).configureEach { options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index 4eaa58b..bb9fd01 100644 --- a/gradle.properties +++ b/gradle.properties @@ -32,14 +32,14 @@ loader_version_range=[43,) # # Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge. # Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started -mapping_channel=parchment +mapping_channel=official # The mapping version to query from the mapping channel. # This must match the format required by the mapping channel. parchment_version=2022.11.27 # luckperms_api_version=5.4 libac=1.5.33 -eventsbus=1.0.47 +eventsbus=1.0.48 ## Environment Properties diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg new file mode 100644 index 0000000..e69de29 diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 8cf3e73..a4c2119 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -11,7 +11,7 @@ loaderVersion="${loader_version_range}" #mandatory This is typically bumped ever # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. license="${mod_license}" # A URL to refer people to when problems occur with this mod -#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional +issueTrackerURL="https://git.zontreck.com/MinecraftMods/LibZontreck/issues" #optional # A list of mods - how many allowed here is determined by the individual mod loader [[mods]] #mandatory # The modid of the mod