From 99dc47f57b3f31f0cad83ecc76ef2c63bd68e057 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Thu, 15 Aug 2024 15:17:22 -0400 Subject: [PATCH] Fix L being dropped from @Shadow's Fixes #134 --- .../mixin/injection/struct/MemberInfo.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java b/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java index dcbdecf00..70545d4c0 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/struct/MemberInfo.java @@ -883,16 +883,6 @@ public static MemberInfo parse(final String input, final ISelectorContext contex if (context != null) { name = context.remap(name); } - - int lastDotPos = name.lastIndexOf('.'); - int semiColonPos = name.indexOf(';'); - if (lastDotPos > -1) { - owner = name.substring(0, lastDotPos).replace('.', '/'); - name = name.substring(lastDotPos + 1); - } else if (semiColonPos > -1 && name.startsWith("L")) { - owner = name.substring(1, semiColonPos).replace('.', '/'); - name = name.substring(semiColonPos + 1); - } int parenPos = name.indexOf('('); int colonPos = name.indexOf(':'); @@ -904,6 +894,16 @@ public static MemberInfo parse(final String input, final ISelectorContext contex name = name.substring(0, colonPos); } + int lastDotPos = name.lastIndexOf('.'); + int semiColonPos = name.indexOf(';'); + if (lastDotPos > -1) { + owner = name.substring(0, lastDotPos).replace('.', '/'); + name = name.substring(lastDotPos + 1); + } else if (semiColonPos > -1 && name.startsWith("L")) { + owner = name.substring(1, semiColonPos).replace('.', '/'); + name = name.substring(semiColonPos + 1); + } + if ((name.indexOf('/') > -1 || name.indexOf('.') > -1) && owner == null) { owner = name; name = "";