Skip to content

Commit bdf73dd

Browse files
committed
GasStation compat
1 parent 84b934d commit bdf73dd

File tree

5 files changed

+29
-96
lines changed

5 files changed

+29
-96
lines changed

build.gradle

Lines changed: 16 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//version: 1656003793falsepattern40
1+
//version: 1656003793falsepattern41
22
/*
33
DO NOT CHANGE THIS FILE!
44
@@ -126,7 +126,6 @@ propertyDefaultIfUnset("mavenArtifactId", "")
126126
propertyDefaultIfUnset("hasMixinDeps", false)
127127
propertyDefaultIfUnset("mixinPreinitConfig", "")
128128
propertyDefaultIfUnset("remapStubs", false)
129-
propertyDefaultIfUnset("useObsoleteSpongeMixins", false)
130129

131130
propertyDefaultIfUnset("modrinthProjectId", "")
132131
propertyDefaultIfUnset("modrinthDependencies", "")
@@ -284,54 +283,29 @@ repositories {
284283
url = "https://gregtech.overminddl1.com/"
285284
}
286285
if(usesMixins.toBoolean() || hasMixinDeps.toBoolean()) {
287-
if (useObsoleteSpongeMixins.toBoolean()) {
288-
maven {
289-
name = "sponge"
290-
url = "https://mvn.falsepattern.com/sponge"
291-
}
286+
maven {
287+
name = "sponge"
288+
url = "https://mvn.falsepattern.com/releases"
292289
}
293290
maven {
294-
url = "https://mvn.falsepattern.com/jitpack"
291+
name = "sponge2"
292+
url = "https://mvn.falsepattern.com/sponge"
295293
}
296294
}
297295
}
298296

299297
dependencies {
300298
if(usesMixins.toBoolean()) {
301-
if (useObsoleteSpongeMixins.toBoolean()) {
302-
annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3")
303-
annotationProcessor("com.google.guava:guava:24.1.1-jre")
304-
annotationProcessor("com.google.code.gson:gson:2.8.6")
305-
annotationProcessor("org.spongepowered:mixin:0.8-20200110.181151-15")
306-
// using 0.8 to workaround a issue in 0.7 which fails mixin application
307-
compile("org.spongepowered:mixin:0.7.11-20180703.121122-1") {
308-
// Mixin includes a lot of dependencies that are too up-to-date
309-
exclude module: "launchwrapper"
310-
exclude module: "guava"
311-
exclude module: "gson"
312-
exclude module: "commons-io"
313-
exclude module: "log4j-core"
314-
}
315-
compile("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
316-
} else {
317-
compile("com.github.tox1cozZ:mixin-booter-legacy:1.1.2")
318-
annotationProcessor("com.github.tox1cozZ:mixin-booter-legacy:1.1.2:processor")
319-
}
320-
}
321-
if(hasMixinDeps.toBoolean()) {
322-
if (useObsoleteSpongeMixins.toBoolean()) {
323-
runtime("org.spongepowered:mixin:0.7.11-20180703.121122-1") {
324-
// Mixin includes a lot of dependencies that are too up-to-date
325-
exclude module: "launchwrapper"
326-
exclude module: "guava"
327-
exclude module: "gson"
328-
exclude module: "commons-io"
329-
exclude module: "log4j-core"
330-
}
331-
runtime("com.github.GTNewHorizons:SpongeMixins:1.3.3:dev")
332-
} else {
333-
runtime("com.github.tox1cozZ:mixin-booter-legacy:1.1.2")
334-
}
299+
annotationProcessor("org.ow2.asm:asm-debug-all:5.0.3")
300+
annotationProcessor("com.google.guava:guava:24.1.1-jre")
301+
annotationProcessor("com.google.code.gson:gson:2.8.6")
302+
annotationProcessor("org.spongepowered:mixin:0.8.3-gasstation")
303+
compile("org.spongepowered:mixin:0.8.3-gasstation")
304+
compile("com.falsepattern:gasstation-mc1.7.10:7370815:dev")
305+
} else if(hasMixinDeps.toBoolean()) {
306+
runtime("org.spongepowered:mixin:0.8.3-gasstation")
307+
runtime("com.llamalad7:MixinExtras:0.0.12-gasstation")
308+
runtime("com.falsepattern:gasstation-mc1.7.10:7370815:dev")
335309
}
336310
}
337311

dependencies.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ dependencies {
22
compileOnly("org.projectlombok:lombok:1.18.22") {
33
transitive = false
44
}
5-
compileOnly("com.github.tox1cozZ:mixin-booter-legacy:1.1.2") {
6-
transitive = false
7-
}
5+
compileOnly("org.spongepowered:mixin:0.8.3-gasstation")
6+
compileOnly("com.llamalad7:MixinExtras:0.0.12-gasstation")
7+
compileOnly("com.falsepattern:gasstation-mc1.7.10:0.1.0:dev")
88
compileOnly("com.falsepattern:json:0.4.1")
99
compileOnly("org.tukaani:xz:1.9")
1010
testCompile("org.tukaani:xz:1.9")

src/main/java/com/falsepattern/lib/internal/asm/IMixinPluginTransformer.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
public class IMixinPluginTransformer implements IClassNodeTransformer {
3434
private static final String CLASSNODE_MIXINBOOTER = "org/spongepowered/libraries/org/objectweb/asm/tree/ClassNode";
35-
private static final String CLASSNODE_SPONGEMIXINS = "org/spongepowered/asm/lib/tree/ClassNode";
35+
private static final String CLASSNODE_REGULAR = "org/spongepowered/asm/lib/tree/ClassNode";
3636
private static final String IMIXINPLUGIN = Tags.GROUPNAME + ".mixin.IMixinPlugin";
3737
private static final String IMIXINPLUGIN_INTERNAL = IMIXINPLUGIN.replace('.', '/');
3838
private static final String IMIXINCONFIGPLUGIN_INTERNAL = "org/spongepowered/asm/mixin/extensibility/IMixinConfigPlugin";
@@ -57,18 +57,18 @@ public void transform(ClassNode cn, String transformedName, boolean obfuscated)
5757
}
5858

5959
private static void transformIMixinPlugin(ClassNode cn) {
60-
if (!MixinInfo.isMixinBooterLegacy()) {
61-
FPTransformer.LOG.info("Could not detect MixinBooterLegacy. Converting IMixinPlugin to legacy compat mode.");
62-
doRename(cn.methods, CLASSNODE_MIXINBOOTER, CLASSNODE_SPONGEMIXINS);
60+
if (MixinInfo.isMixinBooterLegacy()) {
61+
FPTransformer.LOG.info("Detected MixinBooterLegacy. Converting IMixinPlugin to compat mode.");
62+
doRename(cn.methods, CLASSNODE_REGULAR, CLASSNODE_MIXINBOOTER);
6363
}
6464
}
6565

6666
private static void transformPlugin(ClassNode cn, String transformedName) {
6767
FPTransformer.LOG.info("Transforming " + transformedName + " to fit current mixin environment.");
6868
if (!MixinInfo.isMixinBooterLegacy()) {
69-
doRename(cn.methods, CLASSNODE_MIXINBOOTER, CLASSNODE_SPONGEMIXINS);
69+
doRename(cn.methods, CLASSNODE_MIXINBOOTER, CLASSNODE_REGULAR);
7070
} else {
71-
doRename(cn.methods, CLASSNODE_SPONGEMIXINS, CLASSNODE_MIXINBOOTER);
71+
doRename(cn.methods, CLASSNODE_REGULAR, CLASSNODE_MIXINBOOTER);
7272
}
7373
}
7474

src/main/java/com/falsepattern/lib/mixin/IMixinPlugin.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
package com.falsepattern.lib.mixin;
2222

2323
import com.falsepattern.lib.StableAPI;
24-
import com.falsepattern.lib.mixin.stubpackage.org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
2524
import com.falsepattern.lib.util.FileUtil;
2625
import lombok.val;
2726
import org.apache.logging.log4j.LogManager;
2827
import org.apache.logging.log4j.Logger;
28+
import org.spongepowered.asm.lib.tree.ClassNode;
29+
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
2930
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
30-
import org.spongepowered.libraries.org.objectweb.asm.tree.ClassNode;
3131

3232
import net.minecraft.launchwrapper.Launch;
3333

@@ -146,14 +146,14 @@ default boolean loadJarOf(final ITargetedMod mod) {
146146
return success;
147147
}
148148

149-
@Override
150149
@StableAPI.Expose(since = "__INTERNAL__")
150+
@Override
151151
default void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
152152

153153
}
154154

155-
@Override
156155
@StableAPI.Expose(since = "__INTERNAL__")
156+
@Override
157157
default void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {
158158

159159
}

src/main/java/com/falsepattern/lib/mixin/stubpackage/org/spongepowered/asm/mixin/extensibility/IMixinConfigPlugin.java

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

0 commit comments

Comments
 (0)