Skip to content

Commit

Permalink
Versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
roccodev committed Apr 17, 2019
1 parent 31742f0 commit dda155e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Beezig
8 changes: 1 addition & 7 deletions src/main/java/eu/the5zig/mod/plugin/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,7 @@ public void unregisterListener(Object plugin, Object listener) {
if (method.isAnnotationPresent(EventHandler.class) && method.getParameterTypes().length == 1 && Event.class.isAssignableFrom(method.getParameterTypes()[0])) {
final Class<? extends Event> eventClass = (Class<? extends Event>)method.getParameterTypes()[0];
final List<RegisteredEventHandler> eventHandlers = this.registeredEvents.get(eventClass);
final Iterator<RegisteredEventHandler> iterator = eventHandlers.iterator();
while (iterator.hasNext()) {
final RegisteredEventHandler registeredEventHandler = iterator.next();
if (registeredEventHandler.getInstance() == listener && registeredEventHandler.getMethod().equals(method)) {
iterator.remove();
}
}
eventHandlers.removeIf(registeredEventHandler -> registeredEventHandler.getInstance() == listener && registeredEventHandler.getMethod().equals(method));
Collections.sort(eventHandlers);
}
}
Expand Down

0 comments on commit dda155e

Please sign in to comment.