mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-22 23:39:44 +00:00
Fix usage of asterisk (matchAll) selectors for injector targets
This commit is contained in:
1 parent
af60286192
commit
7205be2d68
2 files changed
+12
-4
No files matched your search
@@ -356,7 +356,7 @@ public class CallbackInjector extends Injector {
|
||||
MethodNode callbackMethod = this.methodNode;
|
||||
|
||||
if (!callback.checkDescriptor(this.methodNode.desc)) {
|
||||
if (this.info.getTargets().size() != 0) {
|
||||
if (this.info.getTargets().size() > 1) {
|
||||
return; // Look for a match in other targets before failing
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ public class CallbackInjector extends Injector {
|
||||
this.injectCancellationCode(callback);
|
||||
|
||||
callback.inject();
|
||||
this.info.getTargets().clear();
|
||||
this.info.notifyInjected(callback.target);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -228,8 +228,9 @@ public abstract class InjectionInfo {
|
||||
* Discover injection points
|
||||
*/
|
||||
public void prepare() {
|
||||
while (this.targets.size() > 0) {
|
||||
Target target = this.mixin.getTargetMethod(this.targets.removeFirst());
|
||||
this.targetNodes.clear();
|
||||
for (MethodNode targetMethod : this.targets) {
|
||||
Target target = this.mixin.getTargetMethod(targetMethod);
|
||||
this.targetNodes.put(target, this.injector.find(target, this.injectionPoints));
|
||||
}
|
||||
}
|
||||
@@ -241,6 +242,7 @@ public abstract class InjectionInfo {
|
||||
for (Entry<Target, List<InjectionNode>> entry : this.targetNodes.entrySet()) {
|
||||
this.injector.inject(entry.getKey(), entry.getValue());
|
||||
}
|
||||
this.targets.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -262,6 +264,11 @@ public abstract class InjectionInfo {
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyInjected(Target target) {
|
||||
// this.targets.remove(target.method);
|
||||
}
|
||||
|
||||
|
||||
protected String getDescription() {
|
||||
return "Callback method";
|
||||
}
|
||||
@@ -401,4 +408,5 @@ public abstract class InjectionInfo {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user