diff options
author | Chris Ward <chris@chrisgward.com> | 2013-10-18 17:43:37 +1100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-10-19 12:19:37 +0100 |
commit | ce3a90b617ede8c00719f5c2e4439b4b0947079e (patch) | |
tree | 8aa19507948d9a42ea0316de9ed1ecd8edee14a8 | |
parent | 859db92ccc7692eab2ebdbc42d28eb70c46670c7 (diff) | |
download | Essentials-ce3a90b617ede8c00719f5c2e4439b4b0947079e.tar Essentials-ce3a90b617ede8c00719f5c2e4439b4b0947079e.tar.gz Essentials-ce3a90b617ede8c00719f5c2e4439b4b0947079e.tar.lz Essentials-ce3a90b617ede8c00719f5c2e4439b4b0947079e.tar.xz Essentials-ce3a90b617ede8c00719f5c2e4439b4b0947079e.zip |
Fix double messages in targeted commands
6 files changed, 6 insertions, 6 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java index 8d38f08dd..dcd1d5187 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandfly.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandfly.java @@ -61,7 +61,7 @@ public class Commandfly extends EssentialsToggleCommand } user.sendMessage(_("flyMode", _(enabled ? "enabled" : "disabled"), user.getDisplayName())); - if (!sender.equals(user.getBase())) + if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { sender.sendMessage(_("flyMode", _(enabled ? "enabled" : "disabled"), user.getDisplayName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java index 439584667..44d930cc7 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgod.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgod.java @@ -67,7 +67,7 @@ public class Commandgod extends EssentialsToggleCommand } user.sendMessage(_("godMode", enabled ? _("enabled") : _("disabled"))); - if (!sender.equals(user.getBase())) + if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { sender.sendMessage(_("godMode", _(enabled ? "godEnabledFor" : "godDisabledFor", user.getDisplayName()))); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandr.java b/Essentials/src/com/earth2me/essentials/commands/Commandr.java index 046024c7c..4b4de6ff9 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandr.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandr.java @@ -66,7 +66,7 @@ public class Commandr extends EssentialsCommand { if (target.isPlayer()) { - (target.isPlayer() ? ess.getUser(target.getPlayer()) : ess.getUser(Console.NAME)).setReplyTo(sender); + ess.getUser(target.getPlayer()).setReplyTo(sender); } else { diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java index e288a5cb0..63d3764be 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java @@ -56,7 +56,7 @@ public class Commandsocialspy extends EssentialsToggleCommand user.sendMessage(_("socialSpy", user.getDisplayName(), enabled ? _("enabled") : _("disabled"))); - if (!sender.equals(user.getBase())) + if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { sender.sendMessage(_("socialSpy", user.getDisplayName(), enabled ? _("enabled") : _("disabled"))); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java index 442f53554..97052876b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java @@ -55,7 +55,7 @@ public class Commandtptoggle extends EssentialsToggleCommand user.setTeleportEnabled(enabled); user.sendMessage(enabled ? _("teleportationEnabled") : _("teleportationDisabled")); - if (!sender.equals(user.getBase())) + if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { sender.sendMessage(enabled ? _("teleportationEnabledFor", user.getDisplayName()) : _("teleportationDisabledFor", user.getDisplayName())); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java index 588c17883..34aa82f64 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandvanish.java @@ -59,7 +59,7 @@ public class Commandvanish extends EssentialsToggleCommand { user.sendMessage(_("vanished")); } - if (!sender.equals(user.getBase())) + if (!sender.isPlayer() || !sender.getPlayer().equals(user.getBase())) { sender.sendMessage(_("vanish", user.getDisplayName(), enabled ? _("enabled") : _("disabled"))); } |