diff options
Diffstat (limited to 'src/main/java/bscv/patches/TestPatch.java')
-rw-r--r-- | src/main/java/bscv/patches/TestPatch.java | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/bscv/patches/TestPatch.java b/src/main/java/bscv/patches/TestPatch.java new file mode 100644 index 0000000..381ee48 --- /dev/null +++ b/src/main/java/bscv/patches/TestPatch.java @@ -0,0 +1,51 @@ +package bscv.asm.patches; + +import org.objectweb.asm.Opcodes; +import org.objectweb.asm.tree.ClassNode; +import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.InsnNode; +import org.objectweb.asm.tree.MethodNode; + +import ftbsc.lll.IInjector; + +/** + * When working as intended, this patch will crash the game + * as soon it finished loading with a NegativeArraySizeException. + */ +public class TestPatch { + + public static class FramerateFix implements IInjector, Opcodes { + public String name() { return "FramerateFix"; } + public String targetClass() { return "net.minecraft.client.Minecraft"; } + public String methodName() { return "func_213243_aC"; } // getFramerateLimit() + public String methodDesc() { return "()I"; } + + public void inject(ClassNode clazz, MethodNode main) { + InsnList insnList = new InsnList(); + insnList.add(new InsnNode(POP)); + main.instructions.insert(insnList); + } + } + + + public static class TickPatch implements IInjector, Opcodes { + public String name() { return "TickPatch"; } + public String targetClass() { return "net.minecraft.client.Minecraft"; } + public String methodName() { return "func_71407_l"; } // tick() + public String methodDesc() { return "()V"; } + + public void inject(ClassNode clazz, MethodNode main) { + InsnList insnList = new InsnList(); + insnList.add(new InsnNode(POP)); + insnList.add(new InsnNode(POP)); + insnList.add(new InsnNode(POP)); + insnList.add(new InsnNode(POP)); + insnList.add(new InsnNode(POP)); + insnList.add(new InsnNode(POP)); + insnList.add(new InsnNode(POP)); + insnList.add(new InsnNode(POP)); + main.instructions.insert(insnList); + } + } + +} |