Skip to content

Commit

Permalink
Fix the fix because it's piece of shit
Browse files Browse the repository at this point in the history
  • Loading branch information
EpiCanard committed Jun 27, 2023
1 parent e858400 commit 2909403
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>fr.freebuild</groupId>
<artifactId>shutup</artifactId>
<version>0.4</version>
<version>0.5</version>
<name>ShutUp</name>
<description>Plugin to prevent player to speak in chat</description>

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/freebuild/shutup/ShutUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
return false;
}

@EventHandler(priority=EventPriority.LOW)
@EventHandler(priority=EventPriority.HIGH)
public void onPlayerSendChatMessage(final AsyncPlayerChatEvent event) {
this.logger.debug("Player trying to send message in chat");
final Player player = event.getPlayer();

if (player != null && player.hasPermission("shutup") && !player.isOp()) {
this.logger.debug("The player is not allowed to send message in chat");
event.setMessage(null);
event.getRecipients().clear();
event.setCancelled(true);
player.sendMessage(ChatColor.RED + this.getConfig().getString("message", "Not allowed"));
}
Expand Down

0 comments on commit 2909403

Please sign in to comment.