mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
Don't send events to disabled plugins.
This commit is contained in:
parent
b2f0af9499
commit
42f7a6b8e4
1 changed files with 23 additions and 23 deletions
|
@ -331,10 +331,11 @@ public final class SimplePluginManager implements PluginManager {
|
||||||
* @param event Event details
|
* @param event Event details
|
||||||
*/
|
*/
|
||||||
public synchronized void callEvent(Event event) {
|
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 {
|
try {
|
||||||
long start = System.nanoTime();
|
long start = System.nanoTime();
|
||||||
registration.callEvent(event);
|
registration.callEvent(event);
|
||||||
|
@ -362,7 +363,6 @@ public final class SimplePluginManager implements PluginManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers the given event to the specified listener
|
* Registers the given event to the specified listener
|
||||||
|
|
Loading…
Add table
Reference in a new issue