Fix confirmation check

Signed-off-by: Etzelia <etzelia@hotmail.com>
spec_confirm
Etzelia 2019-10-04 22:01:58 -05:00
parent d26a46f9a0
commit 6ca2a28b88
No known key found for this signature in database
GPG Key ID: 708511AE7ABC5314
1 changed files with 3 additions and 1 deletions

View File

@ -80,7 +80,9 @@ public class CommandPreprocessListener implements Listener {
if (sender.hasPermission("qol.specconfirm")) { if (sender.hasPermission("qol.specconfirm")) {
boolean confirm = false; boolean confirm = false;
for (String confirmable : specConfirm) { for (String confirmable : specConfirm) {
if (noSlash(command).toLowerCase().startsWith(confirmable.toLowerCase())) { // If the player command either starts with a confirmable command and space (meaning confirmation is needed regardless of arguments)
// Or the player command is a full match to the confirmable command
if (noSlash(command).toLowerCase().startsWith(confirmable.toLowerCase() + " ") || noSlash(command).toLowerCase().equals(confirmable.toLowerCase())) {
confirm = true; confirm = true;
} }
} }