From c3ea844376655f2c16e7b581e5df3826e65f13c8 Mon Sep 17 00:00:00 2001 From: Johann Bernhardt Date: Sun, 7 Nov 2021 01:50:30 +0100 Subject: [PATCH] Added support for legagy core mods. Yet untested --- build.gradle | 14 +++++++++++--- gradle.properties | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 8f91bd8..80a6cc3 100644 --- a/build.gradle +++ b/build.gradle @@ -155,10 +155,14 @@ shadowJar { manifestAttributes += ["FMLCorePluginContainsFMLMod": true] } - if(accessTransformersFile.isEmpty() == false) { + if(accessTransformersFile) { manifestAttributes += ["FMLAT" : accessTransformersFile.toString()] } + if(coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] + } + if(usesMixins.toBoolean()) { from refMap manifest { @@ -184,10 +188,14 @@ jar { manifestAttributes += ["FMLCorePluginContainsFMLMod": true] } - if(accessTransformersFile.isEmpty() == false) { + if(accessTransformersFile) { manifestAttributes += ["FMLAT" : accessTransformersFile.toString()] } + if(coreModClass) { + manifestAttributes += ["FMLCorePlugin": modGroup + "." + coreModClass] + } + if(usesMixins.toBoolean()) { from refMap manifest { @@ -317,7 +325,7 @@ task apiJar(type: Jar) { artifacts { archives sourcesJar archives devJar - if(apiPackage.isEmpty() == false) { + if(apiPackage) { archives apiJar } } diff --git a/gradle.properties b/gradle.properties index a28acbd..dd65ba2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -44,6 +44,10 @@ usesMixins = false mixinPlugin = # Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! mixinsPackage = +# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! +# This parameter is for legacy compatability only +# Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin +coreModClass = # If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class # that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! containsMixinsAndOrCoreModOnly = false