diff --git a/docs/velocity/dev/api/event.mdx b/docs/velocity/dev/api/event.mdx index 2ce5449a..c06211bd 100644 --- a/docs/velocity/dev/api/event.mdx +++ b/docs/velocity/dev/api/event.mdx @@ -33,20 +33,25 @@ and _not_ in `com.google.common.eventbus`. ## Orders -Every listener has a `PostOrder`. -When an event is fired, the order in which listeners are invoked is defined by their `PostOrder`. -Listeners using `PostOrder.FIRST` are called first, then `EARLY`, `NORMAL`, etc. +Every listener has a `priority`. +When an event is fired, the order in which listeners are invoked is defined by their `priority`. +The higher the priority, the earlier the event handler will be called. State the desired order in the `@Subscribe` annotation: ```java -@Subscribe(order = PostOrder.NORMAL) +@Subscribe(priority = 0, order = PostOrder.CUSTOM) public void onPlayerChat(PlayerChatEvent event) { // do stuff } ``` -`NORMAL` is the default value if you do not specify an order. +`-32768` is the default value if you do not specify an order. +:::note + +Due to compatibility constraints, you must specify `PostOrder.CUSTOM` in order to use this field. + +::: ## Registering listeners @@ -121,12 +126,12 @@ return an `Continuation` parameter: ```java - @Subscribe(order = PostOrder.EARLY) + @Subscribe(priority = 100, order = PostOrder.CUSTOM) public void onLogin(LoginEvent event, Continuation continuation) { doSomeAsyncProcessing().addListener(continuation::resume, continuation::resumeWithException); } - @Subscribe(order = PostOrder.EARLY) + @Subscribe(priority = 100, order = PostOrder.CUSTOM) public EventTask onPlayerChat(PlayerChatEvent event) { if (mustFurtherProcess(event)) { return EventTask.async(() => ...);