Skip to content

Commit

Permalink
Add support for using /seen with UUID.
Browse files Browse the repository at this point in the history
  • Loading branch information
SupaHam committed Jan 2, 2016
1 parent 0641791 commit 2e903ac
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 2e903ac

Please # to comment.