From ccc6fd30f822533ef29377fa94042631cee7fc8e Mon Sep 17 00:00:00 2001 From: bm01 Date: Fri, 6 Jul 2012 07:07:06 +0200 Subject: [PATCH] Fixed /inspect not working on offline player --- Changelog.txt | 1 + .../com/gmail/nossr50/commands/general/InspectCommand.java | 5 ++++- .../com/gmail/nossr50/commands/general/MmoeditCommand.java | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 772cfd28d..f96a8cb9d 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -13,6 +13,7 @@ Version 1.3.10-dev + Added Ability API functions + Added 50% & 150% XP boost perks + Added "lucky" perk for donors + = Fixed /inspect not working on offline players = Fixed custom blocks, tools and armors not loading properly = Fixed duplication bug with sticky pistons = Fixed "GenericLabel belonging to mcMMO..." message diff --git a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java index 4ffb3c3aa..37486c04d 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java @@ -35,10 +35,10 @@ public class InspectCommand implements CommandExecutor { switch (args.length) { case 1: target = plugin.getServer().getOfflinePlayer(args[0]); - profile = Users.getProfile(target); if (target.isOnline()) { Player player = (Player) target; + profile = Users.getProfile(player); if (sender instanceof Player && !sender.isOp() && !Misc.isNear(((Player) sender).getLocation(), player.getLocation(), 5.0) && !Permissions.getInstance().inspectDistanceBypass((Player) sender)) { sender.sendMessage(LocaleLoader.getString("Inspect.TooFar")); @@ -59,6 +59,9 @@ public class InspectCommand implements CommandExecutor { return true; } + //Temporary profile, it would be better to be able to create if with an OfflinePlayer instead + + profile = new PlayerProfile(null, target.getName(), false); if (!profile.isLoaded()) { sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist")); return true; diff --git a/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java b/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java index c2d12440c..7d5d7e654 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/MmoeditCommand.java @@ -94,6 +94,7 @@ public class MmoeditCommand implements CommandExecutor { } } else { + //Temporary profile, it would be better to be able to create if with an OfflinePlayer instead playerProfile = new PlayerProfile(null, args[0], false); if (!playerProfile.isLoaded()) {