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; }