diff options
author | syeyoung <cyoung06@naver.com> | 2022-11-18 03:16:58 +0900 |
---|---|---|
committer | syeyoung <cyoung06@naver.com> | 2022-11-18 03:16:58 +0900 |
commit | cf705024fe4e54f8ffcab74a08c21fe9fc89e9dd (patch) | |
tree | 6ecd46dd19d3d29ef7ba37f79c0d6731d76286e8 /loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events | |
parent | 5ba0fb7ab33e71d28e62910568de0865bbfe3c8c (diff) | |
download | Skyblock-Dungeons-Guide-cf705024fe4e54f8ffcab74a08c21fe9fc89e9dd.tar.gz Skyblock-Dungeons-Guide-cf705024fe4e54f8ffcab74a08c21fe9fc89e9dd.tar.bz2 Skyblock-Dungeons-Guide-cf705024fe4e54f8ffcab74a08c21fe9fc89e9dd.zip |
- cleanup pain
Signed-off-by: syeyoung <cyoung06@naver.com>
Diffstat (limited to 'loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events')
-rw-r--r-- | loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java index 3475e672..83f78720 100644 --- a/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java +++ b/loader/src/main/java/kr/syeyoung/dungeonsguide/launcher/events/OwnerAwareASMEventHandler.java @@ -4,6 +4,7 @@ import static org.objectweb.asm.Opcodes.*; import java.lang.reflect.Method; import java.util.HashMap; +import java.util.WeakHashMap; import net.minecraftforge.fml.common.ModContainer; @@ -24,7 +25,6 @@ public class OwnerAwareASMEventHandler implements IEventListener private static int IDs = 0; private static final String HANDLER_DESC = Type.getInternalName(IEventListener.class); private static final String HANDLER_FUNC_DESC = Type.getMethodDescriptor(IEventListener.class.getDeclaredMethods()[0]); - private static final HashMap<Method, Class<?>> cache = Maps.newHashMap(); private static final boolean GETCONTEXT = Boolean.parseBoolean(System.getProperty("fml.LogContext", "false")); private final IEventListener handler; @@ -63,11 +63,6 @@ public class OwnerAwareASMEventHandler implements IEventListener public Class<?> createWrapper(Method callback) { - if (cache.containsKey(callback)) - { - return cache.get(callback); - } - ClassWriter cw = new ClassWriter(0); MethodVisitor mv; @@ -116,9 +111,7 @@ public class OwnerAwareASMEventHandler implements IEventListener mv.visitEnd(); } cw.visitEnd(); - Class<?> ret = new ASMClassLoader(callback.getDeclaringClass().getClassLoader()).define(name, cw.toByteArray()); - cache.put(callback, ret); - return ret; + return new ASMClassLoader(callback.getDeclaringClass().getClassLoader()).define(name, cw.toByteArray()); } private String getUniqueName(Method callback) |