From b5cbfc7f66feec50248738025a6b554b399fe7eb Mon Sep 17 00:00:00 2001 From: nossr50 Date: Fri, 12 Apr 2019 15:29:37 -0700 Subject: [PATCH] Commands.Database.CooldownMS - new locale string --- Changelog.txt | 1 + .../com/gmail/nossr50/commands/player/McrankCommand.java | 6 +++--- src/main/resources/locale/locale_en_US.properties | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 9806d5f17..3daef5543 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -10,6 +10,7 @@ Key: Version 2.1.41 Fixed NullPointerException errors when trying to grab PlayerProfiles for players who have not loaded Added new locale string Profile.PendingLoad + Added new locale string Commands.Database.CooldownMS Fixed a display error preventing the remaining time on /mcrank from being shown if it was on cooldown Version 2.1.40 diff --git a/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java b/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java index e61bd733f..86b6e239e 100644 --- a/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/player/McrankCommand.java @@ -95,10 +95,10 @@ public class McrankCommand implements TabExecutor { return; } - long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750); + long cooldownMillis = Math.min(Config.getInstance().getDatabasePlayerCooldown(), 1750); if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) { - sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown", getCDSeconds(mcMMOPlayer, cooldownMillis))); + sender.sendMessage(LocaleLoader.getString("Commands.Database.CooldownMS", getCDSeconds(mcMMOPlayer, cooldownMillis))); return; } @@ -119,6 +119,6 @@ public class McrankCommand implements TabExecutor { } private long getCDSeconds(McMMOPlayer mcMMOPlayer, long cooldownMillis) { - return (System.currentTimeMillis() - (mcMMOPlayer.getDatabaseATS() + cooldownMillis)) / 1000; + return (System.currentTimeMillis() - (mcMMOPlayer.getDatabaseATS() + cooldownMillis)); } } diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 52de864cb..c9e1f4e82 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -569,7 +569,7 @@ Commands.Chat.Console=*Console* Commands.Cooldowns.Header=[[GOLD]]--= [[GREEN]]mcMMO Ability Cooldowns[[GOLD]] =-- Commands.Cooldowns.Row.N=\ [[RED]]{0}[[WHITE]] - [[GOLD]]{1} seconds left Commands.Cooldowns.Row.Y=\ [[AQUA]]{0}[[WHITE]] - [[DARK_GREEN]]Ready! -Commands.Database.Cooldown=You must wait {0} seconds before using this command again. +Commands.Database.CooldownMS=You must wait {0} milliseconds before using this command again. Commands.Database.Processing=Your previous command is still being processed. Please wait. Commands.Disabled=This command is disabled. Commands.DoesNotExist= [[RED]]Player does not exist in the database!