diff --git a/src/de/steamwar/bungeecore/commands/WhoisCommand.java b/src/de/steamwar/bungeecore/commands/WhoisCommand.java index 089ad82..ebe3884 100644 --- a/src/de/steamwar/bungeecore/commands/WhoisCommand.java +++ b/src/de/steamwar/bungeecore/commands/WhoisCommand.java @@ -68,10 +68,15 @@ public class WhoisCommand extends BasicCommand { return; } - sendUserinfo(player, user); + boolean all = false; + if(args.length > 1 && args[1].startsWith("-")) { + all = args[1].contains("a"); + } + + sendUserinfo(player, user, all); } - private static void sendUserinfo(ProxiedPlayer player, SteamwarUser user) { + private static void sendUserinfo(ProxiedPlayer player, SteamwarUser user, boolean all) { Message.send("WHOIS_USERNAME", player, user.getUserName()); Message.send("WHOIS_UUID", player, Message.parse("WHOIS_UUID_HOVER", player), new ClickEvent(ClickEvent.Action.COPY_TO_CLIPBOARD, user.getUuid().toString()), user.getUuid().toString()); Message.send("WHOIS_ID", player, user.getId()); @@ -89,13 +94,24 @@ public class WhoisCommand extends BasicCommand { Message.send("WHOIS_TEAM", player, Message.parse("WHOIS_TEAM_HOVER", player, team.getTeamName()), new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + team.getTeamKuerzel()), team.getTeamColor(), team.getTeamKuerzel(), team.getTeamName()); Message.send("WHOIS_PUNISHMENTS", player); - List punishmentList = Punishment.getAllPunishmentsOfPlayer(user.getId()); - if(punishmentList.isEmpty()) { - Message.send("WHOIS_NO_PUNISHMENT", player); - return; - } - for (Punishment punishment : punishmentList) { - Message.sendPrefixless("WHOIS_PUNISHMENT", player, SteamwarUser.get(punishment.getPunisher()).getUserName(), punishment.getType().name(), punishment.getBantime(punishment.getStartTime(), false), punishment.getBantime(punishment.getEndTime(), punishment.isPerma()), punishment.getReason()); + if(all) { + List punishmentList = Punishment.getAllPunishmentsOfPlayer(user.getId()); + if(punishmentList.isEmpty()) { + Message.send("WHOIS_NO_ALL_PUNISHMENT", player); + return; + } + for (Punishment punishment : punishmentList) { + Message.sendPrefixless("WHOIS_PUNISHMENT", player, SteamwarUser.get(punishment.getPunisher()).getUserName(), punishment.getType().name(), punishment.getBantime(punishment.getStartTime(), false), punishment.getBantime(punishment.getEndTime(), punishment.isPerma()), punishment.getReason()); + } + } else { + for (Punishment.PunishmentType punishmentType : Punishment.PunishmentType.values()) { + if(user.isPunished(punishmentType)) { + Message.send("WHOIS_NO_PUNISHMENT", player); + continue; + } + Punishment punishment = user.getPunishment(punishmentType); + Message.sendPrefixless("WHOIS_PUNISHMENT", player, SteamwarUser.get(punishment.getPunisher()).getUserName(), punishment.getType().name(), punishment.getBantime(punishment.getStartTime(), false), punishment.getBantime(punishment.getEndTime(), punishment.isPerma()), punishment.getReason()); + } } } } diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index dbd1fb6..f2a9aa9 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -537,7 +537,7 @@ SERVER_WORLD_ERROR=§cDas Erstellen der Welt ist fehlgeschlagen. #WhoisCommand -WHOIS_USAGE=§c/whois [Spieler/ID] +WHOIS_USAGE=§c/whois [Spieler/ID] {-a} WHOIS_USERNAME=§7Username§8: §e{0} WHOIS_UUID=§7UUID§8: §e{0} WHOIS_UUID_HOVER=§eUUID Kopieren @@ -549,7 +549,8 @@ WHOIS_TEAM=§7Team§8: §e[§{0}{1}§e] {2} WHOIS_TEAM_HOVER=§e{0} anzeigen WHOIS_PUNISHMENTS=§7Strafen: WHOIS_PUNISHMENT=§7{0}§8» §f§l{1}: §e{2} - {3} §f{4} -WHOIS_NO_PUNISHMENT=§a✓ §7Der Spieler hat noch nichts getan. +WHOIS_NO_PUNISHMENT=§a✓ §7Der Spieler hat keine Aktiven bestrafungen. +WHOIS_NO_ALL_PUNISHMENT=§a✓ §7Der Spieler hat noch nichts getan. #VerifyCommand VERIFY_USAGE=§c/verify [Code]