Updated timing code for new event system

By: Tahg <tahgtahv@gmail.com>
This commit is contained in:
Bukkit/Spigot
2012-01-16 15:03:41 -05:00
parent b19803ff66
commit 05b6ad92d1
8 changed files with 169 additions and 33 deletions

View File

@@ -132,4 +132,22 @@ public class HandlerList {
public RegisteredListener[][] getRegisteredListeners() {
return handlers;
}
public static ArrayList<RegisteredListener> getRegisteredListeners(Plugin plugin) {
ArrayList<RegisteredListener> listeners = new ArrayList<RegisteredListener>();
for (HandlerList h : alllists) {
for (List<RegisteredListener> list : h.handlerslots.values()) {
for (RegisteredListener listener : list) {
if (listener.getPlugin().equals(plugin)) {
listeners.add(listener);
}
}
}
}
return listeners;
}
public static ArrayList<HandlerList> getHandlerLists() {
return (ArrayList<HandlerList>) alllists.clone();
}
}