-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add first and last played to /seen output #4618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
P.S. This is on all the time on my server, and my players really like it. That's why I didn't include a permissions check. |
|
A similar PR has been proposed before, I would recommend looking through the comments on #4265 for context. |
|
If many people want that small simple feature, why don't just add it and allow users to choose if they want to use it or not? There's no other way to get this information about an offline player. |
There were some opinions in the previous PR as to whether this belongs in |
|
This definitely belongs in /seen, not /whois. If you want to make it optional, I can add a permission. My PR uses the Java predefined date and time styles based on the locale of the server. So if you're in France, it will show 6 novembre 2021, 17:49. I've had this feature on my server for 7 years! It's really convenient. When I had to temporarily remove my plugin due to a Minecraft update, my players were asking me what happened to the join / last played dates. |
|
My personal opinion is that a permission isn't necessary here, since I don't see why anyone would want to hide this like they would for UUID or GeoIP. For the date format I think we still want to consider how we could expose this to translators and make it consistent with the format used in other parts of the plugin (notably mail). Automatically setting the style based on the locale of the server means that it will ignore changes to the language setting in the Essentials configuration, which obviously isn't the best. |
|
I can specify the locale when calling DateFormat#getDateTimeInstance. But if you want it to be the same as the ugly timestamp for mail, we can make this ugly, too. |
|
Correct me if I'm wrong, but mail has the date and time format hardcoded. How is that better? And it doesn't account for the Essentials language setting or the locale.
Java lets you construct a Locale based on a language string and, optionally, a country string. |
I'm not suggesting one format over the other. As far as I know, before the mail revamp, there were no such date formats displayed in Essentials as everything only used datediff.
It's not better, which is why I have been saying that this needs to be exposed to translators, regardless of what default one might think looks "good" or "ugly" (which is completely subjective). Updating the mail format is outside the scope of this PR but it should definitely also be updated. |
|
I can do some experimenting with Java's Locale and the Essentials' setting. But of course, I won't know if Japanese or Thai is correct. It looks like Java's processing of locales has changed over the years. What version of Java is used to compile Essentials? If I were to make a Locale object based on the config setting that different parts of Essentials can use, where should that object be created? |
|
Thanks for taking initiative. Essentials still supports Java 8 since older versions of Minecraft cannot be run on newer Java versions. For the locale it looks like you should already be able to get this using |
Cool! That should make it easier. I'll work on this more tomorrow. |
|
This PR now uses the Essentials' locale defined in its config file. Here are examples using en (default), en_GB (note change in date format from Month Day Year to Day Month Year and use of 24 hour time), de, fr, and ru. Only change between each example was changing the config's locale and doing ess reload. |
|
Hey guys, I finished this PR two weeks ago. Any additional comments? |
|
I'm not particularly keen on adding even more info lines to |
|
Alright. |

Information
This PR closes #4572 .
Details
Proposed feature:
This PR adds the online/offline player getFirstPlayed() and getLastPlayed() to the output of the /seen command. This can be useful to see if someone is a long-time player on the server.
Environments tested:
OS: Windows 10
Java version: Java(TM) SE Runtime Environment (build 16.0.2+7-67)
Demonstration:
I could add a permissions check if you'd like (I'd probably choose essentials.seen.dates unless you have some other preference).
While I'm in here, I could also fix up the UUID and history order which is half done as part of another PR.