Add LastOnline to WhoisCommand

This commit is contained in:
2024-12-26 21:44:40 +01:00
parent 30ac38ef53
commit a16e1e8cee
4 changed files with 17 additions and 3 deletions
@@ -626,6 +626,7 @@ WHOIS_ID=§7ID§8: §e{0}
WHOIS_PERMS=§7Perms§8: §7{0}
WHOIS_DISCORD_ID=§7Discord-ID§8: §e{0}
WHOIS_JOINED_FIRST=§7Joined on§8: §e{0}
WHOIS_LAST_ONLINE=§7Last on§8: §e{0}
WHOIS_HOURS_PLAYED=§7Online Time§8: §e{0}h
WHOIS_CURRENT_PLAYED=§7Current Online Time§8: §e{0}m
WHOIS_CURRENT_SERVER=§7Current Server§8: §e{0}
@@ -602,6 +602,7 @@ WHOIS_UUID_HOVER=§eUUID Kopieren
WHOIS_ID=§7ID§8: §e{0}
WHOIS_DISCORD_ID=§7Discord-ID§8: §e{0}
WHOIS_JOINED_FIRST=§7Beigetreten am§8: §e{0}
WHOIS_LAST_ONLINE=§7Zuletzt online§8: §e{0}
WHOIS_HOURS_PLAYED=§7Spielzeit§8: §e{0}h
WHOIS_CURRENT_PLAYED=§7Aktuell online§8: §e{0}m
WHOIS_CURRENT_SERVER=§7Aktueller Server§8: §e{0}
@@ -20,15 +20,15 @@
package de.steamwar.velocitycore.commands;
import com.velocitypowered.api.proxy.Player;
import de.steamwar.persistent.Storage;
import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.mods.ModUtils;
import de.steamwar.command.PreviousArguments;
import de.steamwar.command.SWCommand;
import de.steamwar.command.TypeMapper;
import de.steamwar.messages.Chatter;
import de.steamwar.messages.Message;
import de.steamwar.persistent.Storage;
import de.steamwar.sql.*;
import de.steamwar.velocitycore.VelocityCore;
import de.steamwar.velocitycore.mods.ModUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;
import net.kyori.adventure.text.event.ClickEvent;
@@ -86,9 +86,12 @@ public class WhoisCommand extends SWCommand {
if(firstJoin == null && target != null) {
firstJoin = Storage.sessions.get(target);
}
Timestamp lastOnline = user.getLastOnline();
if(firstJoin != null)
sender.system("WHOIS_JOINED_FIRST", firstJoin.toString());
if (lastOnline != null)
sender.system("WHOIS_LAST_ONLINE", lastOnline.toString());
sender.system("WHOIS_HOURS_PLAYED", new DecimalFormat("###.##").format(onlineTime / 3600d));
if(target != null) {