Mctop Cooldown message correction. Closes https://github.com/mcMMO-Dev/mcMMO/issues/3470 (#3481)

This commit is contained in:
Jamie Sinn 2018-07-15 10:08:52 -04:00 committed by t00thpick1
parent 9ce850f84f
commit aee60f2c09
2 changed files with 20 additions and 16 deletions

View File

@ -1,8 +1,16 @@
package com.gmail.nossr50.commands.player;
import java.util.ArrayList;
import java.util.List;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.commands.MctopCommandAsyncTask;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
@ -10,17 +18,8 @@ import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.util.StringUtil;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.skills.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.runnables.commands.MctopCommandAsyncTask;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.commands.CommandUtils;
import com.gmail.nossr50.util.player.UserManager;
import com.google.common.collect.ImmutableList;
import java.util.ArrayList;
import java.util.List;
public class MctopCommand implements TabExecutor {
@Override
@ -91,7 +90,12 @@ public class MctopCommand implements TabExecutor {
long cooldownMillis = Math.max(Config.getInstance().getDatabasePlayerCooldown(), 1750);
if (mcMMOPlayer.getDatabaseATS() + cooldownMillis > System.currentTimeMillis()) {
sender.sendMessage(LocaleLoader.getString("Commands.Database.Cooldown"));
double seconds = ((mcMMOPlayer.getDatabaseATS() + cooldownMillis) - System.currentTimeMillis()) / 1000;
if (seconds < 1) {
seconds = 1;
}
sender.sendMessage(LocaleLoader.formatString("Commands.Database.Cooldown", seconds));
return;
}

View File

@ -456,7 +456,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=[[RED]]You must wait 1 second before using this command again.
Commands.Database.Cooldown=[[RED]]You must wait {0} seconds before using this command again.
Commands.Database.Processing=[[RED]]Your previous command is still being processed. Please wait.
Commands.Disabled=[[RED]]This command is disabled.
Commands.DoesNotExist= [[RED]]Player does not exist in the database!