From 445352590090826156d50b9cc979d69788ca1051 Mon Sep 17 00:00:00 2001 From: Indyuce Date: Fri, 1 May 2020 19:16:54 +0200 Subject: [PATCH] Added %mmocore_bound<1-to-6>% placeholder --- .../Indyuce/mmocore/comp/placeholder/RPGPlaceholders.java | 7 +++++++ .../java/net/Indyuce/mmocore/manager/ConfigManager.java | 3 ++- src/main/resources/default/messages.yml | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/Indyuce/mmocore/comp/placeholder/RPGPlaceholders.java b/src/main/java/net/Indyuce/mmocore/comp/placeholder/RPGPlaceholders.java index f85e4edd..721d8e89 100644 --- a/src/main/java/net/Indyuce/mmocore/comp/placeholder/RPGPlaceholders.java +++ b/src/main/java/net/Indyuce/mmocore/comp/placeholder/RPGPlaceholders.java @@ -62,6 +62,13 @@ public class RPGPlaceholders return MMOCore.plugin.configManager.decimal.format(current / next * 100); } + else if (identifier.startsWith("bound_")) { + int slot = Math.max(0, Integer.parseInt(identifier.substring(6)) - 1); + PlayerData playerData = PlayerData.get(player); + return playerData.hasSkillBound(slot) ? playerData.getBoundSkill(slot).getSkill().getName() + : MMOCore.plugin.configManager.noSkillBoundPlaceholder; + } + else if (identifier.startsWith("profession_")) return "" + PlayerData.get(player).getCollectionSkills() .getLevel(identifier.substring(11).replace(" ", "-").replace("_", "-").toLowerCase()); diff --git a/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java b/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java index f71d1a71..76197ce5 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/ConfigManager.java @@ -25,7 +25,7 @@ public class ConfigManager { public boolean overrideVanillaExp, hotbarSwap; public double expPartyBuff, regenPartyBuff; - public String partyChatPrefix; + public String partyChatPrefix, noSkillBoundPlaceholder; public ChatColor staminaFull, staminaHalf, staminaEmpty; public int combatLogTimer, lootChestExpireTime; @@ -101,6 +101,7 @@ public class ConfigManager { formatSymbols.setDecimalSeparator(getFirstChar(MMOCore.plugin.getConfig().getString("number-format.decimal-separator"), ',')); combatLogTimer = MMOCore.plugin.getConfig().getInt("combat-log.timer"); lootChestExpireTime = Math.max(MMOCore.plugin.getConfig().getInt("loot-chest-expire-time"), 1) * 1000; + noSkillBoundPlaceholder = getSimpleMessage("no-skill-placeholder").message(); staminaFull = getColorOrDefault("stamina-whole", ChatColor.GREEN); staminaHalf = getColorOrDefault("stamina-half", ChatColor.DARK_GREEN); diff --git a/src/main/resources/default/messages.yml b/src/main/resources/default/messages.yml index 51078d21..3723dc74 100644 --- a/src/main/resources/default/messages.yml +++ b/src/main/resources/default/messages.yml @@ -163,3 +163,4 @@ not-unlocked-skill: '&cYou have not unlocked that skill yet.' no-skill-bound: '&cYou don''t have any skill bound to this slot.' not-active-skill: '&cThis is not an active skill.' skill-max-level-hit: '&cYou already hit the max level for that skill.' +no-skill-placeholder: 'No Skill Bound'