From 2e903acbaaf39f7e14275b38522481f13fc1c85a Mon Sep 17 00:00:00 2001 From: Ali Moghnieh Date: Sat, 2 Jan 2016 10:46:42 +0000 Subject: [PATCH] Add support for using /seen with UUID. --- .../com/earth2me/essentials/commands/Commandseen.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java index 82f9dd19406..30a46a6c86c 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandseen.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandseen.java @@ -39,7 +39,15 @@ protected void seen(final Server server, final CommandSource sender, final Strin if (args.length < 1) { throw new NotEnoughArgumentsException(); } - User player = ess.getOfflineUser(args[0]); + User player; + // Check by uuid, if it fails check by name. + try { + UUID uuid = UUID.fromString(args[0]); + player = ess.getUser(uuid); + }catch (IllegalArgumentException ignored) { // Thrown if invalid UUID from string, check by name. + player = ess.getOfflineUser(args[0]); + } + if (player == null) { if (ipLookup && FormatUtil.validIP(args[0])) { seenIP(server, sender, args[0]);