fix: prevent whitelist from kicking the bot itself

This commit is contained in:
Chayapak 2024-11-10 19:25:42 +07:00
parent 11f478487d
commit 7b78ce7d06
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA

View file

@ -72,7 +72,7 @@ public class WhitelistPlugin extends PlayersPlugin.Listener {
} }
public void commandReceived (PlayerEntry entry, String command) { public void commandReceived (PlayerEntry entry, String command) {
if (!enabled || list.contains(entry.profile.getName())) return; if (!enabled || list.contains(entry.profile.getName()) || entry.profile.equals(bot.profile)) return;
if ( if (
command.startsWith("mute") || command.startsWith("mute") ||
@ -90,7 +90,7 @@ public class WhitelistPlugin extends PlayersPlugin.Listener {
} }
private void handle (PlayerEntry entry) { private void handle (PlayerEntry entry) {
if (!enabled || list.contains(entry.profile.getName())) return; if (!enabled || list.contains(entry.profile.getName()) || entry.profile.equals(bot.profile)) return;
bot.filter.doAll(entry); bot.filter.doAll(entry);
} }