SteamWar/BungeeCore
Archiviert
13
2

Merge remote-tracking branch 'origin/Playtime_Command' into Playtime_Command
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
zOnlyKroks 2022-01-01 12:24:42 +01:00
Commit 891eb0db92
3 geänderte Dateien mit 32 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -47,7 +47,6 @@ import net.md_5.bungee.config.YamlConfiguration;
import java.io.File;
import java.io.IOException;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -56,8 +55,6 @@ import java.util.logging.Level;
public class BungeeCore extends Plugin {
public static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("dd.MM.yyyy");
public static String CHAT_PREFIX;
public static String WORLD_FOLDER;
public static String BAUWELT_PROTOTYP;

Datei anzeigen

@ -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,28 @@ 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 {
boolean isPunished = false;
for (Punishment.PunishmentType punishmentType : Punishment.PunishmentType.values()) {
if(!user.isPunished(punishmentType)) {
continue;
}
Punishment punishment = user.getPunishment(punishmentType);
isPunished = true;
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(!isPunished) {
Message.send("WHOIS_NO_PUNISHMENT", player);
}
}
}
}

Datei anzeigen

@ -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]