mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-26 10:01:49 +01:00
Fix double messages in targeted commands
This commit is contained in:
parent
2615468a08
commit
50a9b5718c
@ -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()));
|
||||
}
|
||||
|
@ -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())));
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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")));
|
||||
}
|
||||
|
@ -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()));
|
||||
}
|
||||
|
@ -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")));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user