Add Whois show Playtime #126
@ -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());
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Bitte einen normalen String-Formatter oder vgl.bares nutzen und nix selbstgebasteltes. Notfalls halt immer in Spielstunden angeben.