Event4J icon indicating copy to clipboard operation
Event4J copied to clipboard

Allow clients to change how a HandlerList is retreived

Open Techcable opened this issue 9 years ago • 0 comments

Some clients (like Bukkit), make events implement an Event interface, that requires events to maintain HandlerLists themselves.

Clients would have to extend the EventBus to change this behavior:

private static final EventBus BUKKIT_EVENT_BUS = new EventBus() {
    @Override
    public HandlerList getHandlerList(Object eventObj) {
        Event event = (Event) eventObj;
        return event.getHandlers().event4jHandlerList;
    }
}

Techcable avatar Aug 01 '16 00:08 Techcable