Skip to content
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

Add playtime command #4562

Merged
merged 9 commits into from
Oct 23, 2021
Merged

Add playtime command #4562

merged 9 commits into from
Oct 23, 2021

Conversation

melluh
Copy link
Contributor

@melluh melluh commented Oct 5, 2021

Information

This PR closes #3827.

Details

Proposed feature:

Allow players to view their own or another player's playtime.

Environments tested:

OS: Windows 10

Java version: java version "16.0.1" 2021-04-20

  • Most recent Paper version (1.17.1, git-Paper-fdd5c65)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

2021-10-05_22 11 40
2021-10-05_22 11 47

@JRoy JRoy added module: main Issues or PRs for the main Essentials module type: enhancement Features and feature requests. labels Oct 5, 2021
melluh and others added 2 commits October 5, 2021 23:07
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
@melluh melluh requested a review from JRoy October 5, 2021 21:09
JRoy and others added 2 commits October 5, 2021 17:14
- Made it actually compile (oops sorry)
- Handle permissions correctly
- Put new messages in the right place in message.properties
@melluh melluh requested a review from JRoy October 5, 2021 21:35
@JRoy JRoy merged commit edd1513 into EssentialsX:2.x Oct 23, 2021
@ghost
Copy link

ghost commented Nov 4, 2021

@MisterMelDev, would it be possible to add offline playtime support? This would be insanely useful.

@melluh
Copy link
Contributor Author

melluh commented Nov 7, 2021

@MisterMelDev, would it be possible to add offline playtime support? This would be insanely useful.

The way I implemented this, it currently wouldn't be possible. I'm using the built-in Bukkit statistics system, which also contains a statistic for playtime, but this can only be retrieved when the player is online. The plugin would have to store the playtime in the player data or something. I'm a bit busy currently, but maybe someone else could make a PR for that?

@serious-angel
Copy link

The way I implemented this

Greetings! Just in case if still interested in offline data, there are a few implementation like the following wonderful one for a reference:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: main Issues or PRs for the main Essentials module type: enhancement Features and feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a way to see the amount of time another player has played on the server, e.g. /playtime (player)
3 participants