fix commandspy to wrong players, don't spy on own commands (SD-3439, SD-3421)

This commit is contained in:
jascotty2 2019-08-14 05:45:54 -05:00
parent 0ff769ca4b
commit 7e0bcc2e9d

View File

@ -50,11 +50,11 @@ public class CommandListener implements Listener {
if (!player.hasPermission("um.commandspy.immune")) {
for (Player pl : Bukkit.getOnlinePlayers()) {
if (pl.hasPermission("um.commandspy") && CommandCommandSpy.isSpying(pl))
if (pl != player && pl.hasPermission("um.commandspy") && CommandCommandSpy.isSpying(pl))
instance.getLocale().getMessage("command.commandspy.deny")
.processPlaceholder("player", player.getName())
.processPlaceholder("command", StringEscapeUtils.escapeJava(command))
.sendPrefixedMessage(player);
.sendPrefixedMessage(pl);
}
}
}