mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-17 14:37:43 +01:00
Allow arbitrary post orders
This commit is contained in:
@@ -46,7 +46,7 @@ public interface EventManager {
|
||||
* @param handler the handler to register
|
||||
* @param <E> the event type to handle
|
||||
*/
|
||||
<E> void register(Object plugin, Class<E> eventClass, PostOrder postOrder,
|
||||
<E> void register(Object plugin, Class<E> eventClass, short postOrder,
|
||||
EventHandler<E> handler);
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,8 +10,12 @@ package com.velocitypowered.api.event;
|
||||
/**
|
||||
* Represents the order an event will be posted to a listener method, relative to other listeners.
|
||||
*/
|
||||
public enum PostOrder {
|
||||
public class PostOrder {
|
||||
|
||||
FIRST, EARLY, NORMAL, LATE, LAST
|
||||
public static final short FIRST = -32768;
|
||||
public static final short EARLY = -16384;
|
||||
public static final short NORMAL = 0;
|
||||
public static final short LATE = 16834;
|
||||
public static final short LAST = 32767;
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ public @interface Subscribe {
|
||||
*
|
||||
* @return the order
|
||||
*/
|
||||
PostOrder order() default PostOrder.NORMAL;
|
||||
short order() default PostOrder.NORMAL;
|
||||
|
||||
/**
|
||||
* Whether the handler must be called asynchronously.
|
||||
|
||||
Reference in New Issue
Block a user