plugins { id 'multiloader-loader' id 'idea' id 'eclipse' id 'net.minecraftforge.gradle' id 'org.parchmentmc.librarian.forgegradle' id 'org.spongepowered.mixin' id 'multiloader-publish' } mixin { add sourceSets.main, "${mod_id}.refmap.json" config "${mod_id}.mixins.json" } minecraft { mappings channel: 'parchment', version: "${parchment_version}-${parchment_minecraft}" copyIdeResources = true //Calls processResources when in dev // Automatically enable forge AccessTransformers if the file exists // This location is hardcoded in Forge and can not be changed. // https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123 def at = project(':common').file('src/main/resources/META-INF/accesstransformer.cfg') if (at.exists()) { accessTransformer = at } runs { client { workingDirectory file('../run/client') ideaModule "${rootProject.name}.${project.name}.main" taskName 'Client' mods { modClientRun { source sourceSets.main } } } server { workingDirectory file('../run/server') ideaModule "${rootProject.name}.${project.name}.main" taskName 'Server' mods { modServerRun { source sourceSets.main } } } } } dependencies { minecraft "net.minecraftforge:forge:${forge_minecraft_version}-${forge_version}" annotationProcessor('org.spongepowered:mixin:0.8.5-SNAPSHOT:processor') implementation('net.sf.jopt-simple:jopt-simple:5.0.4') { version { strictly '5.0.4' } } } // for some reason mixin plugin does not add 'MixinConfigs' to MANIFEST.MF so we do it manually jar { manifest { attributes([ 'MixinConfigs': "${mod_id}.mixins.json" ]) } } sourceSets.each { def dir = layout.buildDirectory.dir("sourcesSets/$it.name") it.output.resourcesDir = dir it.java.destinationDirectory = dir }