Deal with obfuscation properly (#645)

* make one method to dump the classes instead of copy pasting 6 times

* deal with obfuscation properly in ASM transformers instead of brute forcing both obfuscated and clear names

* remove sorting index on AngelicaTweaker to avoid confusion

* use static final variables for the class names with "."
This commit is contained in:
Alexdoru authored and GitHub committed 2024-10-09 08:07:22 -07:00
1 parent b837b0571d
commit 60cce7ea1d
7 files changed
+84 -79

No files matched your search

@@ -2,7 +2,6 @@ package jss.notfine.asm;
import static jss.notfine.asm.ASMUtils.matchesNodeSequence;
import com.gtnewhorizon.gtnhlib.asm.ASMUtil;
import com.gtnewhorizons.angelica.loading.AngelicaTweaker;
import net.minecraft.launchwrapper.IClassTransformer;
@@ -35,10 +34,7 @@ public class RenderBlocksTransformer implements IClassTransformer {
public byte[] transform(String name, String transformedName, byte[] basicClass) {
if ("net.minecraft.client.renderer.RenderBlocks".equals(transformedName)) {
final byte[] bytes = patchRenderBlocks(basicClass);
if (AngelicaTweaker.DUMP_CLASSES()) {
ASMUtil.saveAsRawClassFile(basicClass, transformedName + "_PRE", this);
ASMUtil.saveAsRawClassFile(bytes, transformedName + "_POST", this);
}
AngelicaTweaker.dumpClass(transformedName, basicClass, bytes, this);
return bytes;
}
return basicClass;