From f41391b13cff0605161d512c308029b7041d7759 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 13 Aug 2012 16:15:11 -0400 Subject: [PATCH] FMLModcontainer should not complain about annotations it has no idea about. so stfu fmlmodcontainer --- .../cpw/mods/fml/common/FMLModContainer.java | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/fml/common/cpw/mods/fml/common/FMLModContainer.java b/fml/common/cpw/mods/fml/common/FMLModContainer.java index 8d63ce4d3f..2bebe7994e 100644 --- a/fml/common/cpw/mods/fml/common/FMLModContainer.java +++ b/fml/common/cpw/mods/fml/common/FMLModContainer.java @@ -220,16 +220,19 @@ public class FMLModContainer implements ModContainer { for (Annotation a : m.getAnnotations()) { - Class[] paramTypes = new Class[] { modTypeAnnotations.get(a.annotationType()) }; + if (modTypeAnnotations.containsKey(a.annotationType())) + { + Class[] paramTypes = new Class[] { modTypeAnnotations.get(a.annotationType()) }; - if (Arrays.equals(m.getParameterTypes(), paramTypes)) - { - m.setAccessible(true); - anns.put(a.annotationType(), m); - } - else - { - FMLLog.severe("The mod %s appears to have an invalid method annotation %s. This annotation can only apply to methods with argument types %s -it will not be called", getModId(), a.annotationType().getSimpleName(), Arrays.toString(paramTypes)); + if (Arrays.equals(m.getParameterTypes(), paramTypes)) + { + m.setAccessible(true); + anns.put(a.annotationType(), m); + } + else + { + FMLLog.severe("The mod %s appears to have an invalid method annotation %s. This annotation can only apply to methods with argument types %s -it will not be called", getModId(), a.annotationType().getSimpleName(), Arrays.toString(paramTypes)); + } } } }