diff --git a/paper-api/src/main/java/org/bukkit/event/EventHandler.java b/paper-api/src/main/java/org/bukkit/event/EventHandler.java index afd0904841..42c0036887 100644 --- a/paper-api/src/main/java/org/bukkit/event/EventHandler.java +++ b/paper-api/src/main/java/org/bukkit/event/EventHandler.java @@ -11,5 +11,5 @@ public @interface EventHandler { Class event(); - EventPriority priority(); + EventPriority priority() default EventPriority.NORMAL; } diff --git a/paper-api/src/main/java/org/bukkit/event/HandlerList.java b/paper-api/src/main/java/org/bukkit/event/HandlerList.java index 643939f288..601c3b63a5 100644 --- a/paper-api/src/main/java/org/bukkit/event/HandlerList.java +++ b/paper-api/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 list : h.handlerslots.values()) { + list.clear(); + } h.baked = false; } } diff --git a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java index 8411e5b0fb..63cf619d81 100644 --- a/paper-api/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/paper-api/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());