Skip to content

Commit

Permalink
add bypass permission for admins
Browse files Browse the repository at this point in the history
  • Loading branch information
xGinko committed May 27, 2023
1 parent 835cb30 commit 85c086e
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ private static boolean isSuspectedScanPacket(String buffer) {

@EventHandler(priority = EventPriority.HIGHEST)
private void onAsyncCommandTabComplete(AsyncTabCompleteEvent event) {
if (event.getSender().hasPermission("anarchyexploitfixes.chatbypass")) return;
if (!(event.getSender() instanceof Player)) return;
if (isSuspectedScanPacket(event.getBuffer())) {
event.setCancelled(true);
Expand All @@ -48,6 +49,7 @@ private void onAsyncCommandTabComplete(AsyncTabCompleteEvent event) {

@EventHandler(priority = EventPriority.NORMAL)
private void onCommandTabComplete(TabCompleteEvent event) {
if (event.getSender().hasPermission("anarchyexploitfixes.chatbypass")) return;
if (!(event.getSender() instanceof Player)) return;
if (isSuspectedScanPacket(event.getBuffer())) {
event.setCancelled(true);
Expand Down

0 comments on commit 85c086e

Please sign in to comment.