diff --git a/bundler/src/main/java/dev/openrs2/bundler/transform/RightClickTransformer.java b/bundler/src/main/java/dev/openrs2/bundler/transform/RightClickTransformer.java
new file mode 100644
index 00000000..cb4e387c
--- /dev/null
+++ b/bundler/src/main/java/dev/openrs2/bundler/transform/RightClickTransformer.java
@@ -0,0 +1,65 @@
+package dev.openrs2.bundler.transform;
+
+import dev.openrs2.asm.classpath.ClassPath;
+import dev.openrs2.asm.transform.Transformer;
+import org.objectweb.asm.Opcodes;
+import org.objectweb.asm.tree.ClassNode;
+import org.objectweb.asm.tree.FieldInsnNode;
+import org.objectweb.asm.tree.InsnList;
+import org.objectweb.asm.tree.InsnNode;
+import org.objectweb.asm.tree.MethodInsnNode;
+import org.objectweb.asm.tree.MethodNode;
+import org.objectweb.asm.tree.analysis.AnalyzerException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public final class RightClickTransformer extends Transformer {
+ private static final Logger logger = LoggerFactory.getLogger(RightClickTransformer.class);
+
+ private int metaDownCalls;
+
+ @Override
+ protected void preTransform(ClassPath classPath) throws AnalyzerException {
+ metaDownCalls = 0;
+ }
+
+ @Override
+ protected boolean transformCode(ClassNode clazz, MethodNode method) throws AnalyzerException {
+ for (var it = method.instructions.iterator(); it.hasNext(); ) {
+ var insn = it.next();
+ if (insn.getOpcode() != Opcodes.INVOKEVIRTUAL) {
+ continue;
+ }
+
+ var invokevirtual = (MethodInsnNode) insn;
+ if (!invokevirtual.owner.equals("java/awt/event/MouseEvent")) {
+ continue;
+ }
+
+ if (!invokevirtual.name.equals("isMetaDown")) {
+ continue;
+ }
+
+ if (!invokevirtual.desc.equals("()Z")) {
+ continue;
+ }
+
+ invokevirtual.name = "getModifiersEx";
+ invokevirtual.desc = "()I";
+
+ var list = new InsnList();
+ list.add(new FieldInsnNode(Opcodes.GETSTATIC, "java/awt/event/MouseEvent", "BUTTON3_DOWN_MASK", "I"));
+ list.add(new InsnNode(Opcodes.IAND));
+ method.instructions.insert(invokevirtual, list);
+
+ metaDownCalls++;
+ }
+
+ return false;
+ }
+
+ @Override
+ protected void postTransform(ClassPath classPath) throws AnalyzerException {
+ logger.info("Replaced {} isMetaDown calls with getModifiersEx", metaDownCalls);
+ }
+}
diff --git a/deob/pom.xml b/deob/pom.xml
index a98098fd..7ad2ee07 100644
--- a/deob/pom.xml
+++ b/deob/pom.xml
@@ -27,6 +27,11 @@
openrs2-asm
${project.version}
+
+ dev.openrs2
+ openrs2-bundler
+ ${project.version}
+
dev.openrs2
openrs2-deob-annotations
diff --git a/deob/src/main/java/dev/openrs2/deob/Deobfuscator.java b/deob/src/main/java/dev/openrs2/deob/Deobfuscator.java
index f151fe32..09c5bf13 100644
--- a/deob/src/main/java/dev/openrs2/deob/Deobfuscator.java
+++ b/deob/src/main/java/dev/openrs2/deob/Deobfuscator.java
@@ -10,6 +10,7 @@ import com.google.common.collect.ImmutableList;
import dev.openrs2.asm.classpath.ClassPath;
import dev.openrs2.asm.classpath.Library;
import dev.openrs2.asm.transform.Transformer;
+import dev.openrs2.bundler.transform.RightClickTransformer;
import dev.openrs2.deob.remap.ClassNamePrefixer;
import dev.openrs2.deob.remap.TypedRemapper;
import dev.openrs2.deob.transform.BitShiftTransformer;
@@ -30,6 +31,7 @@ public final class Deobfuscator {
private static final Logger logger = LoggerFactory.getLogger(Deobfuscator.class);
private static final List TRANSFORMERS = List.of(
+ new RightClickTransformer(),
new OpaquePredicateTransformer(),
new ExceptionTracingTransformer(),
new BitShiftTransformer(),