summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2015-06-01 16:43:22 +1000
committermd_5 <git@md-5.net>2015-06-01 16:53:00 +1000
commita5af83911d4d1ea1267b256e02e080800ced298f (patch)
tree95c99e21201b630202c1fcf175e7fedca7a8ac0b
parent958a8d04a6d426decd03c28e889909dd47545af7 (diff)
downloadbukkit-a5af83911d4d1ea1267b256e02e080800ced298f.tar
bukkit-a5af83911d4d1ea1267b256e02e080800ced298f.tar.gz
bukkit-a5af83911d4d1ea1267b256e02e080800ced298f.tar.lz
bukkit-a5af83911d4d1ea1267b256e02e080800ced298f.tar.xz
bukkit-a5af83911d4d1ea1267b256e02e080800ced298f.zip
[SPIGOT-950] Make handlerList requirement really obvious.
-rw-r--r--src/main/java/org/bukkit/event/Event.java2
-rw-r--r--src/main/java/org/bukkit/plugin/SimplePluginManager.java2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java
index fa29c27e..6677e1bd 100644
--- a/src/main/java/org/bukkit/event/Event.java
+++ b/src/main/java/org/bukkit/event/Event.java
@@ -5,6 +5,8 @@ import org.bukkit.plugin.PluginManager;
/**
* Represents an event.
*
+ * All events require a static method named getHandlerList() which returns the same {@link HandlerList} as {@link #getHandlers()}.
+ *
* @see PluginManager#callEvent(Event)
* @see PluginManager#registerEvents(Listener,Plugin)
*/
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index d2fe422c..e51658df 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -582,7 +582,7 @@ public final class SimplePluginManager implements PluginManager {
&& 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());
+ throw new IllegalPluginAccessException("Unable to find handler list for event " + clazz.getName() + ". Static getHandlerList method required!");
}
}
}