Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ private void seenOnline(final CommandSource sender, final User user, final boole
sender.sendTl("whoisUuid", user.getBase().getUniqueId().toString());
}

if (sender.isAuthorized("essentials.seen.firstlogin")) {
sender.sendTl("whoisFirstLogin", DateUtil.formatDate(user.getBase().getFirstPlayed(), ess));
}

if (user.isAfk()) {
sender.sendTl("whoisAFK", CommonPlaceholders.trueFalse(sender, true));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.earth2me.essentials.utils;

import net.ess3.api.IEssentials;
import net.ess3.api.TranslatableException;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -170,4 +172,11 @@ public static String formatDateDiff(final Calendar fromDate, final Calendar toDa
}
return sb.toString().trim();
}

public static String formatDate(final long date, final IEssentials ess) {
final GregorianCalendar gc = new GregorianCalendar();
gc.setTimeInMillis(date);
final DateFormat df = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, ess.getI18n().getCurrentLocale());
return df.format(gc.getTime());
}
}
1 change: 1 addition & 0 deletions Essentials/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,7 @@ whoisPlaytime=<primary> - Playtime\:<reset> {0}
whoisTempBanned=<primary> - Ban expires\:<reset> {0}
whoisTop=<primary> \=\=\=\=\=\= WhoIs\:<secondary> {0} <primary>\=\=\=\=\=\=
whoisUuid=<primary> - UUID\:<reset> {0}
whoisFirstLogin=<primary> - First login:<reset> {0}
whoisWhitelist=<primary> - Whitelist\:<reset> {0}
workbenchCommandDescription=Opens up a workbench.
workbenchCommandUsage=/<command>
Expand Down
3 changes: 3 additions & 0 deletions Essentials/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,8 @@ permissions:
description: Allows access to the /seen command with location
essentials.seen.uuid:
description: Allows access to the /seen command with UUID
essentials.seen.firstlogin:
description: Allows access to the /seen command with first login time
essentials.seen.whitelist:
description: Allows access to the /seen command with whitelist status
essentials.seen.ipsearch:
Expand All @@ -1170,6 +1172,7 @@ permissions:
essentials.seen.ip: true
essentials.seen.location: true
essentials.seen.uuid: true
essentials.seen.firstlogin: true
essentials.seen.whitelist: true
essentials.sell:
description: Allows access to the /sell command
Expand Down
Loading