Log unhandled dead events

This commit is contained in:
2021-02-20 21:40:48 +01:00
parent 0036dc4829
commit b2fe3a9d6c
4 changed files with 34 additions and 11 deletions

View File

@ -84,7 +84,13 @@ public final class EventBus {
handlers.next().execute(event);
}
} else if (!(event instanceof DeadEvent)) {
// Dispatch dead event
dispatch(new DeadEvent(this, event));
} else {
// Warn about the dead event not being handled
logger.log(Level.WARNING, "{0} not handled", event);
}
// Reset dispatch state