Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ dependencies {
implementation ("com.cleanroommc:groovyscript:1.1.3") {
transitive = false
} // Version 1.1.3
implementation rfg.deobf("curse.maven:ae2-extended-life-570458:5378163") // AE2UEL 0.56.5
implementation rfg.deobf("curse.maven:ae2-extended-life-570458:6302098") // AE2UEL 0.56.7
implementation rfg.deobf("curse.maven:nae2-884359:5380800") // NAE2: 1.6.4
implementation rfg.deobf("curse.maven:ae2-fluid-crafting-rework-623955:5751930") // AE2FC: 2.6.6-r

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

// Debug NAE2: 1.6.4
if (project.debug_all.toBoolean() || project.debug_nae2.toBoolean()) {
runtimeOnly "curse.maven:nae2-884359:5380800"
}

// Debug AE2FC: 2.6.6-r
if (project.debug_all.toBoolean() || project.debug_ae2fc.toBoolean()) {
runtimeOnly "curse.maven:ae2-fluid-crafting-rework-623955:5751930"
}

// Debug ExtraCPUs: 1.2.1
if (project.debug_all.toBoolean() || project.debug_extracpus.toBoolean()) {
runtimeOnly "curse.maven:extracpus-408089:3479639"
Expand Down
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ debug_all = false
debug_gtwp = false
debug_inb = false
debug_aea = false
debug_nae2 = false
debug_ae2fc = false
debug_extracpus = false
debug_thaumcraft = false
debug_thaumenergy = false
Expand Down Expand Up @@ -76,7 +74,7 @@ accessTransformersFile =
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
usesMixins = true
# Mixin Provider to use. Primarily changed when needing to use a different version.
mixinProviderSpec = zone.rong:mixinbooter:9.4
mixinProviderSpec = zone.rong:mixinbooter:10.6
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
mixinsPackage = mixins
# Location of the mixin config refmap. If left, blank, defaults to "mixins.${modId}.refmap.json". Target file must have the "json" extension.
Expand Down
23 changes: 12 additions & 11 deletions src/main/java/com/github/gtexpert/core/GTExpertMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,22 @@

@Mod(modid = GTEValues.MODID,
name = GTEValues.MODNAME,
acceptedMinecraftVersions = "[1.12.2,1.13)",
acceptedMinecraftVersions = "[1.12.2]",
version = Tags.VERSION,
updateJSON = "https://forge.curseupdate.com/851103/gtexpert",
dependencies = GTInternalTags.DEP_VERSION_STRING + "required-after:" + Mods.Names.MIXINBOOTER + ";" +
dependencies = GTInternalTags.DEP_VERSION_STRING + "required-after:" + Mods.Names.MIXINBOOTER + "@[10.5,);" +
"required-after:" + Mods.Names.GREGICALITY_MULTIBLOCKS + ";" +
"required-after:" + Mods.Names.APPLIED_ENERGISTICS2 + "@[v0.56.7,);" +
"required-after:" + Mods.Names.NEEVES_AE2 + ";" + "required-after:" + Mods.Names.AE2_FLUID_CRAFTING + ";" +
"after:" + Mods.Names.GREGTECH_WOOD_PROCESSING + ";" + "after:" + Mods.Names.IMPLOSION_NO_BOMB + ";" +
"after:" + Mods.Names.GREGTECH_FOOD_OPTION + ";" + "after:" + Mods.Names.APPLIED_ENERGISTICS2 + ";" +
"after:" + Mods.Names.AE_ADDITIONS + ";" + "after:" + Mods.Names.AE2_FLUID_CRAFTING + ";" +
"after:" + Mods.Names.NEEVES_AE2 + ";" + "after:" + Mods.Names.EXTRA_CPUS + ";" +
"after:" + Mods.Names.ENDER_CORE + ";" + "after:" + Mods.Names.ENDER_IO + ";" +
"after:" + Mods.Names.ENDER_ENDERGY + ";" + "after:" + Mods.Names.ENDER_MACHINES + ";" +
"after:" + Mods.Names.ENDER_CONDUITS + ";" + "after:" + Mods.Names.ENDER_AE2_CONDUITS + ";" +
"after:" + Mods.Names.DRACONIC_EVOLUTION + ";" + "after:" + Mods.Names.DRACONIC_ADDITIONS + ";" +
"after:" + Mods.Names.CHISEL + ";" + "after:" + Mods.Names.AVARITIA + ";" +
"after:" + Mods.Names.THAUMCRAFT + ";" + "after:" + Mods.Names.THAUMIC_ENERGISTICS + ";")
"after:" + Mods.Names.GREGTECH_FOOD_OPTION + ";" + "after:" + Mods.Names.AE_ADDITIONS + ";" +
"after:" + Mods.Names.EXTRA_CPUS + ";" + "after:" + Mods.Names.ENDER_CORE + ";" +
"after:" + Mods.Names.ENDER_IO + ";" + "after:" + Mods.Names.ENDER_ENDERGY + ";" +
"after:" + Mods.Names.ENDER_MACHINES + ";" + "after:" + Mods.Names.ENDER_CONDUITS + ";" +
"after:" + Mods.Names.ENDER_AE2_CONDUITS + ";" + "after:" + Mods.Names.DRACONIC_EVOLUTION + ";" +
"after:" + Mods.Names.DRACONIC_ADDITIONS + ";" + "after:" + Mods.Names.CHISEL + ";" +
"after:" + Mods.Names.AVARITIA + ";" + "after:" + Mods.Names.THAUMCRAFT + ";" +
"after:" + Mods.Names.THAUMIC_ENERGISTICS + ";")
@Mod.EventBusSubscriber(modid = GTEValues.MODID)
public class GTExpertMod {

Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/github/gtexpert/core/core/GTECoreMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ public class GTECoreMod implements IFMLLoadingPlugin {

@Override
public String[] getASMTransformerClass() {
return new String[0];
GTELog.logger.info("GTECoreMod: getASMTransformerClass() called");
return new String[] {
"com.github.gtexpert.core.core.NAE2PatchTransformer"
};
}

@Override
Expand All @@ -29,11 +32,13 @@ public String getModContainerClass() {
@Nullable
@Override
public String getSetupClass() {
GTELog.logger.info("GTECoreMod: getSetupClass() called, returning DepLoader");
return "com.github.gtexpert.core.core.deploader.DepLoader";
}

@Override
public void injectData(Map<String, Object> data) {
GTELog.logger.info("GTECoreMod: injectData() called");
coremodConfig.setProperty("downloadOnlyOnce", "true");
File mcLocation = (File) data.get("mcLocation");
File configDir = new File(mcLocation, "config");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.github.gtexpert.core.core;

import java.util.Iterator;

import net.minecraft.launchwrapper.IClassTransformer;

import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.tree.AnnotationNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode;

import com.github.gtexpert.core.api.util.GTELog;

/**
* ASM Transformer to patch NAE2's MixinDualityInterface by removing the problematic craftingList field.
* This implements the diff change that removes the @Shadow craftingList field from the mixin.
*/
public class NAE2PatchTransformer implements IClassTransformer {

@Override
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if ("co.neeve.nae2.mixin.upgrades.gregcircuit.MixinDualityInterface".equals(transformedName)) {
return patchMixinDualityInterface(basicClass);
}
return basicClass;
}

private byte[] patchMixinDualityInterface(byte[] classBytes) {
try {
GTELog.logger.info("Patching NAE2 MixinDualityInterface to remove craftingList field");

ClassReader classReader = new ClassReader(classBytes);
ClassNode classNode = new ClassNode();
classReader.accept(classNode, 0);

// Remove the craftingList field
Iterator<FieldNode> fieldIterator = classNode.fields.iterator();
boolean fieldRemoved = false;

while (fieldIterator.hasNext()) {
FieldNode field = fieldIterator.next();
if ("craftingList".equals(field.name)) {
// Check if this field has @Shadow annotation
if (field.visibleAnnotations != null) {
for (AnnotationNode annotation : field.visibleAnnotations) {
if ("Lorg/spongepowered/asm/mixin/Shadow;".equals(annotation.desc)) {
GTELog.logger
.info("Removing @Shadow craftingList field from NAE2 MixinDualityInterface");
fieldIterator.remove();
fieldRemoved = true;
break;
}
}
}
}
}

if (fieldRemoved) {
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_MAXS);
classNode.accept(classWriter);
GTELog.logger.info("Successfully patched NAE2 MixinDualityInterface");
return classWriter.toByteArray();
} else {
GTELog.logger.info("craftingList field not found or already removed in MixinDualityInterface");
}

} catch (Exception e) {
GTELog.logger.error("Failed to patch NAE2 MixinDualityInterface: " + e.getMessage(), e);
}

return classBytes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ public void run() {

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

@Override
public Void call() throws Exception {
LOGGER.info("DepLoader: call() method started");
// get dep info
Gson g = new GsonBuilder().disableHtmlEscaping().create();
List<Dependency> deps;
Expand Down