Skip to content
Closed
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
import org.bukkit.Server;
import org.bukkit.Statistic;

import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.List;
import java.util.Locale;

import static com.earth2me.essentials.I18n.tl;

public class Commandwhois extends EssentialsCommand {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd HH:mm");
// For some reason, in 1.13 PLAY_ONE_MINUTE = ticks played = what used to be PLAY_ONE_TICK
// https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/b848d8ce633871b52115247b089029749c02f579
private static final Statistic PLAY_ONE_TICK = EnumUtil.getStatistic("PLAY_ONE_MINUTE", "PLAY_ONE_TICK");
Expand All @@ -35,6 +37,7 @@ public void run(final Server server, final CommandSource sender, final String co
sender.sendMessage(tl("whoisTop", user.getName()));
user.setDisplayNick();
sender.sendMessage(tl("whoisNick", user.getDisplayName()));
sender.sendMessage(tl("whoisJoined", DateUtil.formatDateDiff(user.getBase().getFirstPlayed()), DATE_FORMAT.format(user.getBase().getFirstPlayed())));
sender.sendMessage(tl("whoisUuid", user.getBase().getUniqueId().toString()));
sender.sendMessage(tl("whoisHealth", user.getBase().getHealth()));
sender.sendMessage(tl("whoisHunger", user.getBase().getFoodLevel(), user.getBase().getSaturation()));
Expand Down
1 change: 1 addition & 0 deletions Essentials/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,7 @@ whoisHealth=\u00a76 - Health\:\u00a7r {0}/20
whoisHunger=\u00a76 - Hunger\:\u00a7r {0}/20 (+{1} saturation)
whoisIPAddress=\u00a76 - IP Address\:\u00a7r {0}
whoisJail=\u00a76 - Jail\:\u00a7r {0}
whoisJoined=\u00a76 - First Joined\:\u00a7r {0} ago
whoisLocation=\u00a76 - Location\:\u00a7r ({0}, {1}, {2}, {3})
whoisMoney=\u00a76 - Money\:\u00a7r {0}
whoisMuted=\u00a76 - Muted\:\u00a7r {0}
Expand Down