forked from SteamWar/SteamWar
Add LastOnline to WhoisCommand
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user