mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-19 08:55:26 +01:00
Fixed /inspect not working on offline player
This commit is contained in:
parent
1ba498c443
commit
ccc6fd30f8
@ -13,6 +13,7 @@ Version 1.3.10-dev
|
|||||||
+ Added Ability API functions
|
+ Added Ability API functions
|
||||||
+ Added 50% & 150% XP boost perks
|
+ Added 50% & 150% XP boost perks
|
||||||
+ Added "lucky" perk for donors
|
+ Added "lucky" perk for donors
|
||||||
|
= Fixed /inspect not working on offline players
|
||||||
= Fixed custom blocks, tools and armors not loading properly
|
= Fixed custom blocks, tools and armors not loading properly
|
||||||
= Fixed duplication bug with sticky pistons
|
= Fixed duplication bug with sticky pistons
|
||||||
= Fixed "GenericLabel belonging to mcMMO..." message
|
= Fixed "GenericLabel belonging to mcMMO..." message
|
||||||
|
@ -35,10 +35,10 @@ public class InspectCommand implements CommandExecutor {
|
|||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 1:
|
case 1:
|
||||||
target = plugin.getServer().getOfflinePlayer(args[0]);
|
target = plugin.getServer().getOfflinePlayer(args[0]);
|
||||||
profile = Users.getProfile(target);
|
|
||||||
|
|
||||||
if (target.isOnline()) {
|
if (target.isOnline()) {
|
||||||
Player player = (Player) target;
|
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)) {
|
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"));
|
sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
|
||||||
@ -59,6 +59,9 @@ public class InspectCommand implements CommandExecutor {
|
|||||||
return true;
|
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()) {
|
if (!profile.isLoaded()) {
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
|
@ -94,6 +94,7 @@ public class MmoeditCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
//Temporary profile, it would be better to be able to create if with an OfflinePlayer instead
|
||||||
playerProfile = new PlayerProfile(null, args[0], false);
|
playerProfile = new PlayerProfile(null, args[0], false);
|
||||||
|
|
||||||
if (!playerProfile.isLoaded()) {
|
if (!playerProfile.isLoaded()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user