aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/lll
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/ftbsc/lll')
-rw-r--r--src/main/java/ftbsc/lll/loader/LilleroLoader.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/ftbsc/lll/loader/LilleroLoader.java b/src/main/java/ftbsc/lll/loader/LilleroLoader.java
index 1db8544..1a881df 100644
--- a/src/main/java/ftbsc/lll/loader/LilleroLoader.java
+++ b/src/main/java/ftbsc/lll/loader/LilleroLoader.java
@@ -19,11 +19,9 @@ import java.net.URLClassLoader;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.EnumSet;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.ServiceLoader;
-import java.util.Set;
import java.util.stream.Collectors;
public class LilleroLoader implements ILaunchPluginService {
@@ -36,7 +34,6 @@ public class LilleroLoader implements ILaunchPluginService {
public static final String NAME = "lll-loader";
private List<IInjector> injectors = new ArrayList<>();
- private Set<IInjector> applied = new HashSet<>();
public LilleroLoader() {
LOGGER.info(INIT, "Patch Loader initialized");
@@ -90,7 +87,7 @@ public class LilleroLoader implements ILaunchPluginService {
// TODO can I make a set of target classes to make this faster
LOGGER.debug(HANDLER, "Inspecting class {}", classType.getClassName());
for (IInjector inj : this.injectors) {
- if (!this.applied.contains(inj) && inj.targetClass().equals(classType.getClassName())) {
+ if (inj.targetClass().equals(classType.getClassName())) {
LOGGER.info(HANDLER, "Marked class {} as handled by {}", classType.getClassName(), LilleroLoader.NAME);
return YAY;
}
@@ -105,7 +102,6 @@ public class LilleroLoader implements ILaunchPluginService {
public int processClassWithFlags(Phase phase, ClassNode classNode, Type classType, String reason) {
LOGGER.debug(PATCHER, "Processing class {} in phase {} of {}", classType.getClassName(), phase.name(), reason);
List<IInjector> relevantInjectors = this.injectors.stream()
- .filter(i -> !this.applied.contains(i))
.filter(i -> i.targetClass().equals(classType.getClassName()))
.collect(Collectors.toList());
boolean modified = false;
@@ -118,7 +114,6 @@ public class LilleroLoader implements ILaunchPluginService {
LOGGER.info(PATCHER, "Patching {}.{} with {} ({})", classType.getClassName(), method.name, inj.name(), inj.reason());
try {
inj.inject(classNode, method);
- this.applied.add(inj);
modified = true;
} catch (InjectionException e) {
LOGGER.error(PATCHER, "Error applying patch '{}' : {}", inj.name(), e.toString());
@@ -127,6 +122,6 @@ public class LilleroLoader implements ILaunchPluginService {
}
}
- return modified ? ComputeFlags.COMPUTE_FRAMES : ComputeFlags.NO_REWRITE;
+ return modified ? ComputeFlags.COMPUTE_FRAMES | ComputeFlags.COMPUTE_MAXS : ComputeFlags.NO_REWRITE;
}
}