Fix silent flag for gameplay commands (#2081)

* Fix silent flag for gameplay commands

This issue has been fixed in CommandBook with
644803182e
but never in WorldGuard.

Co-authored-by: Wyatt Childers <DarkArc@users.noreply.github.com>

* codestyle
This commit is contained in:
aurora 2024-05-23 19:05:29 +02:00 committed by GitHub
parent d6ef5e9398
commit 8b7729e0e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -70,7 +70,7 @@ public void god(CommandContext args, Actor sender) throws CommandException, Auth
// Keep track of this
included = true;
} else {
} else if (!args.hasFlag('s')) {
player.print("God enabled by " + sender.getDisplayName() + ".");
}
@ -79,7 +79,7 @@ public void god(CommandContext args, Actor sender) throws CommandException, Auth
// The player didn't receive any items, then we need to send the
// user a message so s/he know that something is indeed working
if (!included && args.hasFlag('s')) {
if (!included) {
sender.print("Players now have god mode.");
}
}
@ -113,7 +113,7 @@ public void ungod(CommandContext args, Actor sender) throws CommandException, Au
// Keep track of this
included = true;
} else {
} else if (!args.hasFlag('s')) {
player.print("God disabled by " + sender.getDisplayName() + ".");
}
@ -122,7 +122,7 @@ public void ungod(CommandContext args, Actor sender) throws CommandException, Au
// The player didn't receive any items, then we need to send the
// user a message so s/he know that something is indeed working
if (!included && args.hasFlag('s')) {
if (!included) {
sender.print("Players no longer have god mode.");
}
}
@ -158,7 +158,7 @@ public void heal(CommandContext args, Actor sender) throws CommandException, Aut
// Keep track of this
included = true;
} else {
} else if (!args.hasFlag('s')) {
player.print("Healed by " + sender.getDisplayName() + ".");
}
@ -166,7 +166,7 @@ public void heal(CommandContext args, Actor sender) throws CommandException, Aut
// The player didn't receive any items, then we need to send the
// user a message so s/he know that something is indeed working
if (!included && args.hasFlag('s')) {
if (!included) {
sender.print("Players healed.");
}
}
@ -199,7 +199,7 @@ public void slay(CommandContext args, Actor sender) throws CommandException, Aut
// Keep track of this
included = true;
} else {
} else if (!args.hasFlag('s')) {
player.print("Slain by " + sender.getDisplayName() + ".");
}
@ -207,7 +207,7 @@ public void slay(CommandContext args, Actor sender) throws CommandException, Aut
// The player didn't receive any items, then we need to send the
// user a message so s/he know that something is indeed working
if (!included && args.hasFlag('s')) {
if (!included) {
sender.print("Players slain.");
}
}