diff options
author | Feildmaster <admin@feildmaster.com> | 2012-01-25 09:49:12 -0600 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-02-13 01:08:15 -0500 |
commit | 0706671a0aeba200fce3587f70f57a24ffbb3614 (patch) | |
tree | 110b188dd77680558de28434d1f512cd371c80ca | |
parent | f0f593c95612ccd2a54b57e539b61f3dc9e80b51 (diff) | |
download | bukkit-0706671a0aeba200fce3587f70f57a24ffbb3614.tar bukkit-0706671a0aeba200fce3587f70f57a24ffbb3614.tar.gz bukkit-0706671a0aeba200fce3587f70f57a24ffbb3614.tar.lz bukkit-0706671a0aeba200fce3587f70f57a24ffbb3614.tar.xz bukkit-0706671a0aeba200fce3587f70f57a24ffbb3614.zip |
[Bleeding] Added ability to register and listen to SubEvents. Addresses
BUKKIT-585
-rw-r--r-- | src/main/java/org/bukkit/plugin/SimplePluginManager.java | 7 | ||||
-rw-r--r-- | src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java index 3dff6d23..e454c864 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -537,12 +537,7 @@ public final class SimplePluginManager implements PluginManager { } for (Map.Entry<Class<? extends Event>, Set<RegisteredListener>> entry : plugin.getPluginLoader().createRegisteredListeners(listener, plugin).entrySet()) { - Class<? extends Event> delegatedClass = getRegistrationClass(entry.getKey()); - if (!entry.getKey().equals(delegatedClass)) { - plugin.getServer().getLogger().severe("Plugin attempted to register delegated event class " + entry.getKey() + ". It should be using " + delegatedClass + "!"); - continue; - } - getEventListeners(delegatedClass).registerAll(entry.getValue()); + getEventListeners(getRegistrationClass(entry.getKey())).registerAll(entry.getValue()); } } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java index 790dd5e9..20e0a547 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -1019,7 +1019,7 @@ public class JavaPluginLoader implements PluginLoader { public void execute(Listener listener, Event event) throws EventException { try { if (!eventClass.isAssignableFrom(event.getClass())) { - throw new EventException("Wrong event type passed to registered method"); + return; } method.invoke(listener, event); } catch (Throwable t) { |