mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-26 01:01:22 +01:00
Added {} formatting support to custom rarity colors
This commit is contained in:
parent
9c6f2706ae
commit
47cc339b7d
@ -124,14 +124,15 @@ public class EnchantmentCache {
|
||||
|
||||
color = type.getColor();
|
||||
|
||||
if (rarity != null && rarity.hasCustomColor() && type != EnchantmentType.CURSE) {
|
||||
color = rarity.getCustomColor();
|
||||
}
|
||||
|
||||
if (rarity == null) {
|
||||
rarity = EnchantmentRarity.getByName(PLUGIN.getConfigYml().getString("rarity.vanilla-rarity"));
|
||||
}
|
||||
|
||||
if (rarity.hasCustomColor() && type != EnchantmentType.CURSE) {
|
||||
color = rarity.getCustomColor();
|
||||
}
|
||||
|
||||
String rawName = name;
|
||||
if (color.contains("{}")) {
|
||||
name = color.replace("{}", name);
|
||||
|
@ -105,7 +105,7 @@ public class EnchantmentRarity {
|
||||
double lootProbability = rarityYml.getDouble("rarities." + rarity + ".loot-probability");
|
||||
String customColor = null;
|
||||
if (rarityYml.getBool("rarities." + rarity + ".custom-color.enabled")) {
|
||||
customColor = rarityYml.getString("rarities." + rarity + ".custom-color.color");
|
||||
customColor = rarityYml.getString("rarities." + rarity + ".custom-color.color", false);
|
||||
}
|
||||
|
||||
new EnchantmentRarity(rarity, probability, minimumLevel, villagerProbability, lootProbability, customColor).register();
|
||||
|
Loading…
Reference in New Issue
Block a user