mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Fix mcrank cd display
This commit is contained in:
parent
33a68daa9c
commit
6e3c2fcb76
@ -10,6 +10,7 @@ Key:
|
|||||||
Version 2.1.41
|
Version 2.1.41
|
||||||
Fixed NullPointerException errors when trying to grab PlayerProfiles for players who have not loaded
|
Fixed NullPointerException errors when trying to grab PlayerProfiles for players who have not loaded
|
||||||
Added new locale string Profile.PendingLoad
|
Added new locale string Profile.PendingLoad
|
||||||
|
Fixed a display error preventing the remaining time on /mcrank from being shown if it was on cooldown
|
||||||
|
|
||||||
Version 2.1.40
|
Version 2.1.40
|
||||||
(API) mcMMO will now return null in all cases for UserManager.getPlayerProfile() if they have not been loaded yet
|
(API) mcMMO will now return null in all cases for UserManager.getPlayerProfile() if they have not been loaded yet
|
||||||
|
@ -98,7 +98,7 @@ public class McrankCommand implements TabExecutor {
|
|||||||
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
|
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
|
||||||
|
|
||||||
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
|
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
|
||||||
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown", getCDSeconds(mcMMOPlayer, cooldownMillis));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,4 +117,8 @@ public class McrankCommand implements TabExecutor {
|
|||||||
|
|
||||||
new McrankCommandAsyncTask(playerName, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
|
new McrankCommandAsyncTask(playerName, sender, useBoard, useChat).runTaskAsynchronously(mcMMO.p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private long getCDSeconds(McMMOPlayer mcMMOPlayer, long cooldownMillis) {
|
||||||
|
return (System.currentTimeMillis() - (mcMMOPlayer.getDatabaseATS() + cooldownMillis)) / 1000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user