There could be a better event system with:
- Priority.
- LOWEST, LOW, MEDIUM, HIGH and HIGHEST.
- Cancelability.
- Being able to cancel events would be useful.
- Inheritance.
- That is, instead of having to modify the event bus every time you wanna add a new event, you just add the new event.
- Multiple handlers for the same event.
- You could have multiple methods with different names but listening to the same event.
- Annotations.
Example:
@EventHandler
public void onMessage(MessageEvent event) {
// * stuff here * //
}
@EventHandler(priority=Priority.HIGHEST)
public void onBotMessage(MessageEvent event) {
if (event.getUser().getName() == "botName")
event.setCanceled(true);
}
There could be a better event system with:
Example: