Skip to content

Commit

Permalink
Potential fix for other chat formatters conflicting with SSB's readin…
Browse files Browse the repository at this point in the history
…g messages of players as inputs (#1244)
  • Loading branch information
OmerBenGera committed Jul 14, 2022
1 parent 007dafc commit 6f9a2d6
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,15 +558,17 @@ private void onPlayerDamage(EntityDamageEvent e) {

/* CHAT */

@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onPlayerAsyncChat(AsyncPlayerChatEvent e) {
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
private void onPlayerAsyncChatLowest(AsyncPlayerChatEvent e) {
// PlayerChat should be on LOWEST priority so other chat plugins don't conflict.
PlayerChat playerChat = PlayerChat.getChatListener(e.getPlayer());

if (playerChat != null && playerChat.supply(e.getMessage())) {
e.setCancelled(true);
return;
}
}

@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
private void onPlayerAsyncChat(AsyncPlayerChatEvent e) {
SuperiorPlayer superiorPlayer = plugin.getPlayers().getSuperiorPlayer(e.getPlayer());
Island island = superiorPlayer.getIsland();

Expand Down

0 comments on commit 6f9a2d6

Please sign in to comment.