Skip to content

Commit b559e1e

Browse files
committed
Add missing rewrite rules
1 parent d46c4bc commit b559e1e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
3+
Date: Tue, 9 Nov 2077 00:00:00 +0800
4+
Subject: [PATCH] Add missing rewrite rules
5+
6+
Tracking PR: https://github.com/PaperMC/asm-utils/pull/48
7+
8+
diff --git a/src/main/java/io/papermc/paper/pluginremap/reflect/ReflectionRemapper.java b/src/main/java/io/papermc/paper/pluginremap/reflect/ReflectionRemapper.java
9+
index a3045afbc0cc057e99189b909367b21cf6a9e03f..2831b8b48a12815f8fb7e82327f654e90d1530a3 100644
10+
--- a/src/main/java/io/papermc/paper/pluginremap/reflect/ReflectionRemapper.java
11+
+++ b/src/main/java/io/papermc/paper/pluginremap/reflect/ReflectionRemapper.java
12+
@@ -22,7 +22,14 @@ public final class ReflectionRemapper {
13+
private static final RewriteRuleVisitorFactory VISITOR_FACTORY = RewriteRuleVisitorFactory.create(
14+
Opcodes.ASM9,
15+
chain -> chain.then(new BaseReflectionRules(PAPER_REFLECTION_HOLDER).rules())
16+
- .then(DefineClassRule.create(PAPER_REFLECTION_HOLDER_DESC, true)),
17+
+ // Leaf start - Add missing rewrite rules
18+
+ .then(
19+
+ io.papermc.asm.rules.RewriteRule.forOwnerClass(Class.class, rf -> {
20+
+ rf.plainStaticRewrite(java.lang.constant.ClassDesc.of(PAPER_REFLECTION_HOLDER), b -> b
21+
+ .match("forName").desc("(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;", "(Ljava/lang/Module;Ljava/lang/String;)Ljava/lang/Class;"));
22+
+ })
23+
+ ).then(DefineClassRule.create(PAPER_REFLECTION_HOLDER_DESC, true)),
24+
+ // Leaf end - Add missing rewrite rules
25+
ClassInfoProvider.basic()
26+
);
27+

0 commit comments

Comments
 (0)