mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-03-01 15:51:03 +01:00
Added s placeholder to item cd message
This commit is contained in:
parent
b1a2ae7cca
commit
69d3f8a962
@ -10,7 +10,7 @@ public enum Message {
|
||||
// General restrictions
|
||||
HANDS_TOO_CHARGED("You can't do anything, your hands are too charged.", "two-handed"),
|
||||
SPELL_ON_COOLDOWN("#progress# &eYou must wait #left# second#s# before casting this spell.", "ability-cooldown"),
|
||||
ITEM_ON_COOLDOWN("This item is on cooldown! Please wait #left#s.", "item-cooldown"),
|
||||
ITEM_ON_COOLDOWN("This item is on cooldown! Please wait #left# second#s#.", "item-cooldown"),
|
||||
NOT_ENOUGH_PERMS_COMMAND("You don't have enough permissions."),
|
||||
|
||||
// Item restrictions
|
||||
|
@ -71,8 +71,9 @@ public class ItemUse implements Listener {
|
||||
if (event.getAction().name().contains("RIGHT_CLICK")) {
|
||||
final String cooldownReference = getCooldownReference(useItem.getMMOItem());
|
||||
if (useItem.getPlayerData().getMMOPlayerData().getCooldownMap().isOnCooldown(cooldownReference)) {
|
||||
final double cd = useItem.getPlayerData().getMMOPlayerData().getCooldownMap().getCooldown(cooldownReference);
|
||||
Message.ITEM_ON_COOLDOWN
|
||||
.format(ChatColor.RED, "#left#", MythicLib.plugin.getMMOConfig().decimal.format(useItem.getPlayerData().getMMOPlayerData().getCooldownMap().getCooldown(cooldownReference)))
|
||||
.format(ChatColor.RED, "#left#", MythicLib.plugin.getMMOConfig().decimal.format(cd), "#s#", cd >= 2 ? "s" : "")
|
||||
.send(player);
|
||||
event.setUseItemInHand(Event.Result.DENY);
|
||||
return;
|
||||
@ -317,8 +318,9 @@ public class ItemUse implements Listener {
|
||||
|
||||
final String cooldownReference = getCooldownReference(useItem.getMMOItem());
|
||||
if (useItem.getPlayerData().getMMOPlayerData().getCooldownMap().isOnCooldown(cooldownReference)) {
|
||||
final double cd = useItem.getPlayerData().getMMOPlayerData().getCooldownMap().getCooldown(cooldownReference);
|
||||
Message.ITEM_ON_COOLDOWN
|
||||
.format(ChatColor.RED, "#left#", MythicLib.plugin.getMMOConfig().decimal.format(useItem.getPlayerData().getMMOPlayerData().getCooldownMap().getCooldown(cooldownReference)))
|
||||
.format(ChatColor.RED, "#left#", MythicLib.plugin.getMMOConfig().decimal.format(cd), "#s#", cd >= 2 ? "s" : "")
|
||||
.send(player);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user