浏览代码

Commands.Database.CooldownMS - new locale string

nossr50 6 年之前
父节点
当前提交
b5cbfc7f66

+ 1 - 0
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

+ 3 - 3
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));
     }
 }

+ 1 - 1
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!