diff options
author | zml2008 <zach@zachsthings.com> | 2012-01-17 19:06:48 -0800 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2012-01-18 14:46:15 +0100 |
commit | 81dc1c0a520d53f92a8198bcec62e26700109d91 (patch) | |
tree | 45962f0cc6a3104d91645503789b49c731be3d2d /src | |
parent | 95e3f07b69c85103cdf8fac927add99ff50591d0 (diff) | |
download | bukkit-81dc1c0a520d53f92a8198bcec62e26700109d91.tar bukkit-81dc1c0a520d53f92a8198bcec62e26700109d91.tar.gz bukkit-81dc1c0a520d53f92a8198bcec62e26700109d91.tar.lz bukkit-81dc1c0a520d53f92a8198bcec62e26700109d91.tar.xz bukkit-81dc1c0a520d53f92a8198bcec62e26700109d91.zip |
Added a default to EventHandler.priority()
Fixed HandlerList.unregisterAll()
Fixed incorrect isAssignableFrom check in SimplePluginManager.getRegistrationClass()
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/event/EventHandler.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/event/HandlerList.java | 4 | ||||
-rw-r--r-- | src/main/java/org/bukkit/plugin/SimplePluginManager.java | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/event/EventHandler.java b/src/main/java/org/bukkit/event/EventHandler.java index afd09048..42c00368 100644 --- a/src/main/java/org/bukkit/event/EventHandler.java +++ b/src/main/java/org/bukkit/event/EventHandler.java @@ -11,5 +11,5 @@ public @interface EventHandler { Class<? extends Event> event(); - EventPriority priority(); + EventPriority priority() default EventPriority.NORMAL; } diff --git a/src/main/java/org/bukkit/event/HandlerList.java b/src/main/java/org/bukkit/event/HandlerList.java index 643939f2..601c3b63 100644 --- a/src/main/java/org/bukkit/event/HandlerList.java +++ b/src/main/java/org/bukkit/event/HandlerList.java @@ -50,7 +50,9 @@ public class HandlerList { public static void unregisterAll() { for (HandlerList h : alllists) { - h.handlerslots.clear(); + for (List<RegisteredListener> list : h.handlerslots.values()) { + list.clear(); + } h.baked = false; } } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java index 8411e5b0..63cf619d 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -471,7 +471,7 @@ public final class SimplePluginManager implements PluginManager { } catch (NoSuchMethodException e) { if (clazz.getSuperclass() != null && !clazz.getSuperclass().equals(Event.class) - && clazz.getSuperclass().isAssignableFrom(Event.class)) { + && Event.class.isAssignableFrom(clazz.getSuperclass())) { return getRegistrationClass(clazz.getSuperclass().asSubclass(Event.class)); } else { throw new IllegalPluginAccessException("Unable to find handler list for event " + clazz.getName()); |