From a5f229ed017651f0367165f0456d49f10dda0bcd Mon Sep 17 00:00:00 2001 From: Raphfrk Date: Tue, 16 Sep 2014 21:48:29 +0100 Subject: [PATCH] Added extra priorities to support Sponge --- .../java/cpw/mods/fml/common/eventhandler/EventBus.java | 4 ++++ .../cpw/mods/fml/common/eventhandler/EventPriority.java | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/cpw/mods/fml/common/eventhandler/EventBus.java b/src/main/java/cpw/mods/fml/common/eventhandler/EventBus.java index 100ce9eff..617860c72 100644 --- a/src/main/java/cpw/mods/fml/common/eventhandler/EventBus.java +++ b/src/main/java/cpw/mods/fml/common/eventhandler/EventBus.java @@ -147,6 +147,10 @@ public boolean post(Event event) return (event.isCancelable() ? event.isCanceled() : false); } + public int getBusID() { + return busID; + } + @Override public void handleException(EventBus bus, Event event, IEventListener[] listeners, int index, Throwable throwable) { diff --git a/src/main/java/cpw/mods/fml/common/eventhandler/EventPriority.java b/src/main/java/cpw/mods/fml/common/eventhandler/EventPriority.java index e9b54f61e..e07a59f1d 100644 --- a/src/main/java/cpw/mods/fml/common/eventhandler/EventPriority.java +++ b/src/main/java/cpw/mods/fml/common/eventhandler/EventPriority.java @@ -8,11 +8,15 @@ public enum EventPriority implements IEventListener * Due to using a ArrayList in the ListenerList, * these need to stay in a contiguous index starting at 0. {Default ordinal} */ - HIGHEST, //First to execute + PRE, //First to execute. Cancellation is not allowed + AFTER_PRE, //Cancellation is not allowed + HIGHEST, //First standard priority to execute HIGH, NORMAL, LOW, - LOWEST //Last to execute + LOWEST, //Last standard priority to execute + BEFORE_POST, //Cancellation is not allowed + POST //Last to execute. Cancellation is not allowed ; @Override