From 413d25c483cc502615b59a86fc2fcc25980dfa8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Gama=20Santos?= Date: Fri, 1 Sep 2023 16:47:45 -0300 Subject: [PATCH 1/3] Changed mod options - Mod id from `examplemod` to `example_mod` - Changed mod author - Changed mod name --- common/src/main/java/com/example/examplemod/Constants.java | 4 ++-- .../{examplemod.mixins.json => example_mod.mixins.json} | 2 +- ...od.fabric.mixins.json => example_mod.fabric.mixins.json} | 6 +++--- ...emod.forge.mixins.json => example_mod.forge.mixins.json} | 2 +- gradle.properties | 6 +++--- ...amplemod.neo.mixins.json => example_mod.neo.mixins.json} | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) rename common/src/main/resources/{examplemod.mixins.json => example_mod.mixins.json} (85%) rename fabric/src/main/resources/{examplemod.fabric.mixins.json => example_mod.fabric.mixins.json} (76%) rename forge/src/main/resources/{examplemod.forge.mixins.json => example_mod.forge.mixins.json} (85%) rename neo/src/main/resources/{examplemod.neo.mixins.json => example_mod.neo.mixins.json} (85%) diff --git a/common/src/main/java/com/example/examplemod/Constants.java b/common/src/main/java/com/example/examplemod/Constants.java index 64792b2..05fdf0d 100644 --- a/common/src/main/java/com/example/examplemod/Constants.java +++ b/common/src/main/java/com/example/examplemod/Constants.java @@ -5,7 +5,7 @@ public class Constants { - public static final String MOD_ID = "examplemod"; - public static final String MOD_NAME = "Multi Loader Template"; + public static final String MOD_ID = "example_mod"; + public static final String MOD_NAME = "Example mod"; public static final Logger LOG = LoggerFactory.getLogger(MOD_NAME); } \ No newline at end of file diff --git a/common/src/main/resources/examplemod.mixins.json b/common/src/main/resources/example_mod.mixins.json similarity index 85% rename from common/src/main/resources/examplemod.mixins.json rename to common/src/main/resources/example_mod.mixins.json index 3bc0b93..15fc40f 100644 --- a/common/src/main/resources/examplemod.mixins.json +++ b/common/src/main/resources/example_mod.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "com.example.examplemod.mixin", + "package": "${group}.mixin", "refmap": "${mod_id}.refmap.json", "compatibilityLevel": "JAVA_17", "mixins": [ diff --git a/fabric/src/main/resources/examplemod.fabric.mixins.json b/fabric/src/main/resources/example_mod.fabric.mixins.json similarity index 76% rename from fabric/src/main/resources/examplemod.fabric.mixins.json rename to fabric/src/main/resources/example_mod.fabric.mixins.json index ad174ea..285d85a 100644 --- a/fabric/src/main/resources/examplemod.fabric.mixins.json +++ b/fabric/src/main/resources/example_mod.fabric.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "com.example.examplemod.mixin", + "package": "${group}.mixin", "refmap": "${mod_id}.refmap.json", "compatibilityLevel": "JAVA_17", "mixins": [ @@ -12,7 +12,7 @@ "server": [ ], "injectors": { - "defaultRequire": 1 + "defaultRequire": 1 } - } +} diff --git a/forge/src/main/resources/examplemod.forge.mixins.json b/forge/src/main/resources/example_mod.forge.mixins.json similarity index 85% rename from forge/src/main/resources/examplemod.forge.mixins.json rename to forge/src/main/resources/example_mod.forge.mixins.json index 95882ac..e815d36 100644 --- a/forge/src/main/resources/examplemod.forge.mixins.json +++ b/forge/src/main/resources/example_mod.forge.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "com.example.examplemod.mixin", + "package": "${group}.mixin", "refmap": "${mod_id}.refmap.json", "compatibilityLevel": "JAVA_17", "mixins": [ diff --git a/gradle.properties b/gradle.properties index 57c2723..d850ce1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,9 +19,9 @@ fabric_version=0.86.1+1.20.1 fabric_loader_version=0.14.21 # Mod options -mod_name=ExampleMod -mod_author=Gaz -mod_id=examplemod +mod_name=Example Mod +mod_author=Author +mod_id=example_mod # Publishing curseforge_id=123456 diff --git a/neo/src/main/resources/examplemod.neo.mixins.json b/neo/src/main/resources/example_mod.neo.mixins.json similarity index 85% rename from neo/src/main/resources/examplemod.neo.mixins.json rename to neo/src/main/resources/example_mod.neo.mixins.json index 95882ac..e815d36 100644 --- a/neo/src/main/resources/examplemod.neo.mixins.json +++ b/neo/src/main/resources/example_mod.neo.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "com.example.examplemod.mixin", + "package": "${group}.mixin", "refmap": "${mod_id}.refmap.json", "compatibilityLevel": "JAVA_17", "mixins": [ From b19aaa383b51bbcf1448f77a61da99af39b0590d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Gama=20Santos?= Date: Fri, 1 Sep 2023 17:21:10 -0300 Subject: [PATCH 2/3] Mod files uses more project properties Properties added to gradle.properties to be used in mod files --- fabric/src/main/resources/fabric.mod.json | 26 +++++++----- forge/src/main/resources/META-INF/mods.toml | 18 ++++----- gradle.properties | 45 +++++++++++++++------ neo/src/main/resources/META-INF/mods.toml | 18 ++++----- 4 files changed, 65 insertions(+), 42 deletions(-) diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 3251475..8da9313 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -3,34 +3,38 @@ "id": "${mod_id}", "version": "${mod_version}", "name": "${mod_name}", - "description": "This is an example description! Tell everyone what your mod is about!", + "description": "${mod_description}", "authors": [ "${mod_author}" ], "contact": { - "homepage": "https://fabricmc.net/", - "sources": "https://github.com/FabricMC/fabric-example-mod" + "homepage": "${homepage}", + "sources": "${source}", + "issues": "${source}/issues", + "discord": "${discord}", + "curseforge": "${curseforge_page}", + "modrinth": "${modrinth_page}" }, - "license": "${project_license}", - "icon": "assets/modid/icon.png", + "license": "${license}", + "icon": "assets/${mod_id}/${mod_icon}", "environment": "*", "entrypoints": { "main": [ - "com.example.examplemod.ExampleMod" + "${group}.${fabric_entrypoint_main}" ] }, "mixins": [ - "examplemod.mixins.json", - "examplemod.fabric.mixins.json" + "${mod_id}.mixins.json", + "${mod_id}.fabric.mixins.json" ], "depends": { - "fabricloader": ">=0.14", + "fabricloader": "${fabric_loader_version_range}", "fabric": "*", - "minecraft": ">=1.20.1", + "minecraft": "${fabric_minecraft_version_range}", "java": ">=17" }, "suggests": { - "another-mod": "*" + "modmenu": "*" } } \ No newline at end of file diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 57a795a..bb0bf25 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,28 +1,28 @@ modLoader = "javafml" #mandatory -loaderVersion = "[46,)" #mandatory This is typically bumped every Minecraft version by Forge. See https://files.minecraftforge.net/ for a list of versions. -license = "${project_license}" # Review your options at https://choosealicense.com/. -#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional +loaderVersion = "${forge_loader_version_range}" #mandatory This is typically bumped every Minecraft version by Forge. See https://files.minecraftforge.net/ for a list of versions. +license = "${license}" # Review your options at https://choosealicense.com/. +issueTrackerURL="${issues}" #optional [[mods]] #mandatory modId = "${mod_id}" #mandatory version = "${mod_version}" #mandatory displayName = "${mod_name}" #mandatory #updateJSONURL="https://change.me.example.invalid/updates.json" #optional (see https://mcforge.readthedocs.io/en/latest/gettingstarted/autoupdate/) -#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional (displayed in the mod UI) -logoFile = "multiloader.png" #optional (needs to be in the root of your mod jar (root of your 'resources' folder)) -credits = "Thanks for this example mod goes to Java" #optional +displayURL = "${homepage}" #optional (displayed in the mod UI) +logoFile = "${mod_logo}" #optional (needs to be in the root of your mod jar (root of your 'resources' folder)) +credits = "${mod_credits}" #optional authors = "${mod_author}" #optional description = ''' -This is a long form description of the mod. You can write whatever you want here +${mod_description} ''' #mandatory (Supports multiline text) [[dependencies.${mod_id}]] #optional modId = "forge" #mandatory mandatory = true #mandatory -versionRange = "[46,)" #mandatory +versionRange = "${forge_version_range}" #mandatory ordering = "NONE" # The order that this dependency should load in relation to your mod, required to be either 'BEFORE' or 'AFTER' if the dependency is not mandatory side = "BOTH" # Side this dependency is applied on - 'BOTH', 'CLIENT' or 'SERVER' [[dependencies.${mod_id}]] modId = "minecraft" mandatory = true -versionRange = "[1.20,1.21)" +versionRange = "${forge_minecraft_version_range}" ordering = "NONE" side = "BOTH" diff --git a/gradle.properties b/gradle.properties index d850ce1..302fc35 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,27 +1,45 @@ -fabric.loom.dontRemap=true - # Project -mod_version=1.0.0 group=com.example.examplemod +license=C0-1.0 + +# Mod options +mod_version=1.0.0 +mod_id=example_mod +mod_name=Example Mod +mod_author=Author +mod_description=Just An Example Mod\nThis is a new line! +mod_credits=Thanks for this example mod goes to Java +mod_icon=icon.png +mod_logo=icon.png # Common minecraft_version=1.20.1 -project_license=C0-1.0 + +# Fabric +# https://fabricmc.net/develop +# https://fabricmc.net/wiki/documentation:fabric_mod_json_spec +fabric_version=0.86.1+1.20.1 +fabric_loader_version=0.14.21 +fabric_loader_version_range=>=0.14 +fabric_minecraft_version_range=>=1.20.1 +fabric_entrypoint_main=ExampleMod +# if needed, add "client": [ "${group}.${fabric_entrypoint_client}" ] to fabric.mod.json +#fabric_entrypoint_client=client.ExampleModClient +# if needed, add "server": [ "${group}.${fabric_entrypoint_server}" ] to fabric.mod.json +#fabric_entrypoint_server=server.ExampleModServer # Forge +# https://files.minecraftforge.net/ forge_version=47.1.5 +forge_loader_version_range=[46,) +forge_version_range=[46,) +forge_minecraft_version_range=[1.20,1.21) # Neo neo_version=47.1.62 - -# Fabric -fabric_version=0.86.1+1.20.1 -fabric_loader_version=0.14.21 - -# Mod options -mod_name=Example Mod -mod_author=Author -mod_id=example_mod +neo_loader_version_range=[47,) +neo_version_range=[47.1,) +neo_minecraft_version_range=[1.20,1.21) # Publishing curseforge_id=123456 @@ -31,6 +49,7 @@ maven_url=https://maven.example.com/ # Other mixin_version=0.7.+ +fabric.loom.dontRemap=true # Gradle org.gradle.jvmargs=-Xmx3G diff --git a/neo/src/main/resources/META-INF/mods.toml b/neo/src/main/resources/META-INF/mods.toml index 31404ae..1d5202b 100644 --- a/neo/src/main/resources/META-INF/mods.toml +++ b/neo/src/main/resources/META-INF/mods.toml @@ -6,12 +6,12 @@ # The name of the mod loader type to load - for regular FML @Mod mods it should be javafml modLoader="javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the the FML version. This is currently 47. -loaderVersion="[47,)" #mandatory +loaderVersion="${neo_loader_version_range}" #mandatory # The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. # Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. -license="${project_license}" +license="${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="${issues}" #optional # A list of mods - how many allowed here is determined by the individual mod loader [[mods]] #mandatory # The modid of the mod @@ -23,11 +23,11 @@ displayName="${mod_name}" #mandatory # A URL to query for updates for this mod. See the JSON update specification https://docs.neoforged.net/docs/misc/updatechecker/ #updateJSONURL="https://change.me.example.invalid/updates.json" #optional # A URL for the "homepage" for this mod, displayed in the mod UI -#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional +displayURL = "${homepage}" #optional # A file name (in the root of the mod JAR) containing a logo for display -logoFile = "multiloader.png" #optional +logoFile = "${mod_logo}" #optional # A text field displayed in the mod UI -#credits="" #optional +credits = "${mod_credits}" #optional # A text field displayed in the mod UI authors="${mod_author}" #optional # Display Test controls the display for your mod in the server connection screen @@ -40,7 +40,7 @@ authors="${mod_author}" #optional # The description text for the mod (multi line!) (#mandatory) description=''' -This is a long form description of the mod. You can write whatever you want here +${mod_description} ''' # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. [[dependencies.${mod_id}]] #optional @@ -49,7 +49,7 @@ This is a long form description of the mod. You can write whatever you want here # Does this dependency have to exist - if not, ordering below must be specified mandatory=true #mandatory # The version range of the dependency - versionRange="[47.1,)" #mandatory + versionRange="${neo_version_range}" #mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory # BEFORE - This mod is loaded BEFORE the dependency # AFTER - This mod is loaded AFTER the dependency @@ -61,7 +61,7 @@ This is a long form description of the mod. You can write whatever you want here modId="minecraft" mandatory=true # This version range declares a minimum of the current minecraft version up to but not including the next major version - versionRange="[1.20,1.21)" + versionRange="${neo_minecraft_version_range}" ordering="NONE" side="BOTH" From 0d42b0b68c0cc7712388d5cce0c32aa4db4cdb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Gama=20Santos?= Date: Fri, 1 Sep 2023 18:25:26 -0300 Subject: [PATCH 3/3] Added pages Required links to pages added --- fabric/src/main/resources/fabric.mod.json | 2 +- gradle.properties | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 8da9313..e85fea6 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -10,7 +10,7 @@ "contact": { "homepage": "${homepage}", "sources": "${source}", - "issues": "${source}/issues", + "issues": "${issues}", "discord": "${discord}", "curseforge": "${curseforge_page}", "modrinth": "${modrinth_page}" diff --git a/gradle.properties b/gradle.properties index 302fc35..4aec250 100644 --- a/gradle.properties +++ b/gradle.properties @@ -41,6 +41,14 @@ neo_loader_version_range=[47,) neo_version_range=[47.1,) neo_minecraft_version_range=[1.20,1.21) +# Pages +homepage=https://example.com +source=https://example.com/source +issues=https://example.com/source/issues +curseforge_page=https://example.com/curseforge +modrinth_page=https://example.com/modrinth +discord=https://example.com/discord + # Publishing curseforge_id=123456 modrinth_id=abcdefg