From 72235e5d4d8c75fe8a84cc294b991291f8832034 Mon Sep 17 00:00:00 2001 From: Vincent Bolta Date: Tue, 2 Feb 2021 22:09:19 +0100 Subject: [PATCH] Add %statz_time_formatted% placeholder. --- src/me/staartvin/statz/placeholders/StatzPlaceholders.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/me/staartvin/statz/placeholders/StatzPlaceholders.java b/src/me/staartvin/statz/placeholders/StatzPlaceholders.java index 782f448..ae74d33 100644 --- a/src/me/staartvin/statz/placeholders/StatzPlaceholders.java +++ b/src/me/staartvin/statz/placeholders/StatzPlaceholders.java @@ -4,6 +4,7 @@ import me.staartvin.statz.Statz; import me.staartvin.statz.database.datatype.RowRequirement; import me.staartvin.statz.datamanager.player.PlayerStat; +import me.staartvin.statz.util.StatzUtil; import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.entity.EntityType; @@ -74,6 +75,9 @@ public String onRequest(OfflinePlayer player, @NotNull String params) { return plugin.getStatzAPI().getSpecificData(PlayerStat.KILLS_PLAYERS, player.getUniqueId()) + ""; } else if (params.equalsIgnoreCase("time_played")) { return plugin.getStatzAPI().getSpecificData(PlayerStat.TIME_PLAYED, player.getUniqueId()) + ""; + } else if (params.equalsIgnoreCase("time_played_formatted")) { + return StatzUtil.timeToString((int) Math.round(plugin.getStatzAPI().getSpecificData(PlayerStat.TIME_PLAYED, + player.getUniqueId())), StatzUtil.Time.MINUTES); } else if (params.equalsIgnoreCase("times_shorn")) { return plugin.getStatzAPI().getSpecificData(PlayerStat.TIMES_SHORN, player.getUniqueId()) + ""; } else if (params.equalsIgnoreCase("xp_gained")) {