Skip to content

Commit 9993fd9

Browse files
committed
small fix
1 parent c751787 commit 9993fd9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/de/blazemcworld/jsscripts/Injector.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class Injector {
1919
private static final Instrumentation inst = ByteBuddyAgent.getInstrumentation();
2020
private static final List<ClassFileTransformer> transformers = new ArrayList<>();
2121
private static final List<InjectionCallback> callbacks = new ArrayList<>();
22-
private static final List<Object> callbackInfo = new ArrayList<>();
22+
private static List<Object> callbackInfo = new ArrayList<>();
2323

2424
@SuppressWarnings("unused")
2525
public static int registerCallback(InjectionCallback cb) {
@@ -34,9 +34,9 @@ public static void addCallbackInfo(Object info) {
3434

3535
@SuppressWarnings("unused")
3636
public static Object invokeCallback(int id) {
37-
Object result = callbacks.get(id).invoke(callbackInfo);
38-
callbackInfo.clear();
39-
return result;
37+
List<Object> info = callbackInfo;
38+
callbackInfo = new ArrayList<>();
39+
return callbacks.get(id).invoke(callbackInfo);
4040
}
4141

4242
public static void transformMethod(String className, String methodName, Consumer<MethodNode> transformer) {

0 commit comments

Comments
 (0)