mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-04 02:31:21 +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();
|
color = type.getColor();
|
||||||
|
|
||||||
if (rarity != null && rarity.hasCustomColor() && type != EnchantmentType.CURSE) {
|
|
||||||
color = rarity.getCustomColor();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rarity == null) {
|
if (rarity == null) {
|
||||||
rarity = EnchantmentRarity.getByName(PLUGIN.getConfigYml().getString("rarity.vanilla-rarity"));
|
rarity = EnchantmentRarity.getByName(PLUGIN.getConfigYml().getString("rarity.vanilla-rarity"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rarity.hasCustomColor() && type != EnchantmentType.CURSE) {
|
||||||
|
color = rarity.getCustomColor();
|
||||||
|
}
|
||||||
|
|
||||||
String rawName = name;
|
String rawName = name;
|
||||||
if (color.contains("{}")) {
|
if (color.contains("{}")) {
|
||||||
name = color.replace("{}", name);
|
name = color.replace("{}", name);
|
||||||
|
@ -105,7 +105,7 @@ public class EnchantmentRarity {
|
|||||||
double lootProbability = rarityYml.getDouble("rarities." + rarity + ".loot-probability");
|
double lootProbability = rarityYml.getDouble("rarities." + rarity + ".loot-probability");
|
||||||
String customColor = null;
|
String customColor = null;
|
||||||
if (rarityYml.getBool("rarities." + rarity + ".custom-color.enabled")) {
|
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();
|
new EnchantmentRarity(rarity, probability, minimumLevel, villagerProbability, lootProbability, customColor).register();
|
||||||
|
Loading…
Reference in New Issue
Block a user