From 84746a10390741155fbd47c34936da2b64ca60d8 Mon Sep 17 00:00:00 2001 From: Ross Allan Date: Thu, 11 Jul 2013 01:36:54 +0100 Subject: [PATCH] Experimental new AE patch. Should fix all AE issues. Signed-off-by: Ross Allan --- resources/patches-deobfuscated.xml | 60 +++++++++++++++++-- .../nallar/tickthreading/patcher/Patches.java | 35 +++++++++++ 2 files changed, 91 insertions(+), 4 deletions(-) diff --git a/resources/patches-deobfuscated.xml b/resources/patches-deobfuscated.xml index 39f631bb..b6a5e94a 100644 --- a/resources/patches-deobfuscated.xml +++ b/resources/patches-deobfuscated.xml @@ -1504,14 +1504,44 @@ addStackToList addStackToList + + + - + + + ^method:TileEntity/updateEntity^ + configureController - ^method:TileEntity/updateEntity^,signalInput(L^class:ItemStack^;)V,signalInput(Lappeng.api.me.util.IMEInventory;L^class:ItemStack^;)L^class:ItemStack^; getJobList,getJobStatus,cancelJob - - getCellArray,^method:TileEntity/updateEntity^,advanceCraftingCursor,resetWaitingQueue,signalInput(L^class:ItemStack^;)V,signalInput(Lappeng.api.me.util.IMEInventory;L^class:ItemStack^;)L^class:ItemStack^; + + configureController,getCellArray,^method:TileEntity/updateEntity^,advanceCraftingCursor,resetWaitingQueue,signalInput(L^class:ItemStack^;)V,signalInput(Lappeng.api.me.util.IMEInventory;L^class:ItemStack^;)L^class:ItemStack^; @@ -1616,6 +1646,28 @@ ^static^ + + + ^method:TileEntity/updateEntity^ + diff --git a/src/common/nallar/tickthreading/patcher/Patches.java b/src/common/nallar/tickthreading/patcher/Patches.java index 1cad0c61..bd67b673 100644 --- a/src/common/nallar/tickthreading/patcher/Patches.java +++ b/src/common/nallar/tickthreading/patcher/Patches.java @@ -1026,6 +1026,41 @@ public void edit(MethodCall methodCall) throws CannotCompileException { }); } + @Patch ( + requiredAttributes = "name,interface" + ) + public void renameInterfaceMethod(CtMethod ctMethod, Map attributes) throws CannotCompileException, NotFoundException { + CtClass currentClass = ctMethod.getDeclaringClass().getSuperclass(); + final List superClassNames = new ArrayList(); + boolean contains = false; + do { + if (!contains) { + for (CtClass ctClass : currentClass.getInterfaces()) { + if (ctClass.getName().equals(attributes.get("interface"))) { + contains = true; + } + } + } + currentClass = currentClass.getSuperclass(); + superClassNames.add(currentClass.getName()); + } while (currentClass != classRegistry.getClass("java.lang.Object")); + final String newName = attributes.get("name"); + if (!contains) { + ctMethod.setName(newName); + return; + } + final String methodName = ctMethod.getName(); + ctMethod.instrument(new ExprEditor() { + @Override + public void edit(MethodCall methodCall) throws CannotCompileException { + if (methodName.equals(methodCall.getMethodName()) && superClassNames.contains(methodCall.getClassName())) { + methodCall.replace("$_ = super." + newName + "($$);"); + } + } + }); + ctMethod.setName(newName); + } + @Patch ( requiredAttributes = "name" )