mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-26 00:19:43 +00:00
Add support for using /seen with UUID.
This commit is contained in:
parent
06417910e2
commit
2e903acbaa
1 changed files with 9 additions and 1 deletions
|
@ -39,7 +39,15 @@ public class Commandseen extends EssentialsCommand {
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
throw new NotEnoughArgumentsException();
|
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 (player == null) {
|
||||||
if (ipLookup && FormatUtil.validIP(args[0])) {
|
if (ipLookup && FormatUtil.validIP(args[0])) {
|
||||||
seenIP(server, sender, args[0]);
|
seenIP(server, sender, args[0]);
|
||||||
|
|
Loading…
Reference in a new issue