Merge pull request #86 from deanle8/master

Add internal placeholder color of tier
This commit is contained in:
nulli0n 2023-11-28 16:53:02 +05:00 committed by GitHub
commit b8308e112e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -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%";

View File

@ -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)))