Fixed a Bug where /ptr reload doesn't reload the Rewards correctly (as reported by
@z3tw1n1 -
post )
Added a few new Placeholders:
Code (Text):
- PLAYTIME_DAYS: Returns the Total Playtime in Days
- PLAYTIME_HOURS: Returns the Total Playtime in Hours
- PLAYTIME_MINUTES: Returns the Total Playtime in Minutes
- PLAYTIME_SECONDS: Returns the Total Playtime in Seconds
- SESSIONTIME_DAYS: Returns the Total Sessiontime in Days
- SESSIONTIME_HOURS: Returns the Total Sessiontime in Days
- SESSIONTIME_MINUTES: Returns the Total Sessiontime in Days
- SESSIONTIME_SECONDS: Returns the Total Sessiontime in Days
First things first:
I want to announce that the Plugin's repository on Github is now public.
Now to the Update:
- Fixed a Problem with the 'playtimerewards.*' Permission, not granting the 'playtimerewards.cmd.playtime.other.offline' Permission.
- Fixed a Bug where the /Playtimetop Order was displayed in Reversed order, as Mentioned by
@mercao (
https://www.spigotmc.org/goto/post?id=4428264#post-4428264)
And one other small Addition:
- Rewardnames and Texts in Rewards are now also compatible with the Hex-Colors
1.19! Basically it just makes the Plugin ready for Spigot 1.19.
Due to an (now fixed) error, the previous Version didn't recognize the Version correctly and disabled the Plugin therefore.
This shouldn't happen anymore.
HexColors! On the other Hand are getting Hex Colors introduced by this Update.
Which means may specify Hex-Values for Colors for the Messages sent by the Plugin (even Color Ranges!).
Just edit your lang.yml File using the Following Syntax:
For Simple Hex Colors:
§([HexColor])
Code (YAML):
# The Return Message from the /playtime Command CMD_SUC_PT_OWN: |-
§
(fc03ad
)Your Playtime is
%[0]d %[1]h %[2]m %[3]s Your Sessiontime is
%[4]d %[5]h %[6]m %[7]s
This Code produces this Output:
For Hex Color Ranges:
§([HexRangeBeginning]-) [Some random Text] §(-[HexRangeEnding])
Code (YAML):
# The Return Message from the /playtime Command CMD_SUC_PT_OWN: |-
§
(031cfc-
)Your Playtime is
%[0]d %[1]h %[2]m %[3]s Your Sessiontime is
%[4]d %[5]h %[6]m %[7]s §(-fc03ad)
And this Code produces this Output:
Other small Changes: - When using the UpdateNotification Function, the Title of the Latest Update get's also displayed into the Notification when a new Update is found.
(
small) Update Time!
No new Features for now, i just found a bug and thought I'd fix it directly.
So this Update can be seen as a
Hotfix:
Minecraft Servers in offline-mode use another Format for Player UUIDs. This could lead to incorrect data getting displayed when using
/pt <offlineplayer> on offline-mode servers.
This has been fixed.
The duplicate
[PlaytimeRewards] prefix for console Messages shouldn't occur anymore.
This Plugin supports now the PlaceholderAPI. This means in every customizable Message involving a Player you can use PAPI-Placeholders!
This Update also adds the following PAPI-Placeholders for you to use:
Code (Text):
- %ptr_playtime% -> Returns the Playtime for the Player, the message format is defined as 'EXT_PAPI_TIME_FORMAT'
- %ptr_sessiontime% -> Returns the Sessiontime for the Player, the message format is defined as 'EXT_PAPI_TIME_FORMAT'
Everything will get set-up automatically if you're running this Update and PAPI on your Server. You'll also get a Notification Message in your Console if it detects PAPI is installed.
AFK-System:
This Plugin comes now with an AFK-System. This means AFK-flagged Players no longer earn Rewards. If a Player returns from being afk (or leaves the Server), his AFK-Time will get subtracted from his Playtime.
This means if other Plugins use Minecrafts Playtimecounter, they will also get the correct values without a Players AFK-Time.
The "You're flagged as AFK" and "Welcome Back" Messages (
NOTIF_AFK_USER_WENT_AFK &
NOTIF_AFK_USER_CAME_BACK) can get customized in the lang.yml File.
Players with the Permission '
playtimerewards.afk.ignore' will never get flagged as afk.
You can enable/disable and configure it in the config.yml File
(This was btw a suggested Feature by
@NDTurtle )
Overall Commands: Tab-Completion has been added for all commands.
New Command /playtimetop (/pttop):
This Command shows the top 10 (Amount configurable in the Config) Players with the most Playtime on the Server. It needs the new Permission '
playtimerewards.cmd.playtimetop' to be executed. You can specify the output Messages (
CMD_SUC_PTTOP_HEADER &
CMD_SUC_PTTOP_ENTRY) in the lang.yml.
New Command /playtimerewards (/ptr list|reload):
This Command comes with two possible parameters: list & reload.
/ptr list lists all registered Rewards. It needs the Permission '
playtimerewards.cmd.playtimerewards.list'. You can configure the output Messages (
CMD_SUC_PTR_LIST_HEADER &
CMD_SUC_PTR_LIST_ENTRY) in the lang.yml.
/ptr reload reloads all Plugin data - e.g. the config.yml, the lang.yml and the rewards.yml. It needs the new Permission '
playtimerewards.cmd.playtimerewards.reload' and the output Message (
CMD_SUC_PTR_RELOAD_SUCCESS) can be configured in the lang.yml.
The new Permission '
playtimerewards.cmd.playtimerewards.*' grants access to all subcommands of /playtimerewards.
/Playtime <Offlineplayer>
The /Playtime command supports now the reading of a Players Playtime even if the specified Player is offline (This is limited to one Request every 10 Seconds per Player). You need the new Permission '
playtimerewards.cmd.playtime.other.offline' to execute it.
Reward Actionbar
Added the Value Display.ActionbarMessage. If this Values is specified, the Message get's sent to the Players Actionbar upon earning the Reward.
Now we're talking Files: If you're running a Minecraft Server with Version 1.18 or later, Comments from your yaml Files will no longer get overwritten (applies both to the config.yml and to the lang.yml).
The Config.yml: The Config.yml got a new "Layout" - nicer looking Comments etc.
A new Section for the AFK-System got added, as well as the Values
"AllowAutoUpdate <boolean>" and "PlaytimeTopAmount <int>".
Take a look at it:
Code (YAML):
#This Option downloads the latest Version of the Plugin and installs it upon a reboot. AllowAutoUpdate: false
#The Amount of Players that get displayed by the Playtimetop-Command PlaytimeTopAmount: 10
#AFK-Block AFK: #Enables or Disables the whole AFK-System. #When set to false, no other AFK-Value does anything. Enable: false
#Here you can define, how much time needs to pass without an Action from the Player, #to flag the Player as AFK. Time: '10m'
#Defines whether a Player Movement resets his AFK-Status CancelOnMove: true
#Defines if a Players AFK-Status is reset by looking around CancelOnLook: true
#Defines whether a Player Interaction resets his AFK-Status #(Interaction is any Sort of Right or Left Mouse Button Click) CancelOnInteract: true
#Defines if Chatting resets the AFK-Status CancelOnChat: true
#Defines if executing Commands resets the AFK-Status CancelOnCommand: true
As always, these new Values will appear in your Config FIle once youre running the new Version of the Plugin.
The last thing we're talking about are the Messages - the lang.yml File.
The Message System got a full rewrite (i used an older, messier System from another Project until now). You shouldn't really notice a thing except a cleaner looking lang.yml if your using MC1.18+.
I also added the following Messages:
Code (YAML):
# The Return Message from the /playtime <offlineplayer> Command CMD_SUC_PT_OTHER_OFFLINE: §6
%[0]§a's Playtime is %[1]d %[2]h %[3]m %[4]s
# The First Part of the /Playtimetop Command CMD_SUC_PTTOP_HEADER: '§7Listing the top §b
%[0] §7Playtimes:'
# This Message gets printed once for each Entry from the /Playtimetop Command CMD_SUC_PTTOP_ENTRY: '§6
%[0]§7: §b%[1]§7 - has played %[2]d %[3]h %[4]m and %[5]s'
# The first Part of the /Playtimerewards list Command CMD_SUC_PTR_LIST_HEADER: |-
§7Listing
all §b
%[0]§7 Rewards: §8Internal Name -- DisplayName -- CountType
# This Message gets printed once for each Entry from the /Playtimerewards list Command CMD_SUC_PTR_LIST_ENTRY: §3
%[0] §8-- §1%[1] §8-- §7%[2]
# The Return Message from the /Playtimerewards reload Command CMD_SUC_PTR_RELOAD_SUCCESS: §aSuccessfully reloaded the external Data!
# A Error Message when too many Requests are sent from a Player using /pt <offlineplayer> CMD_ERR_TOO_MANY_REQUESTS: §4You can't do that right now. Try again later!
# The Message sent to Players who get flagged as afk NOTIF_AFK_USER_WENT_AS_AFK: §7You are now flagged as AFK
# The Message sent to Players when coming back NOTIF_AFK_USER_CAME_BACK: §7You are
no longer flagged as AFK
# The Format in which all Times get sent to the PlaceholderAPI EXT_PAPI_TIME_FORMAT: '
%[0]d %[1]h %[2]m %[3]s'
Thanks for reading this!
If you want, there is an even more detailed changelog:
Code (Text):
Changelog Version 0.1.3:
- Removed compiled Stuff from the final jar(s):
- Removed internal, unneeded resources from being packed into the final Jar
- Removed older classes, that weren't used anymore from the project
- Created a MojangAPI Utility Class
- Allows to lookup Player UUIDs from their Name
- This Allows the Plugin to retrieve Playtime from Offline Players
- This is currently limited to 6 Requests per Minute per Player
- Rewrote the whole Message System. It is now based on Enums instead of plain Strings
- Messages can now be hidden in the lang.yml file
-> This means they aren't in the File by default, but they exist in the Plugin.
One could add them on his own to the File, and the Plugin would recognize and use them
- The lang.yml File gets dynamically updated upon Missing Values
-> In all Versions since MC1.18 Comments also get written into the File
- No Real Change to the End-User, this was only an internal Change.
- Added a bunch of new Messages:
- CMD_SUC_PT_OTHER_OFFLINE -> The Message returned upon requesting the Playtime of an Offline Player
- CMD_ERR_TOO_MANY_REQUESTS -> The Message when a user tries to send too many API-Requests
- CMD_SUC_PTTOP_HEADER -> Defines the Header of the /Playtimetop Command
- CMD_SUC_PTTOP_ENTRY -> Defines each Data-Entry of the /Playtimetop Command
- CMD_SUC_PTR_LIST_HEADER -> Defines the Header of the /Playtimerewards list Command
- CMD_SUC_PTR_LIST_ENTRY -> Defines each Data-Entry of the /Playtimerewards list Command
- CMD_SUC_PTR_RELOAD_SUCCESS -> The /Playtimereward reload success Message
- NOTIF_AFK_USER_WENT_AFK -> The Message to inform the User that he is flagged as afk.
- NOTIF_AFK_USER_CAME_BACK -> The "Welcome-Back" Message
- EXT_PAPI_TIME_FORMAT -> Defines the Time Format for the PlaceholderAPI's placeholders from this Plugin.
- Added even more messages, which are unused and hidden in v0.1.3:
- CMD_WARN_PTR_RELOAD -> The warning Message that Rewards dont get reloaded, as some Rewards are in Edit-Mode
- GUI_EDIT_REWARD_WINDOWNAME -> The Windowname of the Edit-Reward GUI
- GUI_EDIT_REWARD_EXIT_NOSAVE_NAME -> The Name of the Exit-without-Saving-Reward-GUI Item
- GUI_EDIT_REWARD_EXIT_NOSAVE_LORE -> The Lore of the Exit-without-Saving-Reward-GUI Item
- GUI_EDIT_REWARD_EXIT_SAVE_NAME -> The Name of the Exit-with-Saving-Reward-GUI Item
- GUI_EDIT_REWARD_EXIT_SAVE_LORE -> The Lore of the Exit-with-Saving-Reward-GUI Item
- The following Messages all define the different editable fields of a reward
- GUI_EDIT_TRANSL_DISPLAYNAME
- GUI_EDIT_TRANSL_ISREPEATING
- GUI_EDIT_TRANSL_GRANTFIRST
- GUI_EDIT_TRANSL_CONSOLECOMMANDS
- GUI_EDIT_TRANSL_PLAYERMESSAGES
- GUI_EDIT_TRANSL_GLOBALMESSAGES
- GUI_EDIT_TRANSL_ACTIONBARMESSAGE
- GUI_EDIT_TRANSL_PERMISSIONNEEDED
- GUI_EDIT_TRANSL_PARTICLES
- GUI_EDIT_TRANSL_SOUNDS
- New Permissions:
- playtimerewards.cmd.playtime.other.offline -> Allows the Player to see Offline Players Playtime
- playtimerewards.cmd.playtimetop -> Allows access to the /playtimetop command
- playtimerewards.cmd.playtimerewards.list -> Allows access to the /playtimerewards list command
- playtimerewards.cmd.playtimerewards.reload -> Allows access to the /playtimerewards reload command
- playtimerewards.cmd.playtimerewards.editreward -> Allows access to the /playtimerewards editreward command
- playtimerewards.cmd.playtimerewards.* -> Allows access to all /playtimerewards commands
- playtimerewards.afk.ignore -> Bypasses the afk system
- New Commands:
- /playtime [player] can now look up data from Players that aren't online
- Needs the new Permission 'playtimerewards.cmd.playtime.other.offline'
- /playtimetop (or /pttop)
- Lists the top x(amount specified in config.yml) players with the highest playtime
- Needs the new Permission 'playtimerewards.cmd.playtimetop'
- /playtimerewards list (/ptr list)
- Lists all registered Rewards
- Needs the new Permission 'playtimerewards.cmd.playtimerewards.list'
- /playtimerewards reload (/ptr reload)
- Reloads all Plugin Congifuration data
- Needs the new Permission 'playtimerewards.cmd.playtimerewards.reload'
- Internal, disabled /playtimerewards editreward <reward>
- Opens the Edit-GUI for the specified Reward
- Needs the new Permission 'playtimerewards.cmd.playtimerewards.editreward'
- Config Values:
- Value "AllowAutoUpdate" (boolean) allows to Automatically download the newest Plugin Version and install at the next server restart
- Hidden Value "AllowMetrics" (boolean) allows the user to disable bstats for this plugin. Default is true.
- Non-Hidden Values now get copied over into the config.yml -> support for updates
- In Versions since 1.18.* the Comments of Config Files now don't get overwritten anymore. This System can be used by all
types of embedded yml Files, although it is only used by the config.yml File here.
- Section "AFK":
- Value "AFK.Enable" (boolean) enables or disables the AFK-System
- Value "AFK.Time" (timeString) sets the Time until a Player gets flagged as AFK
- Value "AFK.CancelOnMove" (boolean) defines if a Player Movement surpresses getting flagged as afk
- Value "AFK.CancelOnLook" (boolean) defines if a Change in the Players View (e.g. Mouse moved) surpresses getting flagged as afk
- Value "AFK.CancelOnInteract" (boolean) defines if a Interaction (Right/Left Click) surpresses getting flagged as afk
- Value "AFK.CancelOnChat" (boolean) defines if Chatting surpresses getting flagged as afk
- Value "AFK.CancelOnCommand" (boolean) defines if executing Commands surpresses getting flagged as afk
- PlaceholderAPI Support:
- Added the following Placeholders:
- %ptr_playtime% -> Returns the Playtime for the Player, the message format is defined as 'EXT_PAPI_TIME_FORMAT'
- %ptr_sessiontime% -> Returns the Sessiontime for the Player, the message format is defined as 'EXT_PAPI_TIME_FORMAT'
- All custom Lang Messages can now use PlaceholderAPI's Placeholders.
- AFK-System:
- Players get flagged when going AFK.
- When Players Return their Playtime gets decreased by the lenght of their afk-time
- When a Player is flagged can be configured (AFK-Reset by Moving, Looking, Interacting, Chatting, use Command)
- Added a AFK_TIME RewardType, but for now it only serves an internal use to prevent AFK-Players to earn Rewards.
- Rewards:
- Added the Reward Value Display.ActionbarMessage (String)
-> if specified, the String gets sent to the Players Action Bar
Config: A Config.yml File got added. For now it's relatively empty, but nonetheless there are some Options. Let's look into it:
Code (YAML):
#Configuration File for [email protected]://www.spigotmc.org/resources/100231/ by ExoBite EnableUpdateCheck: true
#This Option only Notifies you when a New Version is online, it doesn't download anything. DataSaveInterval: '1h'
#Set to '-1' to Disable the Automatic Save Interval
The Option "EnableUpdateCheck" allows the Plugin to Check for an Update. For now it only checks for an Update, upon the Server Start.
If a newer Version is published, it'll tell you in the Console as well as it will notify Players with the new Permission "playtimerewards.notifyOnUpdate" upon Login.
The Option "DataSaveInterval" can be supplied with a Time, similiar to Rewards. If a Time is specified, it will automatically backup all Player-Related Data for all Players Online. You can set it to '-1' to disable this Function.
The Config.yml File will get generated in your Plugin Folder, upon executing the newer Version.
Messages: The lang.yml File got updated.
Code (YAML):
- New Messages: - NOTIF_UPDATE_AVAILABLE -> Notifies Users with
"playtimerewards.notifyOnUpdate"-Permission about a new Update
- CMD_SUC_PT_OTHER -> The Message Players receive when looking at other Players Playtime
- CMD_ERR_PLAYER_NOT_FOUND -> The Error that gets shown when the specified Player is not found
- Changed Messages: - Renamed PTR_SUC_PLAYTIMECOMMAND to CMD_SUC_PT_OWN
Your lang.yml File will update itself upon starting the Plugin.
Permissions: I've added a few Permissions (and changed one):
The first Permission is a wildcard Permission that grants all
The first second Permission was already explained above.
The third new Permission gets us to a new Function:
Commands: The /playtime command now got a new Parameter: /playtime [player]
The [player] Parameter allows Players to specify a Playername in order to see their Playtime. Only Players with the Permission "
playtimerewards.cmd.playtime.other" can use this Command.
Everything else is getting an Updated Explanation in the "Documentation" Tab of the Plugin, or it is listed in the detailed, changelog.
Hope you have a nice Day!
Code (Text):
Changelog Version 0.1.2:
- Added a Config.yml
- Value "EnableUpdateCheck" (boolean) controls whether the Plugin Notifies the Admins about a new Plugin Version
- Value "DataSaveInterval" (timeString) controls the Automatic Save Interval (-1 Disables the Autosave)
- Hidden Value "debug_allowDebugTools" (boolean) allows the access to the DebugTools
- Hidden Value "ColorCode" (char) sets the color code for the whole Plugin
- Added a bunch of new Permissions:
- Changed the Permission "timerewards.cmd.playtime.own" to "playtimerewards.cmd.playtime.own"
- Added the following Permissions:
- playtimerewards.*
- playtimerewards.notifyOnUpdate
- playtimerewards.cmd.playtime.other
- Changes to Messages:
- New Messages:
- NOTIF_UPDATE_AVAILABLE -> Notifies Users with "playtimerewards.notifyOnUpdate"-Permission about a new Update
- CMD_SUC_PT_OTHER -> The Message Players receive when looking at other Players Playtime
- CMD_ERR_PLAYER_NOT_FOUND -> The Error that gets shown when the specified Player is not found
- Changed Messages:
- Renamed PTR_SUC_PLAYTIMECOMMAND to CMD_SUC_PT_OWN
- The Lang class now recognizes Missing Messages. It Updates the lang.yml File and notifies the user.
- Changed Commands:
- /Playtime:
- Added the Parameter no. 1 "[Player]" (optional)
- Allows to check other Players Playtime
- Needs Permission "playtimerewards.cmd.playtime.other" to execute
- Sends Message "CMD_SUC_PT_OTHER"
- Added an Auto Updater using the Spiget-API
- For now it only checks for new Updates, it doesn't download them automatically.
- Maybe i'll add this in the Future-
- Players with the new Permission "playtimerewards.notifyOnUpdate" get a Notification upon login
- Added in the MOTD-System from the earlier PlaytimeRewards Plugin(s)
- Allows me (the Developer) to send MOTD's to ServerOwners, Notifying them about Hotfixes or similar stuff.
- Added the Reward Option 'PermissionNeeded'
- The Player needs the specified Permission in order to be able to earn the Reward
- This is an optional Field
- Made small changes to the Debug tools:
- Now it is possible to store reflection instances returned from a Method (without Parameters)
- update the debug#reflect help
- Added the Auto Save Task
- Added a link to the Plugin resource page on spigot to all default *.yml files
- Changed the PLAYER_PER_CYCLE Constant to 50 (from 100)
- The Plugin now fills the PlayerName in the <PLAYER> Placeholder
- Added a new Placeholder: <PLAYERDISPLAY> -> Fills in the Players Displayname (including prefixes, suffixes etc.)