diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantmentFormatting.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantmentFormatting.kt index 99d17e51..2ee0a69c 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantmentFormatting.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/display/EnchantmentFormatting.kt @@ -61,6 +61,12 @@ fun EcoEnchantLike.getFormattedName(level: Int): String { } } +private val resetTags = arrayOf( + "", + "&r", + "§r" +) + fun EcoEnchantLike.getFormattedDescription(level: Int): List { val plugin = EcoEnchantsPlugin.instance @@ -68,7 +74,10 @@ fun EcoEnchantLike.getFormattedDescription(level: Int): List { val descriptionFormat = plugin.configYml.getString("display.descriptions.format") val wrap = plugin.configYml.getInt("display.descriptions.word-wrap") - val description = this.getUnformattedDescription(level) + var description = this.getUnformattedDescription(level) + for (tag in resetTags) { + description = description.replace(tag, tag + descriptionFormat) + } WordUtils.wrap(description, wrap, "\n", false) .lines() diff --git a/eco-core/core-plugin/src/main/resources/enchants/zeus.yml b/eco-core/core-plugin/src/main/resources/enchants/thor.yml similarity index 54% rename from eco-core/core-plugin/src/main/resources/enchants/zeus.yml rename to eco-core/core-plugin/src/main/resources/enchants/thor.yml index 822701e7..64223fc2 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/zeus.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/thor.yml @@ -1,25 +1,27 @@ -display-name: "Zeus" -description: "&a%placeholder%%&8 chance to strike lightning on your opponent" -placeholder: "%level% * 1" -type: normal - -targets: - - bow - - crossbow -conflicts: [] -rarity: epic -max-level: 6 - -tradeable: true -discoverable: true -enchantable: true - -effects: - - id: strike_lightning - args: - amount: 1 - chance: "1 * %level%" - triggers: - - bow_attack - -conditions: [ ] +display-name: "Thor" +description: "Gives a &a%chance%%&8 chance to strike &a%bolts%&8 lightning bolts on your opponent" +placeholders: + chance: "%level% * 1" + bolts: "ceil(%level% / 2)" +type: normal + +targets: + - bow + - crossbow +conflicts: [] +rarity: epic +max-level: 6 + +tradeable: true +discoverable: true +enchantable: true + +effects: + - id: strike_lightning + args: + amount: "ceil(%level% / 2)" + chance: "1 * %level%" + triggers: + - bow_attack + +conditions: [ ]