diff --git a/Common/src/testmod/java/dev/upcraft/sparkweave/testmod/SparkweaveTestmod.java b/Common/src/testmod/java/dev/upcraft/sparkweave/testmod/SparkweaveTestmod.java index 871074d..92ac5a8 100644 --- a/Common/src/testmod/java/dev/upcraft/sparkweave/testmod/SparkweaveTestmod.java +++ b/Common/src/testmod/java/dev/upcraft/sparkweave/testmod/SparkweaveTestmod.java @@ -6,7 +6,7 @@ public class SparkweaveTestmod { - public static final String MODID = "sparkweave-testmod"; + public static final String MODID = "sparkweave_testmod"; public static void init() { var registryService = RegistryService.get(); diff --git a/Common/src/testmod/java/dev/upcraft/sparkweave/testmod/init/TestCreativeTabs.java b/Common/src/testmod/java/dev/upcraft/sparkweave/testmod/init/TestCreativeTabs.java index 2288a94..484efae 100644 --- a/Common/src/testmod/java/dev/upcraft/sparkweave/testmod/init/TestCreativeTabs.java +++ b/Common/src/testmod/java/dev/upcraft/sparkweave/testmod/init/TestCreativeTabs.java @@ -13,7 +13,7 @@ public class TestCreativeTabs { public static final RegistryHandler TABS = RegistryHandler.create(Registries.CREATIVE_MODE_TAB, SparkweaveTestmod.MODID); public static final RegistrySupplier ITEMS = TABS.register("items", () -> CreativeTabHelper.newBuilder() - .title(Component.translatable("itemGroup.sparkweave-testmod.items")) + .title(Component.translatable("itemGroup.sparkweave_testmod.items")) .icon(() -> TestItems.TEST_ITEM.get().getDefaultInstance()) .displayItems((itemDisplayParameters, output) -> CreativeTabHelper.addRegistryEntries(output, TestItems.ITEMS)) .build() diff --git a/Common/src/testmod/resources/assets/sparkweave-testmod/lang/en_us.json b/Common/src/testmod/resources/assets/sparkweave-testmod/lang/en_us.json deleted file mode 100644 index 8f8ef2a..0000000 --- a/Common/src/testmod/resources/assets/sparkweave-testmod/lang/en_us.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "itemGroup.sparkweave-testmod.items": "TestMod Items", - "item.sparkweave-testmod.test_item": "Test Item" -} diff --git a/Common/src/testmod/resources/assets/sparkweave_testmod/lang/en_us.json b/Common/src/testmod/resources/assets/sparkweave_testmod/lang/en_us.json new file mode 100644 index 0000000..ad5b6bb --- /dev/null +++ b/Common/src/testmod/resources/assets/sparkweave_testmod/lang/en_us.json @@ -0,0 +1,4 @@ +{ + "itemGroup.sparkweave_testmod.items": "TestMod Items", + "item.sparkweave_testmod.test_item": "Test Item" +} diff --git a/NeoForge/build.gradle b/NeoForge/build.gradle index 1679edb..e21cc5e 100644 --- a/NeoForge/build.gradle +++ b/NeoForge/build.gradle @@ -57,15 +57,14 @@ runs { systemProperty 'forge.logging.markers', 'REGISTRIES' systemProperty 'forge.logging.console.level', 'debug' - workingDirectory project.file('run') - - modSource project.sourceSets.main - dependencies { runtime(libs.appdirs.get()) } } + client { + modSource project.sourceSets.main + workingDirectory project.file('run') systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id if (project.hasProperty('mc_uuid')) { @@ -82,11 +81,35 @@ runs { } server { + modSource project.sourceSets.main + workingDirectory project.file('run') + programArguments.add('nogui') systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id } + testmodClient { + configure runTypes.client + modSource project.sourceSets.testmod + workingDirectory project.file('run/testmod') + systemProperty 'neoforge.enabledGameTestNamespaces', "${project.mod_id}_testmod" + + if (project.hasProperty('mc_uuid')) { + programArguments.add("--uuid=${project.findProperty('mc_uuid')}") + } + + if (project.hasProperty('mc_username')) { + programArguments.add("--username=${project.findProperty('mc_username')}") + } + + if (project.hasProperty('mc_java_agent_path')) { + jvmArgument("-javaagent:${project.findProperty('mc_java_agent_path')}") + } + } + data { + modSource project.sourceSets.main + workingDirectory project.file('run') // this must be strings ONLY, or neogradle will not generate run configs at all! programArguments.addAll('--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').absolutePath, '--existing', file('src/main/resources/').absolutePath) } diff --git a/NeoForge/src/testmod/java/dev/upcraft/sparkweave/testmod/neoforge/entrypoint/Main.java b/NeoForge/src/testmod/java/dev/upcraft/sparkweave/testmod/neoforge/entrypoint/Main.java new file mode 100644 index 0000000..b46d902 --- /dev/null +++ b/NeoForge/src/testmod/java/dev/upcraft/sparkweave/testmod/neoforge/entrypoint/Main.java @@ -0,0 +1,12 @@ +package dev.upcraft.sparkweave.testmod.neoforge.entrypoint; + +import dev.upcraft.sparkweave.testmod.SparkweaveTestmod; +import net.neoforged.fml.common.Mod; + +@Mod(SparkweaveTestmod.MODID) +public class Main { + + public Main() { + SparkweaveTestmod.init(); + } +} diff --git a/NeoForge/src/testmod/java/dev/upcraft/sparkweave/testmod/neoforge/package-info.java b/NeoForge/src/testmod/java/dev/upcraft/sparkweave/testmod/neoforge/package-info.java new file mode 100644 index 0000000..a11c198 --- /dev/null +++ b/NeoForge/src/testmod/java/dev/upcraft/sparkweave/testmod/neoforge/package-info.java @@ -0,0 +1,5 @@ +@Mod.Context(SparkweaveTestmod.MODID) +package dev.upcraft.sparkweave.testmod.neoforge; + +import dev.upcraft.sparkweave.api.annotation.Mod; +import dev.upcraft.sparkweave.testmod.SparkweaveTestmod; diff --git a/NeoForge/src/testmod/resources/META-INF/mods.toml b/NeoForge/src/testmod/resources/META-INF/mods.toml new file mode 100644 index 0000000..0fa6f62 --- /dev/null +++ b/NeoForge/src/testmod/resources/META-INF/mods.toml @@ -0,0 +1,30 @@ +modLoader = "javafml" #mandatory +loaderVersion = "*" #mandatory +license = "${license_url}" # Review your options at https://choosealicense.com/. +issueTrackerURL = "${issues_url}" #optional +sourcesUrl = "${sources_url}" # custom property that we parse ourselves + +[[mods]] #mandatory +modId = "${mod_id}_testmod" #mandatory +version = "${version}" #mandatory +displayName = "${mod_display_name} Testmod" #mandatory +displayURL = "${homepage_url}" #optional (displayed in the mod UI) +logoFile = "assets/${mod_id}_testmod/icon.png" #optional +#credits = "" #optional +authors = "Up" #optional +description = '''Testmod for ${mod_display_name}''' #mandatory (Supports multiline text) + +# https://docs.neoforged.net/docs/gettingstarted/modfiles#dependency-configurations +[dependencies] +"${mod_id}_testmod" = [ + { modId = "neoforge", mandatory = true, versionRange = "*", ordering = "NONE", side = "BOTH", mc-publish = { ignore = true } }, + { modId = "minecraft", mandatory = true, versionRange = "[${minecraft_version}]", ordering = "NONE", side = "BOTH" }, + { modid = "${mod_id}", mandatory = true, versionRange = "[${version}]" }, + { modId = "resourcefulconfig", mandatory = true, versionRange = "*", ordering = "NONE", side = "BOTH", mc-publish = { curseforge = "714059", modrinth = "M1953qlQ" } }, +] + +# Features are specific properties of the game environment, that you may want to declare you require. This example declares +# that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't +# stop your mod loading on the server for example. +#[features.${mod_id}_testmod] +#openGLVersion="[3.2,)" diff --git a/NeoForge/src/testmod/resources/pack.mcmeta b/NeoForge/src/testmod/resources/pack.mcmeta new file mode 100644 index 0000000..fa3dede --- /dev/null +++ b/NeoForge/src/testmod/resources/pack.mcmeta @@ -0,0 +1,8 @@ +{ + "pack": { + "description": { + "text": "${mod_display_name} TestMod resources" + }, + "pack_format": 15 + } +} diff --git a/Quilt/build.gradle b/Quilt/build.gradle index a774865..54faf4e 100644 --- a/Quilt/build.gradle +++ b/Quilt/build.gradle @@ -47,7 +47,7 @@ loom { sourceSet("main") } - "${mod_id}-testmod" { + "${mod_id}_testmod" { sourceSet("testmod") } } diff --git a/Quilt/src/testmod/resources/quilt.mod.json b/Quilt/src/testmod/resources/quilt.mod.json index af8a836..ed6a03d 100644 --- a/Quilt/src/testmod/resources/quilt.mod.json +++ b/Quilt/src/testmod/resources/quilt.mod.json @@ -2,7 +2,7 @@ "schema_version": 1, "quilt_loader": { "group": "${maven_group_id}", - "id": "${mod_id}-testmod", + "id": "${mod_id}_testmod", "version": "${version}", "metadata": { "name": "${mod_display_name} TestMod", @@ -20,7 +20,7 @@ "name": "Custom License", "url": "${license_url}" }, - "icon": "assets/${mod_id}-testmod/icon.png" + "icon": "assets/${mod_id}_testmod/icon.png" }, "entrypoints": { "init": [ @@ -39,6 +39,10 @@ "id": "quilt_loader", "versions": ">=${quilt_loader_version}" }, + { + "id": "${mod_id}", + "versions": "=${version}" + }, { "id": "quilted_fabric_api", "mc-publish": {