From 8b7729e0e809ae033c9a8c4e027b49596c2d915e Mon Sep 17 00:00:00 2001 From: aurora <21148213+aurorasmiles@users.noreply.github.com> Date: Thu, 23 May 2024 19:05:29 +0200 Subject: [PATCH] Fix silent flag for gameplay commands (#2081) * Fix silent flag for gameplay commands This issue has been fixed in CommandBook with https://github.com/EngineHub/CommandBook/commit/644803182ed1765a9862d0a0cd0d3763d399efee but never in WorldGuard. Co-authored-by: Wyatt Childers * codestyle --- .../worldguard/commands/GeneralCommands.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/worldguard-core/src/main/java/com/sk89q/worldguard/commands/GeneralCommands.java b/worldguard-core/src/main/java/com/sk89q/worldguard/commands/GeneralCommands.java index 1b8fffce..1111355a 100644 --- a/worldguard-core/src/main/java/com/sk89q/worldguard/commands/GeneralCommands.java +++ b/worldguard-core/src/main/java/com/sk89q/worldguard/commands/GeneralCommands.java @@ -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."); } }