Skip to content

Commit 9543d79

Browse files
authored
Bump version to MixinBooter v10 (#334)
1 parent c422cb7 commit 9543d79

File tree

6 files changed

+99
-27
lines changed

6 files changed

+99
-27
lines changed

dependencies.gradle

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ dependencies {
5353
implementation ("com.cleanroommc:groovyscript:1.1.3") {
5454
transitive = false
5555
} // Version 1.1.3
56-
implementation rfg.deobf("curse.maven:ae2-extended-life-570458:5378163") // AE2UEL 0.56.5
56+
implementation rfg.deobf("curse.maven:ae2-extended-life-570458:6302098") // AE2UEL 0.56.7
57+
implementation rfg.deobf("curse.maven:nae2-884359:5380800") // NAE2: 1.6.4
58+
implementation rfg.deobf("curse.maven:ae2-fluid-crafting-rework-623955:5751930") // AE2FC: 2.6.6-r
5759

58-
compileOnly "curse.maven:forgelin-continuous-456403:6359253" // Forgelin-Continuous 2.1.20.0
60+
compileOnly "curse.maven:forgelin-continuous-456403:6760510" // Forgelin-Continuous 2.2.0.0
5961
compileOnly "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.700" // CrT 4.1.20.700
6062
compileOnly "curse.maven:ctm-267602:2915363" // CTM 1.0.2.31
6163
runtimeOnly "com.cleanroommc:modularui:2.4.3" // MUI 2.4.3
@@ -76,16 +78,6 @@ dependencies {
7678
runtimeOnly "curse.maven:ae-additions-extra-cells-2-fork-493962:3814371"
7779
}
7880

79-
// Debug NAE2: 1.6.4
80-
if (project.debug_all.toBoolean() || project.debug_nae2.toBoolean()) {
81-
runtimeOnly "curse.maven:nae2-884359:5380800"
82-
}
83-
84-
// Debug AE2FC: 2.6.6-r
85-
if (project.debug_all.toBoolean() || project.debug_ae2fc.toBoolean()) {
86-
runtimeOnly "curse.maven:ae2-fluid-crafting-rework-623955:5751930"
87-
}
88-
8981
// Debug ExtraCPUs: 1.2.1
9082
if (project.debug_all.toBoolean() || project.debug_extracpus.toBoolean()) {
9183
runtimeOnly "curse.maven:extracpus-408089:3479639"

gradle.properties

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ debug_all = false
2525
debug_gtwp = false
2626
debug_inb = false
2727
debug_aea = false
28-
debug_nae2 = false
29-
debug_ae2fc = false
3028
debug_extracpus = false
3129
debug_thaumcraft = false
3230
debug_thaumenergy = false
@@ -76,7 +74,7 @@ accessTransformersFile =
7674
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
7775
usesMixins = true
7876
# Mixin Provider to use. Primarily changed when needing to use a different version.
79-
mixinProviderSpec = zone.rong:mixinbooter:9.4
77+
mixinProviderSpec = zone.rong:mixinbooter:10.6
8078
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
8179
mixinsPackage = mixins
8280
# Location of the mixin config refmap. If left, blank, defaults to "mixins.${modId}.refmap.json". Target file must have the "json" extension.

src/main/java/com/github/gtexpert/core/GTExpertMod.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,22 @@
3232

3333
@Mod(modid = GTEValues.MODID,
3434
name = GTEValues.MODNAME,
35-
acceptedMinecraftVersions = "[1.12.2,1.13)",
35+
acceptedMinecraftVersions = "[1.12.2]",
3636
version = Tags.VERSION,
3737
updateJSON = "https://forge.curseupdate.com/851103/gtexpert",
38-
dependencies = GTInternalTags.DEP_VERSION_STRING + "required-after:" + Mods.Names.MIXINBOOTER + ";" +
38+
dependencies = GTInternalTags.DEP_VERSION_STRING + "required-after:" + Mods.Names.MIXINBOOTER + "@[10.5,);" +
3939
"required-after:" + Mods.Names.GREGICALITY_MULTIBLOCKS + ";" +
40+
"required-after:" + Mods.Names.APPLIED_ENERGISTICS2 + "@[v0.56.7,);" +
41+
"required-after:" + Mods.Names.NEEVES_AE2 + ";" + "required-after:" + Mods.Names.AE2_FLUID_CRAFTING + ";" +
4042
"after:" + Mods.Names.GREGTECH_WOOD_PROCESSING + ";" + "after:" + Mods.Names.IMPLOSION_NO_BOMB + ";" +
41-
"after:" + Mods.Names.GREGTECH_FOOD_OPTION + ";" + "after:" + Mods.Names.APPLIED_ENERGISTICS2 + ";" +
42-
"after:" + Mods.Names.AE_ADDITIONS + ";" + "after:" + Mods.Names.AE2_FLUID_CRAFTING + ";" +
43-
"after:" + Mods.Names.NEEVES_AE2 + ";" + "after:" + Mods.Names.EXTRA_CPUS + ";" +
44-
"after:" + Mods.Names.ENDER_CORE + ";" + "after:" + Mods.Names.ENDER_IO + ";" +
45-
"after:" + Mods.Names.ENDER_ENDERGY + ";" + "after:" + Mods.Names.ENDER_MACHINES + ";" +
46-
"after:" + Mods.Names.ENDER_CONDUITS + ";" + "after:" + Mods.Names.ENDER_AE2_CONDUITS + ";" +
47-
"after:" + Mods.Names.DRACONIC_EVOLUTION + ";" + "after:" + Mods.Names.DRACONIC_ADDITIONS + ";" +
48-
"after:" + Mods.Names.CHISEL + ";" + "after:" + Mods.Names.AVARITIA + ";" +
49-
"after:" + Mods.Names.THAUMCRAFT + ";" + "after:" + Mods.Names.THAUMIC_ENERGISTICS + ";")
43+
"after:" + Mods.Names.GREGTECH_FOOD_OPTION + ";" + "after:" + Mods.Names.AE_ADDITIONS + ";" +
44+
"after:" + Mods.Names.EXTRA_CPUS + ";" + "after:" + Mods.Names.ENDER_CORE + ";" +
45+
"after:" + Mods.Names.ENDER_IO + ";" + "after:" + Mods.Names.ENDER_ENDERGY + ";" +
46+
"after:" + Mods.Names.ENDER_MACHINES + ";" + "after:" + Mods.Names.ENDER_CONDUITS + ";" +
47+
"after:" + Mods.Names.ENDER_AE2_CONDUITS + ";" + "after:" + Mods.Names.DRACONIC_EVOLUTION + ";" +
48+
"after:" + Mods.Names.DRACONIC_ADDITIONS + ";" + "after:" + Mods.Names.CHISEL + ";" +
49+
"after:" + Mods.Names.AVARITIA + ";" + "after:" + Mods.Names.THAUMCRAFT + ";" +
50+
"after:" + Mods.Names.THAUMIC_ENERGISTICS + ";")
5051
@Mod.EventBusSubscriber(modid = GTEValues.MODID)
5152
public class GTExpertMod {
5253

src/main/java/com/github/gtexpert/core/core/GTECoreMod.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ public class GTECoreMod implements IFMLLoadingPlugin {
1818

1919
@Override
2020
public String[] getASMTransformerClass() {
21-
return new String[0];
21+
GTELog.logger.info("GTECoreMod: getASMTransformerClass() called");
22+
return new String[] {
23+
"com.github.gtexpert.core.core.NAE2PatchTransformer"
24+
};
2225
}
2326

2427
@Override
@@ -29,11 +32,13 @@ public String getModContainerClass() {
2932
@Nullable
3033
@Override
3134
public String getSetupClass() {
35+
GTELog.logger.info("GTECoreMod: getSetupClass() called, returning DepLoader");
3236
return "com.github.gtexpert.core.core.deploader.DepLoader";
3337
}
3438

3539
@Override
3640
public void injectData(Map<String, Object> data) {
41+
GTELog.logger.info("GTECoreMod: injectData() called");
3742
coremodConfig.setProperty("downloadOnlyOnce", "true");
3843
File mcLocation = (File) data.get("mcLocation");
3944
File configDir = new File(mcLocation, "config");
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package com.github.gtexpert.core.core;
2+
3+
import java.util.Iterator;
4+
5+
import net.minecraft.launchwrapper.IClassTransformer;
6+
7+
import org.objectweb.asm.ClassReader;
8+
import org.objectweb.asm.ClassWriter;
9+
import org.objectweb.asm.tree.AnnotationNode;
10+
import org.objectweb.asm.tree.ClassNode;
11+
import org.objectweb.asm.tree.FieldNode;
12+
13+
import com.github.gtexpert.core.api.util.GTELog;
14+
15+
/**
16+
* ASM Transformer to patch NAE2's MixinDualityInterface by removing the problematic craftingList field.
17+
* This implements the diff change that removes the @Shadow craftingList field from the mixin.
18+
*/
19+
public class NAE2PatchTransformer implements IClassTransformer {
20+
21+
@Override
22+
public byte[] transform(String name, String transformedName, byte[] basicClass) {
23+
if ("co.neeve.nae2.mixin.upgrades.gregcircuit.MixinDualityInterface".equals(transformedName)) {
24+
return patchMixinDualityInterface(basicClass);
25+
}
26+
return basicClass;
27+
}
28+
29+
private byte[] patchMixinDualityInterface(byte[] classBytes) {
30+
try {
31+
GTELog.logger.info("Patching NAE2 MixinDualityInterface to remove craftingList field");
32+
33+
ClassReader classReader = new ClassReader(classBytes);
34+
ClassNode classNode = new ClassNode();
35+
classReader.accept(classNode, 0);
36+
37+
// Remove the craftingList field
38+
Iterator<FieldNode> fieldIterator = classNode.fields.iterator();
39+
boolean fieldRemoved = false;
40+
41+
while (fieldIterator.hasNext()) {
42+
FieldNode field = fieldIterator.next();
43+
if ("craftingList".equals(field.name)) {
44+
// Check if this field has @Shadow annotation
45+
if (field.visibleAnnotations != null) {
46+
for (AnnotationNode annotation : field.visibleAnnotations) {
47+
if ("Lorg/spongepowered/asm/mixin/Shadow;".equals(annotation.desc)) {
48+
GTELog.logger
49+
.info("Removing @Shadow craftingList field from NAE2 MixinDualityInterface");
50+
fieldIterator.remove();
51+
fieldRemoved = true;
52+
break;
53+
}
54+
}
55+
}
56+
}
57+
}
58+
59+
if (fieldRemoved) {
60+
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS);
61+
classNode.accept(classWriter);
62+
GTELog.logger.info("Successfully patched NAE2 MixinDualityInterface");
63+
return classWriter.toByteArray();
64+
} else {
65+
GTELog.logger.info("craftingList field not found or already removed in MixinDualityInterface");
66+
}
67+
68+
} catch (Exception e) {
69+
GTELog.logger.error("Failed to patch NAE2 MixinDualityInterface: " + e.getMessage(), e);
70+
}
71+
72+
return classBytes;
73+
}
74+
}

src/main/java/com/github/gtexpert/core/core/deploader/DepLoader.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,13 @@ public void run() {
103103

104104
@Override
105105
public void injectData(Map<String, Object> data) {
106+
LOGGER.info("DepLoader: injectData() called");
106107
mcLocation = (File) data.get("mcLocation");
107108
}
108109

109110
@Override
110111
public Void call() throws Exception {
112+
LOGGER.info("DepLoader: call() method started");
111113
// get dep info
112114
Gson g = new GsonBuilder().disableHtmlEscaping().create();
113115
List<Dependency> deps;

0 commit comments

Comments
 (0)