Skip to content

Commit 29307cf

Browse files
committed
Embed mixin
1 parent 662e11f commit 29307cf

File tree

4 files changed

+31
-44
lines changed

4 files changed

+31
-44
lines changed

build.gradle

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,22 @@ apply plugin: 'org.spongepowered.mixin'
2121

2222
repositories {
2323
maven { url = "https://jitpack.io" }
24-
maven {
25-
name = 'sonatype'
26-
url = 'http://oss.sonatype.org/content/repositories/public/'
27-
}
24+
maven { url = 'http://oss.sonatype.org/content/repositories/public/' }
2825
maven { url = "http://repo.spongepowered.org/maven" }
2926
}
3027

3128
configurations {
3229
embed
33-
coreShadow
34-
compile.extendsFrom(embed)
30+
implementation.extendsFrom(embed)
3531
}
3632

3733
dependencies {
3834
embed 'com.flowpowered:flow-math:1.0.3'
3935
embed 'org.jgrapht:jgrapht-core:1.1.0'
4036
embed 'com.github.DimensionalDevelopment:poly2tri.java:master-SNAPSHOT'
37+
embed("org.spongepowered:mixin:0.7.8-SNAPSHOT") { transitive = false }
4138
compileOnly 'com.github.DimensionalDevelopment:AnnotatedNBT:-SNAPSHOT'
42-
compile("org.spongepowered:mixin:0.7.8-SNAPSHOT") { transitive = false }
43-
deobfProvided 'io.github.opencubicchunks:cubicchunks:1.12.2-0.0.819.0-SNAPSHOT'
39+
compileOnly 'io.github.opencubicchunks:cubicchunks:1.12.2-0.0.819.0-SNAPSHOT'
4440
}
4541

4642
// Mod version
@@ -67,14 +63,14 @@ ext.mcversion = "1.12.2"
6763
ext.forgeversion = "14.23.2.2623"
6864
String mcpversion = "snapshot_20180227"
6965

66+
// Configuration
7067
minecraft {
7168
version = "$mcversion-$forgeversion"
7269
runDir = "run"
7370
mappings = mcpversion
7471
replace '${version}', fullVersion
7572
makeObfSourceJar = false
76-
//noinspection GroovyUnusedAssignment
77-
def args = [
73+
ext.args = [
7874
"-Dfml.noGrab=false",
7975
"-Dfml.coreMods.load=org.dimdev.vanillafix.VanillaFixCoreMod",
8076
"-Dmixin.env.compatLevel=JAVA_8",
@@ -85,8 +81,10 @@ minecraft {
8581
]
8682
}
8783

88-
mixin {
89-
add sourceSets.main, "org.dimdev.vanillafix.mixins.refmap.json"
84+
sourceSets {
85+
main {
86+
ext.refMap = "mixins.vanillafix.refmap.json"
87+
}
9088
}
9189

9290
// Tasks
@@ -96,16 +94,14 @@ compileJava {
9694

9795
jar {
9896
archiveName = archivesBaseName + "-" + jarVersion + ".jar"
99-
from configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }
100-
manifest {
101-
attributes(
102-
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
103-
"FMLCorePlugin": "org.dimdev.vanillafix.VanillaFixCoreMod",
104-
"TweakOrder": 0,
105-
"MixinConfigs": "org.dimdev.vanillafix.mixins.json",
106-
"ForceLoadAsMod": "true"
107-
)
97+
from(configurations.embed.collect { it.isDirectory() ? it : zipTree(it) }) {
98+
exclude "LICENSE.txt", "META-INF/MANIFSET.MF", "META-INF/maven/**", "META-INF/*.RSA", "META-INF/*.SF"
10899
}
100+
manifest.attributes(
101+
"TweakClass": "org.spongepowered.asm.launch.MixinTweaker",
102+
"MixinConfigs": "mixins.vanillafix.json",
103+
"FMLCorePlugin": "org.dimdev.vanillafix.VanillaFixCoreMod"
104+
)
109105
}
110106

111107
task sourcesJar(type: Jar, dependsOn: classes) {
@@ -126,7 +122,6 @@ processResources {
126122
// Replace stuff in mcmod.info, nothing else
127123
from(sourceSets.main.resources.srcDirs) {
128124
include 'mcmod.info'
129-
// replace version and mcversion
130125
expand 'version': project.version, 'mcversion': project.minecraft.version
131126
}
132127

@@ -140,6 +135,5 @@ task generatePocketSchematics(dependsOn: jar, type: JavaExec, group: "dimdoors")
140135
classpath = files('build/libs/' + jar.archiveName)
141136
classpath += sourceSets.main.runtimeClasspath
142137
main = "org.dimdev.dimdoors.shared.tools.SchematicGenerator"
143-
//noinspection GroovyAssignabilityCheck (IntelliJ is wrong)
144-
args "src/main/resources/assets/dimdoors/pockets/schematic"
138+
args = ["src/main/resources/assets/dimdoors/pockets/schematic"]
145139
}

src/main/java/org/dimdev/vanillafix/VanillaFixCoreMod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class VanillaFixCoreMod implements IFMLLoadingPlugin {
1515

1616
public VanillaFixCoreMod() {
1717
MixinBootstrap.init();
18-
Mixins.addConfiguration("org.dimdev.vanillafix.mixins.json");
18+
Mixins.addConfiguration("mixins.vanillafix.json");
1919
}
2020

2121
@Override public String[] getASMTransformerClass() {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"package": "org.dimdev.vanillafix.mixins",
3+
"refmap": "mixins.vanillafix.refmap.json",
4+
"target": "@env(DEFAULT)",
5+
"compatibilityLevel": "JAVA_8",
6+
"mixins": [
7+
"MixinNetHandlerPlayServer"
8+
],
9+
"client": [
10+
"client.MixinMinecraft"
11+
]
12+
}

src/main/resources/org.dimdev.vanillafix.mixins.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)