From 31e16e753137cffb4660960529cbba7934741542 Mon Sep 17 00:00:00 2001 From: JaTiTV Date: Fri, 28 Jan 2022 22:07:56 +0100 Subject: [PATCH] perm fix --- pom.xml | 2 +- .../Spigot/event/ResponseListener.java | 34 +++++++++---------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 3729b67..6ed9d3e 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.t2code AutoResponse - 0.0.1-DEV + 0.0.1-DEV-2 jar T2C-AutoResponse diff --git a/src/main/java/net/t2code/autoresponse/Spigot/event/ResponseListener.java b/src/main/java/net/t2code/autoresponse/Spigot/event/ResponseListener.java index 3493bdc..ad8f1ba 100644 --- a/src/main/java/net/t2code/autoresponse/Spigot/event/ResponseListener.java +++ b/src/main/java/net/t2code/autoresponse/Spigot/event/ResponseListener.java @@ -25,28 +25,26 @@ public class ResponseListener implements Listener { public static void ChatListener(AsyncPlayerChatEvent e) { Player player = e.getPlayer(); boolean bool = false; - for (String s : Main.allResponse){ + for (String s : Main.allResponse) { if (e.getMessage().contains(s)) bool = true; } if (!bool) return; for (ResponsesObject response : Main.allResponses) { - if (response.permNecessary) { - if (player.hasPermission(response.permission)) { - send.debugmsg(Main.plugin, "key: " + response.responseKey); - if (response.contains) { - send.debugmsg(Main.plugin, "1"); - if (e.getMessage().contains(response.responseKey)) { - send.debugmsg(Main.plugin, "2"); - execute(e, player, response); - return; - } - } else { - send.debugmsg(Main.plugin, "3"); - if (e.getMessage().equals(response.responseKey)) { - send.debugmsg(Main.plugin, "4"); - execute(e, player, response); - return; - } + if (!response.permNecessary || player.hasPermission(response.permission)) { + send.debugmsg(Main.plugin, "key: " + response.responseKey); + if (response.contains) { + send.debugmsg(Main.plugin, "1"); + if (e.getMessage().contains(response.responseKey)) { + send.debugmsg(Main.plugin, "2"); + execute(e, player, response); + return; + } + } else { + send.debugmsg(Main.plugin, "3"); + if (e.getMessage().equals(response.responseKey)) { + send.debugmsg(Main.plugin, "4"); + execute(e, player, response); + return; } } }