From 69e9e602f368679e5d920b1286b908a37f48f5d7 Mon Sep 17 00:00:00 2001 From: Darkknights22 Date: Tue, 18 Oct 2022 19:53:20 +0100 Subject: [PATCH] Fix bug where players could know staff are invis --- .../nossr50/commands/player/InspectCommand.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 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 5779147ea..c23bd6ef1 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/InspectCommand.java @@ -74,7 +74,7 @@ public class InspectCommand implements TabExecutor { if (!isVanished && CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) { return true; } - + if (mcMMO.p.getGeneralConfig().getScoreboardsEnabled() && sender instanceof Player && mcMMO.p.getGeneralConfig().getInspectUseBoard()) { @@ -85,11 +85,19 @@ public class InspectCommand implements TabExecutor { } } - sender.sendMessage(LocaleLoader.getString("Inspect.Stats", target.getName())); + if (isVanished) { + sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", playerName)); + } else { + sender.sendMessage(LocaleLoader.getString("Inspect.Stats", target.getName())); + } + CommandUtils.printGatheringSkills(target, sender); CommandUtils.printCombatSkills(target, sender); CommandUtils.printMiscSkills(target, sender); - sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel())); + + if (!isVanished) { + sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", mcMMOPlayer.getPowerLevel())); + } } return true;