From fcf77ff4937a11892b41d34ec2842f134f74ff59 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Sun, 19 Nov 2023 11:34:49 +0700 Subject: [PATCH] Add internal placeholder color of tier %enchantment_tier_color% -> return color of Tier --- .../java/su/nightexpress/excellentenchants/Placeholders.java | 1 + .../excellentenchants/enchantment/impl/ExcellentEnchant.java | 1 + 2 files changed, 2 insertions(+) diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/Placeholders.java b/Core/src/main/java/su/nightexpress/excellentenchants/Placeholders.java index 087a5b5..2d75a00 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/Placeholders.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/Placeholders.java @@ -26,6 +26,7 @@ public class Placeholders extends su.nexmedia.engine.utils.Placeholders { public static final String ENCHANTMENT_LEVEL_MIN = "%enchantment_level_min%"; public static final String ENCHANTMENT_LEVEL_MAX = "%enchantment_level_max%"; public static final String ENCHANTMENT_TIER = "%enchantment_tier%"; + public static final String ENCHANTMENT_TIER_COLOR = "%enchantment_tier_color%"; public static final String ENCHANTMENT_FIT_ITEM_TYPES = "%enchantment_fit_item_types%"; public static final String ENCHANTMENT_OBTAIN_CHANCE_ENCHANTING = "%enchantment_obtain_chance_enchanting%"; public static final String ENCHANTMENT_OBTAIN_CHANCE_VILLAGER = "%enchantment_obtain_chance_villager%"; diff --git a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/ExcellentEnchant.java b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/ExcellentEnchant.java index a879594..54d1ec8 100644 --- a/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/ExcellentEnchant.java +++ b/Core/src/main/java/su/nightexpress/excellentenchants/enchantment/impl/ExcellentEnchant.java @@ -70,6 +70,7 @@ public abstract class ExcellentEnchant extends Enchantment implements IEnchantme .add(Placeholders.ENCHANTMENT_LEVEL_MIN, () -> String.valueOf(this.getStartLevel())) .add(Placeholders.ENCHANTMENT_LEVEL_MAX, () -> String.valueOf(this.getMaxLevel())) .add(Placeholders.ENCHANTMENT_TIER, () -> this.getTier().getName()) + .add(Placeholders.ENCHANTMENT_TIER_COLOR, () -> String.valueOf(this.getTier().getColor())) .add(Placeholders.ENCHANTMENT_FIT_ITEM_TYPES, () -> String.join(", ", Stream.of(this.getFitItemTypes()).map(type -> plugin.getLangManager().getEnum(type)).toList())) .add(Placeholders.ENCHANTMENT_OBTAIN_CHANCE_ENCHANTING, () -> NumberUtil.format(this.getObtainChance(ObtainType.ENCHANTING))) .add(Placeholders.ENCHANTMENT_OBTAIN_CHANCE_VILLAGER, () -> NumberUtil.format(this.getObtainChance(ObtainType.VILLAGER)))