summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeildmaster <admin@feildmaster.com>2012-01-15 02:14:28 -0600
committerNathan Adams <dinnerbone@dinnerbone.com>2012-01-15 08:18:44 +0000
commit42f7a6b8e48edd61fb075c8a29a044050e5e80b7 (patch)
tree8a97f3471d1106ac025af470bfdfd8c5285b7f86
parentb2f0af9499e4d3785b13549ce40878ff482e4968 (diff)
downloadbukkit-42f7a6b8e48edd61fb075c8a29a044050e5e80b7.tar
bukkit-42f7a6b8e48edd61fb075c8a29a044050e5e80b7.tar.gz
bukkit-42f7a6b8e48edd61fb075c8a29a044050e5e80b7.tar.lz
bukkit-42f7a6b8e48edd61fb075c8a29a044050e5e80b7.tar.xz
bukkit-42f7a6b8e48edd61fb075c8a29a044050e5e80b7.zip
Don't send events to disabled plugins.
-rw-r--r--src/main/java/org/bukkit/plugin/SimplePluginManager.java52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index fb19a2ea..5e8615d0 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -331,35 +331,35 @@ public final class SimplePluginManager implements PluginManager {
* @param event Event details
*/
public synchronized void callEvent(Event event) {
- SortedSet<RegisteredListener> eventListeners = listeners.get(event.getType());
+ for (RegisteredListener registration : getEventListeners(event.getType())) {
+ if(!registration.getPlugin().isEnabled()) {
+ continue;
+ }
- if (eventListeners != null) {
- for (RegisteredListener registration : eventListeners) {
- try {
- long start = System.nanoTime();
- registration.callEvent(event);
- registration.getPlugin().incTiming(event.getType(), System.nanoTime() - start);
- } catch (AuthorNagException ex) {
- Plugin plugin = registration.getPlugin();
-
- if (plugin.isNaggable()) {
- plugin.setNaggable(false);
-
- String author = "<NoAuthorGiven>";
-
- if (plugin.getDescription().getAuthors().size() > 0) {
- author = plugin.getDescription().getAuthors().get(0);
- }
- server.getLogger().log(Level.SEVERE, String.format(
- "Nag author: '%s' of '%s' about the following: %s",
- author,
- plugin.getDescription().getName(),
- ex.getMessage()
- ));
+ try {
+ long start = System.nanoTime();
+ registration.callEvent(event);
+ registration.getPlugin().incTiming(event.getType(), System.nanoTime() - start);
+ } catch (AuthorNagException ex) {
+ Plugin plugin = registration.getPlugin();
+
+ if (plugin.isNaggable()) {
+ plugin.setNaggable(false);
+
+ String author = "<NoAuthorGiven>";
+
+ if (plugin.getDescription().getAuthors().size() > 0) {
+ author = plugin.getDescription().getAuthors().get(0);
}
- } catch (Throwable ex) {
- server.getLogger().log(Level.SEVERE, "Could not pass event " + event.getType() + " to " + registration.getPlugin().getDescription().getName(), ex);
+ server.getLogger().log(Level.SEVERE, String.format(
+ "Nag author: '%s' of '%s' about the following: %s",
+ author,
+ plugin.getDescription().getName(),
+ ex.getMessage()
+ ));
}
+ } catch (Throwable ex) {
+ server.getLogger().log(Level.SEVERE, "Could not pass event " + event.getType() + " to " + registration.getPlugin().getDescription().getName(), ex);
}
}
}