mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
parent
15bb978dab
commit
a1a0d34940
2 changed files with 15 additions and 1 deletions
|
@ -4,6 +4,7 @@ import com.earth2me.essentials.ChargeException;
|
|||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import com.earth2me.essentials.utils.StringUtil;
|
||||
import net.ess3.api.MaxMoneyException;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -23,7 +24,11 @@ public abstract class EssentialsLoopCommand extends EssentialsCommand {
|
|||
throw new PlayerNotFoundException();
|
||||
}
|
||||
|
||||
if (matchWildcards && searchTerm.contentEquals("**")) {
|
||||
final UUID uuid = StringUtil.toUUID(searchTerm);
|
||||
if (uuid != null) {
|
||||
final User matchedUser = ess.getUser(uuid);
|
||||
updatePlayer(server, sender, matchedUser, commandArgs);
|
||||
} else if (matchWildcards && searchTerm.contentEquals("**")) {
|
||||
for (UUID sUser : ess.getUserMap().getAllUniqueUsers()) {
|
||||
final User matchedUser = ess.getUser(sUser);
|
||||
updatePlayer(server, sender, matchedUser, commandArgs);
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.earth2me.essentials.utils;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
|
@ -73,6 +74,14 @@ public class StringUtil {
|
|||
return buf.toString();
|
||||
}
|
||||
|
||||
public static UUID toUUID(String input) {
|
||||
try {
|
||||
return UUID.fromString(input);
|
||||
} catch (IllegalArgumentException ignored) {}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private StringUtil() {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue