summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2014-05-30 21:49:16 +0100
committerKHobbits <rob@khobbits.co.uk>2014-05-30 22:16:06 +0100
commit7564d1f7f883cbed25d126fd28d2c0076232fbe3 (patch)
tree7912cc6fd81ffbb8592cb181ff682bbc918b35da
parentc4c5b2abf1b668c49637f36395ecf01ac6539b33 (diff)
downloadEssentials-7564d1f7f883cbed25d126fd28d2c0076232fbe3.tar
Essentials-7564d1f7f883cbed25d126fd28d2c0076232fbe3.tar.gz
Essentials-7564d1f7f883cbed25d126fd28d2c0076232fbe3.tar.lz
Essentials-7564d1f7f883cbed25d126fd28d2c0076232fbe3.tar.xz
Essentials-7564d1f7f883cbed25d126fd28d2c0076232fbe3.zip
Extend getUser(Object) to match uuid and offline players.
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java8
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandessentials.java3
2 files changed, 11 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java
index 9b9d3ac9d..61f42931a 100644
--- a/Essentials/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials/src/com/earth2me/essentials/Essentials.java
@@ -628,6 +628,14 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials
{
return getUser((Player)base);
}
+ if (base instanceof org.bukkit.OfflinePlayer)
+ {
+ return getUser(((org.bukkit.OfflinePlayer)base).getUniqueId());
+ }
+ if (base instanceof UUID)
+ {
+ return getUser((UUID)base);
+ }
if (base instanceof String)
{
return getOfflineUser((String)base);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
index 300f93b2d..0eedb61ca 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandessentials.java
@@ -349,11 +349,14 @@ public class Commandessentials extends EssentialsCommand
String name = args[1];
sender.sendMessage("Looking up UUID for " + name);
+ UUID onlineUUID = null;
+
for (Player player : server.getOnlinePlayers())
{
if (player.getName().equalsIgnoreCase(name))
{
sender.sendMessage("Online player: " + player.getUniqueId().toString());
+ onlineUUID = player.getUniqueId();
}
}