|
31 | 31 | import mega.fluidlogged.Tags; |
32 | 32 | import org.jetbrains.annotations.NotNull; |
33 | 33 | import org.objectweb.asm.Opcodes; |
34 | | -import org.objectweb.asm.Type; |
35 | 34 | import org.objectweb.asm.tree.InsnNode; |
36 | 35 | import org.objectweb.asm.tree.MethodInsnNode; |
37 | 36 | import org.objectweb.asm.tree.VarInsnNode; |
38 | 37 |
|
39 | | -import net.minecraft.client.renderer.RenderBlocks; |
40 | | - |
41 | | -import java.lang.reflect.Method; |
42 | 38 |
|
43 | 39 | /** |
44 | 40 | * Waterlogging renderer hook |
@@ -109,13 +105,11 @@ public boolean transformClass(@NotNull String className, @NotNull ClassNodeHandl |
109 | 105 | iter.add(new VarInsnNode(Opcodes.ILOAD, 21)); |
110 | 106 | iter.add(new VarInsnNode(Opcodes.ILOAD, 22)); |
111 | 107 | iter.add(new VarInsnNode(Opcodes.ILOAD, 17)); |
112 | | - Method target; |
113 | | - try { |
114 | | - target = ASMHooks.class.getDeclaredMethod("drawFluidLogged", RenderBlocks.class, int.class, int.class, int.class, int.class); |
115 | | - } catch (NoSuchMethodException e) { |
116 | | - throw new RuntimeException(e); |
117 | | - } |
118 | | - iter.add(new MethodInsnNode(Opcodes.INVOKESTATIC, Type.getInternalName(target.getDeclaringClass()), target.getName(), Type.getMethodDescriptor(target), false)); |
| 108 | + iter.add(new MethodInsnNode(Opcodes.INVOKESTATIC, |
| 109 | + Tags.ROOT_PKG.replace('.', '/') + "/internal/core/ASMHooks", |
| 110 | + "drawFluidLogged", |
| 111 | + "(Lnet/minecraft/client/renderer/RenderBlocks;IIII)I", |
| 112 | + false)); |
119 | 113 | iter.add(new InsnNode(Opcodes.DUP)); |
120 | 114 | iter.add(new InsnNode(Opcodes.ICONST_1)); |
121 | 115 | iter.add(new InsnNode(Opcodes.IAND)); |
|
0 commit comments