mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-27 01:40:48 +08:00
Add support for using /seen with UUID.
This commit is contained in:
parent
06417910e2
commit
2e903acbaa
@ -39,7 +39,15 @@ public class Commandseen extends EssentialsCommand {
|
||||
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]);
|
||||
|
Loading…
Reference in New Issue
Block a user