diff --git a/build.gradle b/build.gradle index 5720c27..4db9d57 100644 --- a/build.gradle +++ b/build.gradle @@ -121,6 +121,22 @@ def mixingConfigRefMap = "mixins." + modId + ".refmap.json" def refMap = "${tasks.compileJava.temporaryDir}" + File.separator + mixingConfigRefMap def mixinSrg = "${tasks.reobf.temporaryDir}" + File.separator + "mixins.srg" +task generateAssets { + if(usesMixins.toBoolean()) { + new File(projectDir.toString() + "/src/main/resources/", mixinConfigJson).text = """{ + "required": true, + "minVersion": "0.7.11", + "package": "${modGroup}.${mixinsPackage}", + "plugin": "${modGroup}.${mixinPlugin}", + "refmap": "${mixingConfigRefMap}", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8" +} + +""" + } +} + shadowJar { if(usesMixins.toBoolean()) { from refMap @@ -206,10 +222,7 @@ processResources expand "minecraftVersion": project.minecraft.version, "modVersion": versionDetails().lastTag, "modId": modId, - "modName": modName, - "modDescription": modDescription, - "modUrl": modUrl, - "modCredits": modCredits + "modName": modName } // copy everything else, thats not the mcmod.info diff --git a/gradle.properties b/gradle.properties index c25e9ea..207d747 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ modName = MyMod # This is a case-sensitive string to identify your mod. Convention is to use lower case. -modId = mymod +modId = mymodid modGroup = com.myname.mymodid @@ -22,10 +22,14 @@ gradleTokenGroupName = GRADLETOKEN_GROUPNAME # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can # leave this property empty. # Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api -apiPackage = api +apiPackage = # Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled! usesMixins = true +# Specify the location of your implementation of IMixinPlugin. Leave it empty otherwise. +mixinPlugin = mixinplugin.MixinPlugin +# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! +mixinsPackage = mixins # If your project contains a mod next to a mixin you want this to be true. Only if you provide a lone collections # of mixins you set this parameter to false. Is ignored when usesMixins = false. loadNormalModAfterApplingMixins = true diff --git a/src/main/resources/mixins.mymod.json b/src/main/resources/mixins.mymod.json deleted file mode 100644 index 100545f..0000000 --- a/src/main/resources/mixins.mymod.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "required": true, - "minVersion": "0.7.11", - "package": "com.myname.mymodid.mixins", - "plugin": "com.myname.mymodid.mixinplugin.MixinPlugin", - "refmap": "mixins.mymodid.refmap.json", - "target": "@env(DEFAULT)", - "compatibilityLevel": "JAVA_8" -}