diff --git a/src/main/java/com/songoda/ultimatemoderation/command/commands/CommandSpy.java b/src/main/java/com/songoda/ultimatemoderation/command/commands/CommandSpy.java index a49248e..766c6e4 100644 --- a/src/main/java/com/songoda/ultimatemoderation/command/commands/CommandSpy.java +++ b/src/main/java/com/songoda/ultimatemoderation/command/commands/CommandSpy.java @@ -19,7 +19,13 @@ public class CommandSpy extends AbstractCommand { } public static void spy(OfflinePlayer player, Player senderP) { + + UltimateModeration instance = UltimateModeration.getInstance(); + if (player == senderP) { + senderP.sendMessage(instance.getReferences().getPrefix() + "You cannot spy on yourself."); + return; + } boolean didVanish = false; if (!CommandVanish.isVanished(senderP)) { didVanish = true; @@ -58,11 +64,6 @@ public class CommandSpy extends AbstractCommand { return ReturnType.FAILURE; } - if (player == senderP) { - sender.sendMessage(instance.getReferences().getPrefix() + "You cannot spy on yourself."); - return ReturnType.FAILURE; - } - spy(player, senderP); return ReturnType.SUCCESS;