SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'Update WhoisCommand and make it public' (#447) from PublicWoisCommand into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #447
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2023-01-17 16:43:53 +01:00
Commit b000745fcd

Datei anzeigen

@ -35,7 +35,6 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.time.Instant; import java.time.Instant;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -43,7 +42,7 @@ import java.util.stream.Stream;
public class WhoisCommand extends SWCommand { public class WhoisCommand extends SWCommand {
public WhoisCommand() { public WhoisCommand() {
super("whois", "bungeecore.teamchat"); super("whois");
} }
@Register(description = "WHOIS_USAGE") @Register(description = "WHOIS_USAGE")
@ -79,13 +78,22 @@ public class WhoisCommand extends SWCommand {
} }
private static void sendUserinfo(ProxiedPlayer player, SteamwarUser user, EnumSet<WhoisParameterTypes> parameterTypes) { private static void sendUserinfo(ProxiedPlayer player, SteamwarUser user, EnumSet<WhoisParameterTypes> parameterTypes) {
UserGroup userGroup = SteamwarUser.get(player.getUniqueId()).getUserGroup();
Message.send("WHOIS_USERNAME", player, user.getUserName()); 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());
Message.send("WHOIS_GROUP", player, user.getUserGroup().getColorCode(), user.getUserGroup().name()); Message.send("WHOIS_GROUP", player, user.getUserGroup().getColorCode(), user.getUserGroup().name());
if (user.getDiscordId() != null) { Team team = Team.get(user.getTeam());
Message.send("WHOIS_DISCORD_ID", player, user.getDiscordId()); 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());
if (!userGroup.isTeamGroup()) return;
if (userGroup.isAdminGroup()) {
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());
if (user.getDiscordId() != null) {
Message.send("WHOIS_DISCORD_ID", player, user.getDiscordId());
}
} }
Timestamp firstJoin = user.getFirstjoin(); Timestamp firstJoin = user.getFirstjoin();
if (firstJoin == null) { if (firstJoin == null) {
Message.send("WHOIS_JOINED_FIRST", player, "0000-00-00 00:00:00"); Message.send("WHOIS_JOINED_FIRST", player, "0000-00-00 00:00:00");
@ -101,9 +109,6 @@ public class WhoisCommand extends SWCommand {
Message.send("WHOIS_CURRENT_PROTOCOL", player, target.getPendingConnection().getVersion()); Message.send("WHOIS_CURRENT_PROTOCOL", player, target.getPendingConnection().getVersion());
} }
Team team = Team.get(user.getTeam());
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());
if (Utils.playerModMap.containsKey(user.getUuid())) { if (Utils.playerModMap.containsKey(user.getUuid())) {
Mod.Platform modPlatform = Utils.playerModMap.get(user.getUuid()).get(0).getPlatform(); Mod.Platform modPlatform = Utils.playerModMap.get(user.getUuid()).get(0).getPlatform();
Message.send("WHOIS_PLATFORM", player, modPlatform.toString()); Message.send("WHOIS_PLATFORM", player, modPlatform.toString());