diff --git a/build.gradle b/build.gradle index ab6affc..c7cfbd6 100644 --- a/build.gradle +++ b/build.gradle @@ -66,6 +66,23 @@ minecraft { } } } + + data { + workingDirectory project.file('run') + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + + // https://github.com/SpongePowered/Mixin/issues/462#issuecomment-791370319 + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" + + args '--mod', 'mousetweaks', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') + mods { + mousetweaks { + source sourceSets.main + } + } + } } } diff --git a/src/main/java/yalter/mousetweaks/forge/MouseTweaksForge.java b/src/main/java/yalter/mousetweaks/forge/MouseTweaksForge.java index dad85f0..ff7a03a 100644 --- a/src/main/java/yalter/mousetweaks/forge/MouseTweaksForge.java +++ b/src/main/java/yalter/mousetweaks/forge/MouseTweaksForge.java @@ -12,6 +12,7 @@ import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.loading.FMLEnvironment; +import net.minecraftforge.fml.loading.FMLLoader; import yalter.mousetweaks.Constants; import yalter.mousetweaks.Logger; import yalter.mousetweaks.Main; @@ -26,6 +27,11 @@ public MouseTweaksForge() { return; } + if (FMLLoader.getLaunchHandler().isData()) { + Logger.Log("Disabled because running data generation."); + return; + } + Main.initialize(); MinecraftForge.EVENT_BUS.register(this);