From f1342486d7a262edf7adc2a20eea49b6f7d6d9a5 Mon Sep 17 00:00:00 2001 From: NegaNote Date: Wed, 27 Aug 2025 13:39:15 -0400 Subject: [PATCH] fix the addon template and add a dummy mixin --- build.gradle | 11 +++++++---- .../com/example/examplemod/ExampleGTAddon.java | 4 ++-- .../java/com/example/examplemod/ExampleMod.java | 3 ++- .../com/example/examplemod/mixin/DummyMixin.java | 14 ++++++++++++++ src/main/resources/examplemod.mixins.json | 1 + 5 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/example/examplemod/mixin/DummyMixin.java diff --git a/build.gradle b/build.gradle index c74c92f..862bd6f 100644 --- a/build.gradle +++ b/build.gradle @@ -95,21 +95,22 @@ legacyForge { // You can set various levels here. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels logLevel = org.slf4j.event.Level.DEBUG - sourceSet = sourceSets.main } client { client() + sourceSet = sourceSets.main programArguments.addAll('--refresh-dependencies') systemProperty('forge.enabledGameTestNamespaces', project.mod_id) } server { server() + sourceSet = sourceSets.main systemProperty('forge.enabledGameTestNamespaces', project.mod_id) programArguments.addAll('--nogui', '--world', 'world-extra') } data { data() - + sourceSet = sourceSets.main // 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()) programArguments.addAll('--existing-mod', 'gtceu') @@ -151,15 +152,16 @@ dependencies { modImplementation("com.gregtechceu.gtceu:gtceu-${minecraft_version}:${gtceu_version}:slim") { transitive = false } modImplementation("com.lowdragmc.ldlib:ldlib-forge-${minecraft_version}:${ldlib_version}") { transitive = false } modImplementation("com.tterrag.registrate:Registrate:${registrate_version}") - modRuntimeOnly("dev.toma.configuration:configuration-forge-${minecraft_version}:${configuration_version}") + modImplementation("dev.toma.configuration:configuration-forge-${minecraft_version}:${configuration_version}") // lombok compileOnly 'org.projectlombok:lombok:1.18.24' annotationProcessor 'org.projectlombok:lombok:1.18.24' } +// See com.example.examplemod.mixin.DummyMixin for information about mixins mixin { - add sourceSets.main, "${mod_id}.refmap.json" + add sourceSets.main, "mixins.${mod_id}.refmap.json" config "${mod_id}.mixins.json" } @@ -190,4 +192,5 @@ tasks.withType(JavaCompile).configureEach { // If Javadoc is generated, this must be specified in that task too. options.encoding = "UTF-8" options.release.set(17) + options.compilerArgs << "-Aquiet=true" // Suppress mixin notes } \ No newline at end of file diff --git a/src/main/java/com/example/examplemod/ExampleGTAddon.java b/src/main/java/com/example/examplemod/ExampleGTAddon.java index 961f728..6ca4877 100644 --- a/src/main/java/com/example/examplemod/ExampleGTAddon.java +++ b/src/main/java/com/example/examplemod/ExampleGTAddon.java @@ -39,9 +39,9 @@ public void addRecipes(Consumer provider) { // KubeJS WILL REMOVE YOUR RECIPES IF THESE ARE NOT REGISTERED. /* * public static final ContentJS PRESSURE_IN = new ContentJS<>(NumberComponent.ANY_DOUBLE, - * GregitasRecipeCapabilities.PRESSURE, false); + * CustomRecipeCapabilities.PRESSURE, false); * public static final ContentJS PRESSURE_OUT = new ContentJS<>(NumberComponent.ANY_DOUBLE, - * GregitasRecipeCapabilities.PRESSURE, true); + * CustomRecipeCapabilities.PRESSURE, true); * * @Override * public void registerRecipeKeys(KJSRecipeKeyEvent event) { diff --git a/src/main/java/com/example/examplemod/ExampleMod.java b/src/main/java/com/example/examplemod/ExampleMod.java index cd78e05..4173ebb 100644 --- a/src/main/java/com/example/examplemod/ExampleMod.java +++ b/src/main/java/com/example/examplemod/ExampleMod.java @@ -23,6 +23,7 @@ import org.apache.logging.log4j.Logger; @Mod(ExampleMod.MOD_ID) +@SuppressWarnings("removal") public class ExampleMod { public static final String MOD_ID = "examplemod"; @@ -113,7 +114,7 @@ private void registerRecipeTypes(GTCEuAPI.RegisterEvent