Archiviert
1
0

Added Support for UserID

Dieser Commit ist enthalten in:
Chaoscaot 2020-10-10 23:58:34 +02:00
Ursprung de1243870a
Commit a19e5db5e6

Datei anzeigen

@ -40,16 +40,27 @@ public class WhoisCommand extends BasicCommand {
ProxiedPlayer player = (ProxiedPlayer) sender;
if(args.length == 0){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§c/whois [Spieler]");
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§c/whois [Spieler/ID]");
return;
}
SteamwarUser user = SteamwarUser.get(args[0]);
if(user == null){
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cUnbekannter Spieler.");
try {
int id = Integer.parseInt(args[0]);
user = SteamwarUser.get(id);
}catch (NumberFormatException ignored) {}
}
if(user == null) {
BungeeCore.send(player, BungeeCore.CHAT_PREFIX + "§cUnbekannter Spieler!");
return;
}
sendUserinfo(player, user);
}
private static void sendUserinfo(ProxiedPlayer player, SteamwarUser user) {
BungeeCore.send(player, "§7Username§8: §e" + user.getUserName());
BungeeCore.send(player, "§7UUID§8: §e" + user.getUuid().toString(), "", new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, user.getUuid().toString()));
BungeeCore.send(player, "§7ID§8: §e" + user.getId());