From de0487d16f9d1883743d9bac68e72388c6b99026 Mon Sep 17 00:00:00 2001 From: TfT_02 Date: Mon, 3 Jun 2013 15:33:23 +0200 Subject: [PATCH] This should make it work properly --- .../gmail/nossr50/commands/player/InspectCommand.java | 10 ++++++---- .../com/gmail/nossr50/util/commands/CommandUtils.java | 3 +-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java b/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java index 2f501a7dd..3a84ff163 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -69,11 +69,13 @@ public class InspectCommand implements TabExecutor { else { Player target = mcMMOPlayer.getPlayer(); - if (!Permissions.inspectOffline(sender) && CommandUtils.hidden(sender, target, Permissions.inspectHidden(sender))) { - return true; + if (CommandUtils.hidden(sender, target, Permissions.inspectHidden(sender))) { + if (!Permissions.inspectOffline(sender)) { + sender.sendMessage(LocaleLoader.getString("Inspect.Offline")); + return true; + } } - - if (CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) { + else if (CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) { return true; } diff --git a/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java b/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java index a0e183a4f..7902bf358 100644 --- a/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java +++ b/src/main/java/com/gmail/nossr50/util/commands/CommandUtils.java @@ -56,8 +56,7 @@ public final class CommandUtils { } public static boolean hidden(CommandSender sender, Player target, boolean hasPermission) { - if (sender instanceof Player && ((Player)sender).canSee(target) && !hasPermission) { - sender.sendMessage(LocaleLoader.getString("Inspect.Offline")); + if (sender instanceof Player && !((Player)sender).canSee(target) && !hasPermission) { return true; }