Fix bug where players could know staff are invis

This commit is contained in:
Darkknights22 2022-10-18 19:53:20 +01:00
parent 30ac82181e
commit 69e9e602f3

View File

@ -74,7 +74,7 @@ public class InspectCommand implements TabExecutor {
if (!isVanished && CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) { if (!isVanished && CommandUtils.tooFar(sender, target, Permissions.inspectFar(sender))) {
return true; return true;
} }
if (mcMMO.p.getGeneralConfig().getScoreboardsEnabled() if (mcMMO.p.getGeneralConfig().getScoreboardsEnabled()
&& sender instanceof Player && sender instanceof Player
&& mcMMO.p.getGeneralConfig().getInspectUseBoard()) { && 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.printGatheringSkills(target, sender);
CommandUtils.printCombatSkills(target, sender); CommandUtils.printCombatSkills(target, sender);
CommandUtils.printMiscSkills(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; return true;