Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod files using more project properties #1

Open
wants to merge 3 commits into
base: 1.20
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/src/main/java/com/example/examplemod/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -12,7 +12,7 @@
"server": [
],
"injectors": {
"defaultRequire": 1
"defaultRequire": 1
}
}
}

26 changes: 15 additions & 11 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "${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": "*"
}
}

18 changes: 9 additions & 9 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
51 changes: 39 additions & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,27 +1,53 @@
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
neo_loader_version_range=[47,)
neo_version_range=[47.1,)
neo_minecraft_version_range=[1.20,1.21)

# Fabric
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
# 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
Expand All @@ -31,6 +57,7 @@ maven_url=https://maven.example.com/

# Other
mixin_version=0.7.+
fabric.loom.dontRemap=true

# Gradle
org.gradle.jvmargs=-Xmx3G
Expand Down
18 changes: 9 additions & 9 deletions neo/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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"

Expand Down
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down