Merge pull request 'Add Only Active Punishments on Whois' (#288) from active_punishments into master
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed
Reviewed-on: #288 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
90e1148eb1
@ -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<Punishment> 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<Punishment> 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());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 Strafen.
|
||||
WHOIS_NO_ALL_PUNISHMENT=§a✓ §7Der Spieler hat noch nichts getan.
|
||||
|
||||
#VerifyCommand
|
||||
VERIFY_USAGE=§c/verify [Code]
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren