forked from awumii/EpicGuard
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(paper): Improved listeners registration performance
- Loading branch information
Showing
8 changed files
with
152 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
paper/src/main/java/me/xneox/epicguard/paper/listener/PaperListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package me.xneox.epicguard.paper.listener; | ||
|
||
import org.bukkit.event.Event; | ||
import org.bukkit.event.EventPriority; | ||
|
||
public interface PaperListener<E extends Event> { | ||
@SuppressWarnings("unchecked") | ||
default void handle(Object o) { | ||
this.handle((E)o); | ||
} | ||
void handle(E event); | ||
|
||
Class<E> clazz(); | ||
|
||
default boolean ignoreCancelled() { | ||
return true; | ||
} | ||
|
||
default EventPriority priority() { | ||
return EventPriority.NORMAL; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters