Match full command instead of just the base to avoid issues like party chat or /r not cancelling afk if they're not duplicates

This commit is contained in:
Teriuihi 2023-03-30 14:54:13 +02:00
parent 3798cf5e7e
commit ac9cfc1b67

View File

@ -186,12 +186,8 @@ public class AFKDetector extends JavaPlugin implements Listener {
return;
}
String[] s = event.getMessage().toLowerCase().split(" ");
if (s.length == 0)
return;
UUID uuid = event.getPlayer().getUniqueId();
String command = s[0];
String command = event.getMessage().toLowerCase();
if (commandHistory.checkForMatch(uuid, command)) {
return;