From af226560428ae45183b1c455d0009e7270a8c0cb Mon Sep 17 00:00:00 2001 From: ASangarin Date: Wed, 2 Dec 2020 19:00:27 +0100 Subject: [PATCH] Fixed Placeholders --- .../Indyuce/mmocore/comp/placeholder/RPGPlaceholders.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 8fd0ba7d..f5c0a7ad 100644 --- a/src/main/java/net/Indyuce/mmocore/comp/placeholder/RPGPlaceholders.java +++ b/src/main/java/net/Indyuce/mmocore/comp/placeholder/RPGPlaceholders.java @@ -41,10 +41,9 @@ public class RPGPlaceholders extends PlaceholderExpansion { return MMOCore.plugin.getDescription().getVersion(); } + @SuppressWarnings("DuplicateExpressions") @Override public String onRequest(@Nullable OfflinePlayer player, @NotNull String identifier) { - final String subIdent = identifier.substring(10).toLowerCase().replace("_", "-"); - if(identifier.equals("mana_icon")) return PlayerData.get(player).getProfess().getManaDisplay().getIcon(); if(identifier.equals("mana_name")) @@ -129,7 +128,7 @@ public class RPGPlaceholders extends PlaceholderExpansion { else if (identifier.startsWith("attribute_")) return String.valueOf(PlayerData.get(player).getAttributes() - .getAttribute(MMOCore.plugin.attributeManager.get(subIdent))); + .getAttribute(MMOCore.plugin.attributeManager.get(identifier.substring(10).toLowerCase().replace("_", "-")))); else if (identifier.equals("mana")) return MMOCore.plugin.configManager.decimal.format(PlayerData.get(player).getMana()); @@ -146,7 +145,7 @@ public class RPGPlaceholders extends PlaceholderExpansion { } else if (identifier.startsWith("exp_boost_")) { - String format = subIdent.replace(" ", "-"); + String format = identifier.substring(10).toLowerCase().replace("_", "-").replace(" ", "-"); Profession profession = format.equals("main") ? null : MMOCore.plugin.professionManager.get(format); return MMOCore.plugin.configManager.decimal.format((MMOCore.plugin.boosterManager.getMultiplier(profession) - 1) * 100); }