Generate Mixin Config on demand

This commit is contained in:
Johann Bernhardt committed 2021-11-03 18:44:23 +01:00
1 parent 3153201421
commit 2aa2237ac1
3 files changed
+23 -15

No files matched your search

+17 -4
View File
@@ -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
+6 -2
View File
@@ -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
-9
View File
@@ -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"
}