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>
<artifactId>AutoResponse</artifactId>
<version>0.0.1-DEV</version>
<version>0.0.1-DEV-2</version>
<packaging>jar</packaging>
<name>T2C-AutoResponse</name>

View File

@ -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;
}
}
}