SpongePowered/Sponge — pull request #50 by Raphfrk (2014-09-20 15:36:46+00:00)
Title: Event Handling change

This removes direct accessing of the Forge ListenerLists in their EventBus. An EventListenerHolder is registered with Forge for each event-type & priority pair. If the last listener in the holder is unregistered, then the holder is unregistered with Forge.

EventListenerHolders are generated dynamically using ASM so they have the SubscribeEvent annotation with the correct priority and cancel status.

The EventListenerHolders calls all the sponge listeners. Priorities are grouped since Sponge has more priorities than Forge.

PRE & AFTER_PRE run at HIGHEST priority
FIRST & EARLY run at HIGH priority
DEFAULT runs at NORMAL priority
LATE & LAST run at LOW priority
BEFORE_POST & POST run at LOWEST priority