From 80c36ca8466d59cf807e2494846d0413b5aecd13 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 3 Apr 2012 12:05:39 -0700 Subject: [PATCH] Fix for inspect command throwing errors when players are in different worlds --- .../com/gmail/nossr50/commands/general/InspectCommand.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 df448236b..138ba27de 100644 --- a/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/general/InspectCommand.java @@ -47,7 +47,8 @@ public class InspectCommand implements CommandExecutor { PlayerProfile PPt = Users.getProfile(target); //If they are not an Op they have to be close - if(sender instanceof Player && !player.isOp() && !m.isNear(player.getLocation(), target.getLocation(), 5.0)) + if(sender instanceof Player && !player.getWorld().equals(target.getWorld()) || + sender instanceof Player && !player.isOp() && !m.isNear(player.getLocation(), target.getLocation(), 5.0)) { sender.sendMessage("You are too far away to inspect that player!"); //TODO: Needs more locale. }