Fix implicit accessors and invokers

They get given the handler's name to guess the target field/method, no good if it guessing with the mod suffix too
This commit is contained in:
Chocohead authored and modmuss50 committed 2023-02-16 15:32:15 +00:00
1 parent 67997b1a0d
commit d4b07c0e31
2 files changed
+4 -2

No files matched your search

@@ -50,6 +50,7 @@ import org.spongepowered.asm.mixin.transformer.MixinTargetContext;
import org.spongepowered.asm.service.MixinService;
import org.spongepowered.asm.util.Annotations;
import org.spongepowered.asm.util.Bytecode;
import org.spongepowered.asm.util.asm.MethodNodeEx;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
@@ -355,7 +356,7 @@ public class AccessorInfo extends SpecialMethodInfo {
* <tt>foo</tt> for example.
*/
protected String inflectTarget() {
return AccessorInfo.inflectTarget(this.method.name, this.type, this.toString(), this,
return AccessorInfo.inflectTarget(MethodNodeEx.getName(this.method), this.type, this.toString(), this,
this.mixin.getEnvironment().getOption(Option.DEBUG_VERBOSE));
}
@@ -37,6 +37,7 @@ import org.spongepowered.asm.mixin.injection.struct.MemberInfo;
import org.spongepowered.asm.mixin.transformer.MixinTargetContext;
import org.spongepowered.asm.util.Bytecode;
import org.spongepowered.asm.util.Constants;
import org.spongepowered.asm.util.asm.MethodNodeEx;
/**
* Information about an invoker
@@ -54,7 +55,7 @@ class InvokerInfo extends AccessorInfo {
return this.initType(mappedReference.replace('.', '/'), this.mixin.getTargetClassRef());
}
AccessorName accessorName = AccessorName.of(this.method.name, false);
AccessorName accessorName = AccessorName.of(MethodNodeEx.getName(this.method), false);
if (accessorName != null) {
for (String prefix : AccessorType.OBJECT_FACTORY.getExpectedPrefixes()) {
if (prefix.equals(accessorName.prefix)) {