diff --git a/build.gradle b/build.gradle index 35942898..43c77b50 100644 --- a/build.gradle +++ b/build.gradle @@ -21,26 +21,22 @@ apply plugin: 'org.spongepowered.mixin' repositories { maven { url = "https://jitpack.io" } - maven { - name = 'sonatype' - url = 'http://oss.sonatype.org/content/repositories/public/' - } + maven { url = 'http://oss.sonatype.org/content/repositories/public/' } maven { url = "http://repo.spongepowered.org/maven" } } configurations { embed - coreShadow - compile.extendsFrom(embed) + implementation.extendsFrom(embed) } dependencies { embed 'com.flowpowered:flow-math:1.0.3' embed 'org.jgrapht:jgrapht-core:1.1.0' embed 'com.github.DimensionalDevelopment:poly2tri.java:master-SNAPSHOT' + embed("org.spongepowered:mixin:0.7.8-SNAPSHOT") { transitive = false } compileOnly 'com.github.DimensionalDevelopment:AnnotatedNBT:-SNAPSHOT' - compile("org.spongepowered:mixin:0.7.8-SNAPSHOT") { transitive = false } - deobfProvided 'io.github.opencubicchunks:cubicchunks:1.12.2-0.0.819.0-SNAPSHOT' + compileOnly 'io.github.opencubicchunks:cubicchunks:1.12.2-0.0.819.0-SNAPSHOT' } // Mod version @@ -67,14 +63,14 @@ ext.mcversion = "1.12.2" ext.forgeversion = "14.23.2.2623" String mcpversion = "snapshot_20180227" +// Configuration minecraft { version = "$mcversion-$forgeversion" runDir = "run" mappings = mcpversion replace '${version}', fullVersion makeObfSourceJar = false - //noinspection GroovyUnusedAssignment - def args = [ + ext.args = [ "-Dfml.noGrab=false", "-Dfml.coreMods.load=org.dimdev.vanillafix.VanillaFixCoreMod", "-Dmixin.env.compatLevel=JAVA_8", @@ -85,8 +81,10 @@ minecraft { ] } -mixin { - add sourceSets.main, "org.dimdev.vanillafix.mixins.refmap.json" +sourceSets { + main { + ext.refMap = "mixins.vanillafix.refmap.json" + } } // Tasks @@ -96,16 +94,14 @@ compileJava { jar { archiveName = archivesBaseName + "-" + jarVersion + ".jar" - from configurations.embed.collect { it.isDirectory() ? it : zipTree(it) } - manifest { - attributes( - "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", - "FMLCorePlugin": "org.dimdev.vanillafix.VanillaFixCoreMod", - "TweakOrder": 0, - "MixinConfigs": "org.dimdev.vanillafix.mixins.json", - "ForceLoadAsMod": "true" - ) + from(configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }) { + exclude "LICENSE.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF" } + manifest.attributes( + "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", + "MixinConfigs": "mixins.vanillafix.json", + "FMLCorePlugin": "org.dimdev.vanillafix.VanillaFixCoreMod" + ) } task sourcesJar(type: Jar, dependsOn: classes) { @@ -126,7 +122,6 @@ processResources { // Replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' - // replace version and mcversion expand 'version': project.version, 'mcversion': project.minecraft.version } @@ -140,6 +135,5 @@ task generatePocketSchematics(dependsOn: jar, type: JavaExec, group: "dimdoors") classpath = files('build/libs/' + jar.archiveName) classpath += sourceSets.main.runtimeClasspath main = "org.dimdev.dimdoors.shared.tools.SchematicGenerator" - //noinspection GroovyAssignabilityCheck (IntelliJ is wrong) - args "src/main/resources/assets/dimdoors/pockets/schematic" + args = ["src/main/resources/assets/dimdoors/pockets/schematic"] } diff --git a/src/main/java/org/dimdev/vanillafix/VanillaFixCoreMod.java b/src/main/java/org/dimdev/vanillafix/VanillaFixCoreMod.java index 7157e2af..1d28495f 100644 --- a/src/main/java/org/dimdev/vanillafix/VanillaFixCoreMod.java +++ b/src/main/java/org/dimdev/vanillafix/VanillaFixCoreMod.java @@ -15,7 +15,7 @@ public class VanillaFixCoreMod implements IFMLLoadingPlugin { public VanillaFixCoreMod() { MixinBootstrap.init(); - Mixins.addConfiguration("org.dimdev.vanillafix.mixins.json"); + Mixins.addConfiguration("mixins.vanillafix.json"); } @Override public String[] getASMTransformerClass() { diff --git a/src/main/resources/mixins.vanillafix.json b/src/main/resources/mixins.vanillafix.json new file mode 100644 index 00000000..864eb72a --- /dev/null +++ b/src/main/resources/mixins.vanillafix.json @@ -0,0 +1,12 @@ +{ + "package": "org.dimdev.vanillafix.mixins", + "refmap": "mixins.vanillafix.refmap.json", + "target": "@env(DEFAULT)", + "compatibilityLevel": "JAVA_8", + "mixins": [ + "MixinNetHandlerPlayServer" + ], + "client": [ + "client.MixinMinecraft" + ] +} diff --git a/src/main/resources/org.dimdev.vanillafix.mixins.json b/src/main/resources/org.dimdev.vanillafix.mixins.json deleted file mode 100644 index 1b6fdc9a..00000000 --- a/src/main/resources/org.dimdev.vanillafix.mixins.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "required": true, - "package": "org.dimdev.vanillafix.mixins", - "refmap": "org.dimdev.vanillafix.mixins.refmap.json", - "compatibilityLevel": "JAVA_8", - "minVersion": "0.6.15-SNAPSHOT", - "mixins": [ - "MixinNetHandlerPlayServer" - ], - "client": [ - "client.MixinMinecraft"], - "server": [], - "injectors": { - "defaultRequire": 1 - }, - "overwrites": { - "conformVisibility": true - } -}