From ce3a90b617ede8c00719f5c2e4439b4b0947079e Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Fri, 18 Oct 2013 17:43:37 +1100 Subject: Fix double messages in targeted commands --- Essentials/src/com/earth2me/essentials/commands/Commandfly.java | 2 +- Essentials/src/com/earth2me/essentials/commands/Commandgod.java | 2 +- Essentials/src/com/earth2me/essentials/commands/Commandr.java | 2 +- Essentials/src/com/earth2me/essentials/commands/Commandsocialspy.java | 2 +- Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java | 2 +- Essentials/src/com/earth2me/essentials/commands/Commandvanish.java | 2 +- 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"))); } -- cgit v1.2.3