Skip to content

Commit

Permalink
Add %statz_time_formatted% placeholder.
Browse files Browse the repository at this point in the history
  • Loading branch information
Staartvin committed Feb 2, 2021
1 parent a748cb8 commit 72235e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/me/staartvin/statz/placeholders/StatzPlaceholders.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")) {
Expand Down

0 comments on commit 72235e5

Please sign in to comment.