Skip to content

Commit 8b7729e

Browse files
authored
Fix silent flag for gameplay commands (#2081)
* Fix silent flag for gameplay commands This issue has been fixed in CommandBook with EngineHub/CommandBook@6448031 but never in WorldGuard. Co-authored-by: Wyatt Childers <DarkArc@users.noreply.github.com> * codestyle
1 parent d6ef5e9 commit 8b7729e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

worldguard-core/src/main/java/com/sk89q/worldguard/commands/GeneralCommands.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void god(CommandContext args, Actor sender) throws CommandException, Auth
7070

7171
// Keep track of this
7272
included = true;
73-
} else {
73+
} else if (!args.hasFlag('s')) {
7474
player.print("God enabled by " + sender.getDisplayName() + ".");
7575

7676
}
@@ -79,7 +79,7 @@ public void god(CommandContext args, Actor sender) throws CommandException, Auth
7979

8080
// The player didn't receive any items, then we need to send the
8181
// user a message so s/he know that something is indeed working
82-
if (!included && args.hasFlag('s')) {
82+
if (!included) {
8383
sender.print("Players now have god mode.");
8484
}
8585
}
@@ -113,7 +113,7 @@ public void ungod(CommandContext args, Actor sender) throws CommandException, Au
113113

114114
// Keep track of this
115115
included = true;
116-
} else {
116+
} else if (!args.hasFlag('s')) {
117117
player.print("God disabled by " + sender.getDisplayName() + ".");
118118

119119
}
@@ -122,7 +122,7 @@ public void ungod(CommandContext args, Actor sender) throws CommandException, Au
122122

123123
// The player didn't receive any items, then we need to send the
124124
// user a message so s/he know that something is indeed working
125-
if (!included && args.hasFlag('s')) {
125+
if (!included) {
126126
sender.print("Players no longer have god mode.");
127127
}
128128
}
@@ -158,15 +158,15 @@ public void heal(CommandContext args, Actor sender) throws CommandException, Aut
158158

159159
// Keep track of this
160160
included = true;
161-
} else {
161+
} else if (!args.hasFlag('s')) {
162162
player.print("Healed by " + sender.getDisplayName() + ".");
163163

164164
}
165165
}
166166

167167
// The player didn't receive any items, then we need to send the
168168
// user a message so s/he know that something is indeed working
169-
if (!included && args.hasFlag('s')) {
169+
if (!included) {
170170
sender.print("Players healed.");
171171
}
172172
}
@@ -199,15 +199,15 @@ public void slay(CommandContext args, Actor sender) throws CommandException, Aut
199199

200200
// Keep track of this
201201
included = true;
202-
} else {
202+
} else if (!args.hasFlag('s')) {
203203
player.print("Slain by " + sender.getDisplayName() + ".");
204204

205205
}
206206
}
207207

208208
// The player didn't receive any items, then we need to send the
209209
// user a message so s/he know that something is indeed working
210-
if (!included && args.hasFlag('s')) {
210+
if (!included) {
211211
sender.print("Players slain.");
212212
}
213213
}

0 commit comments

Comments
 (0)