Skip to content
This repository was archived by the owner on Jan 3, 2020. It is now read-only.

Commit 6c7de16

Browse files
committed
ASMTransformer updated to 1.7.10
1 parent ac8a406 commit 6c7de16

File tree

3 files changed

+5
-58
lines changed

3 files changed

+5
-58
lines changed

src/main/java/org/devinprogress/YAIF/Transformer/ASMHelper.java

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -78,61 +78,8 @@ public static AbstractInsnNode getNthInsnNode(MethodNode mn,int opcode,int N){
7878
return n;
7979
}
8080

81-
public static AbstractInsnNode getALOAD(MethodNode mn,int index,int val){
82-
AbstractInsnNode n=mn.instructions.getFirst();
83-
int count=0;
84-
while(n!=null){
85-
if(n.getOpcode()==Opcodes.ALOAD&&((VarInsnNode)n).var==val){
86-
count++;
87-
if(count==index)
88-
break;
89-
}
90-
n=n.getNext();
91-
}
92-
return n;
93-
}
94-
95-
public static void InsertInvokeStaticBefore(MethodNode mn,AbstractInsnNode n,String targetClass,String targetMethod,String desc){
96-
mn.instructions.insertBefore(n,new MethodInsnNode(Opcodes.INVOKESTATIC,
97-
targetClass.replace('.','/'),targetMethod,desc));
98-
}
99-
10081
public static void InsertInvokeStaticAfter(MethodNode mn,AbstractInsnNode n,String targetClass,String targetMethod,String desc){
10182
mn.instructions.insert(n, new MethodInsnNode(Opcodes.INVOKESTATIC,
102-
targetClass.replace('.', '/'), targetMethod, desc));
103-
}
104-
105-
public class MethodRecord{
106-
public String ClassName;
107-
public String MethodName;
108-
public String MethodNameDeobf;
109-
public String Desc;
110-
public String DescDeobf;
111-
public String ProcessMethodName;
112-
public Method ProcessMethod;
113-
private boolean flag=false;
114-
public MethodRecord(String a,String b,String c,String d,String e,String f){
115-
ClassName=a;
116-
MethodName=b;
117-
MethodNameDeobf=c;
118-
Desc=d;
119-
DescDeobf=e;
120-
ProcessMethodName=f;
121-
}
122-
123-
public void preProcess(boolean Deobf,Object o){
124-
if(flag)return;
125-
126-
if(Deobf){
127-
MethodName=MethodNameDeobf;
128-
Desc=DescDeobf;
129-
}
130-
try{
131-
ProcessMethod=o.getClass().getDeclaredMethod(ProcessMethodName,MethodNode.class);
132-
}catch(Exception e){
133-
e.printStackTrace();
134-
}
135-
flag=true;
136-
}
83+
targetClass.replace('.', '/'), targetMethod, desc,false));
13784
}
13885
}

src/main/java/org/devinprogress/YAIF/Transformer/ASMTransformer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public byte[] transform(String name, String transformedName, byte[] bytes) {
2727
return asm.transform(name,transformedName,bytes);
2828
}
2929

30-
/* These Transformers are designed for Minecraft version 1.7.2 */
30+
/* These Transformers are designed for Minecraft version 1.7.10 */
3131
public static void insertWrapperStartup(MethodNode mn){
3232
//Add TextField Wrapper
3333
//org.devinprogress.YAIF.YetAnotherInputFix.SetupTextFieldWrapper(this.displayWidth, this.displayHeight);
@@ -42,9 +42,9 @@ public static void insertWrapperStartup(MethodNode mn){
4242

4343
//Be careful of the Exception Labels!!!
4444
//Insert before INVOKESTATIC net/minecraftforge/client/ForgeHooksClient.createDisplay ()V
45-
//11th INVOKESTATIC
45+
//10th INVOKESTATIC
4646

47-
AbstractInsnNode n=ASMHelper.getNthInsnNode(mn,Opcodes.INVOKESTATIC,11);
47+
AbstractInsnNode n=ASMHelper.getNthInsnNode(mn,Opcodes.INVOKESTATIC,10);
4848
String WidthName=YetAnotherInputFix.ObfuscatedEnv?"d":"displayWidth";
4949
String HeightName=YetAnotherInputFix.ObfuscatedEnv?"e":"displayHeight";
5050

src/main/java/org/devinprogress/YAIF/Transformer/Loader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* Created by recursiveg on 14-9-12.
1010
*/
11-
@IFMLLoadingPlugin.MCVersion("1.7.2")
11+
@IFMLLoadingPlugin.MCVersion("1.7.10")
1212
public class Loader implements IFMLLoadingPlugin {
1313

1414
@Override

0 commit comments

Comments
 (0)