This commit is contained in:
JaTiTV 2022-01-28 22:07:56 +01:00
parent 99b867a578
commit 31e16e7531
2 changed files with 17 additions and 19 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>AutoResponse</artifactId> <artifactId>AutoResponse</artifactId>
<version>0.0.1-DEV</version> <version>0.0.1-DEV-2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>T2C-AutoResponse</name> <name>T2C-AutoResponse</name>

View File

@ -25,28 +25,26 @@ public class ResponseListener implements Listener {
public static void ChatListener(AsyncPlayerChatEvent e) { public static void ChatListener(AsyncPlayerChatEvent e) {
Player player = e.getPlayer(); Player player = e.getPlayer();
boolean bool = false; boolean bool = false;
for (String s : Main.allResponse){ for (String s : Main.allResponse) {
if (e.getMessage().contains(s)) bool = true; if (e.getMessage().contains(s)) bool = true;
} }
if (!bool) return; if (!bool) return;
for (ResponsesObject response : Main.allResponses) { for (ResponsesObject response : Main.allResponses) {
if (response.permNecessary) { if (!response.permNecessary || player.hasPermission(response.permission)) {
if (player.hasPermission(response.permission)) { send.debugmsg(Main.plugin, "key: " + response.responseKey);
send.debugmsg(Main.plugin, "key: " + response.responseKey); if (response.contains) {
if (response.contains) { send.debugmsg(Main.plugin, "1");
send.debugmsg(Main.plugin, "1"); if (e.getMessage().contains(response.responseKey)) {
if (e.getMessage().contains(response.responseKey)) { send.debugmsg(Main.plugin, "2");
send.debugmsg(Main.plugin, "2"); execute(e, player, response);
execute(e, player, response); return;
return; }
} } else {
} else { send.debugmsg(Main.plugin, "3");
send.debugmsg(Main.plugin, "3"); if (e.getMessage().equals(response.responseKey)) {
if (e.getMessage().equals(response.responseKey)) { send.debugmsg(Main.plugin, "4");
send.debugmsg(Main.plugin, "4"); execute(e, player, response);
execute(e, player, response); return;
return;
}
} }
} }
} }