neoforged / Bus

Event firing and listening framework, based on the event bus concept
GNU Lesser General Public License v2.1
3 stars 8 forks source link

Add postPhase method to control event phases across multiple busses #12

Closed Technici4n closed 1 year ago

Technici4n commented 1 year ago

(Note: this includes #11, please see the second commit only)

Add a postPhase method that will allow us to fix event priorities across mod event busses in FML. See:

var event = new TestEvent();
for (var phase : EventPriority.values()) {
    event.setPhase(phase);
    for (var bus : busses) {
        bus.postPhase(phase, event);
    }
}