From 4f39736dc1c7408695f8e47f9dc8f6214e978a9a Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 5 Aug 2021 15:57:21 +0100 Subject: [PATCH] Added %value% placeholders for all curses and Abattoir, Abrasion, Aquatic, Arachnid, Atmospheric, Aerial, and Backstab --- .../enchantments/ecoenchants/curse/CallingCurse.java | 6 ++++++ .../enchantments/ecoenchants/curse/FragilityCurse.java | 8 ++++++++ .../enchantments/ecoenchants/curse/HungerCurse.java | 6 ++++++ .../enchantments/ecoenchants/normal/Abattoir.java | 6 ++++++ .../enchantments/ecoenchants/normal/Abrasion.java | 6 ++++++ .../enchantments/ecoenchants/normal/Aerial.java | 6 ++++++ .../enchantments/ecoenchants/normal/Aquatic.java | 6 ++++++ .../enchantments/ecoenchants/normal/Arachnid.java | 6 ++++++ .../enchantments/ecoenchants/normal/Atmospheric.java | 6 ++++++ .../enchantments/ecoenchants/normal/Backstab.java | 6 ++++++ .../src/main/resources/enchants/curse/callingcurse.yml | 2 +- .../src/main/resources/enchants/curse/fragilitycurse.yml | 2 +- .../src/main/resources/enchants/curse/hungercurse.yml | 2 +- .../src/main/resources/enchants/normal/abattoir.yml | 2 +- .../src/main/resources/enchants/normal/abrasion.yml | 2 +- .../src/main/resources/enchants/normal/aerial.yml | 2 +- .../src/main/resources/enchants/normal/aquatic.yml | 2 +- .../src/main/resources/enchants/normal/arachnid.yml | 2 +- .../src/main/resources/enchants/normal/atmospheric.yml | 2 +- .../src/main/resources/enchants/normal/backstab.yml | 2 +- 20 files changed, 72 insertions(+), 10 deletions(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/CallingCurse.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/CallingCurse.java index b8c4b2dc..85381d7e 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/CallingCurse.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/CallingCurse.java @@ -1,6 +1,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.curse; import com.willfp.eco.core.events.ArmorEquipEvent; +import com.willfp.eco.util.NumberUtils; import com.willfp.eco.util.VectorUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; @@ -30,6 +31,11 @@ public class CallingCurse extends EcoEnchant implements TimedRunnable { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(distance); + } + @EventHandler public void onArmorEquip(@NotNull final ArmorEquipEvent event) { refresh(); diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/FragilityCurse.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/FragilityCurse.java index b3d71b37..3e7d82b1 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/FragilityCurse.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/FragilityCurse.java @@ -17,6 +17,14 @@ public class FragilityCurse extends EcoEnchant { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(( + this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "minimum-extra-durability") + + this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "maximum-extra-durability") + ) / 2D); + } + @EventHandler public void onItemDamage(@NotNull final PlayerItemDamageEvent event) { ItemStack item = event.getItem(); diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/HungerCurse.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/HungerCurse.java index 7a005b18..c4153515 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/HungerCurse.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/curse/HungerCurse.java @@ -1,5 +1,6 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.curse; +import com.willfp.eco.util.NumberUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -16,6 +17,11 @@ public class HungerCurse extends EcoEnchant { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "times-more-hunger")); + } + @EventHandler public void onHunger(@NotNull final FoodLevelChangeEvent event) { if (!(event.getEntity() instanceof Player player)) { diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abattoir.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abattoir.java index 1b42ab32..64841ac2 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abattoir.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abattoir.java @@ -1,5 +1,6 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal; +import com.willfp.eco.util.NumberUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -17,6 +18,11 @@ public class Abattoir extends EcoEnchant { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier") * 100 * (level + 1)); + } + @Override public void onTridentDamage(@NotNull final LivingEntity attacker, @NotNull final LivingEntity victim, diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abrasion.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abrasion.java index 811506c2..01532cf1 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abrasion.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Abrasion.java @@ -1,6 +1,7 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal; import com.willfp.eco.util.DurabilityUtils; +import com.willfp.eco.util.NumberUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils; @@ -20,6 +21,11 @@ public class Abrasion extends EcoEnchant { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(level); + } + @Override public void onMeleeAttack(@NotNull final LivingEntity attacker, @NotNull final LivingEntity uncastVictim, diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aerial.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aerial.java index 503a7855..ee16b5bc 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aerial.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aerial.java @@ -1,5 +1,6 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal; +import com.willfp.eco.util.NumberUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -16,6 +17,11 @@ public class Aerial extends EcoEnchant { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier") * level * 100); + } + @Override public void onBowShoot(@NotNull final LivingEntity shooter, @NotNull final Arrow arrow, diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aquatic.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aquatic.java index 07691ea0..11cd0f7e 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aquatic.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Aquatic.java @@ -1,5 +1,6 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal; +import com.willfp.eco.util.NumberUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -16,6 +17,11 @@ public class Aquatic extends EcoEnchant { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier") * level * 100); + } + @Override public void onTridentDamage(@NotNull final LivingEntity attacker, @NotNull final LivingEntity victim, diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Arachnid.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Arachnid.java index a427d5f1..213e0d62 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Arachnid.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Arachnid.java @@ -1,5 +1,6 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal; +import com.willfp.eco.util.NumberUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -16,6 +17,11 @@ public class Arachnid extends EcoEnchant { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier") * 100 * (level + 1)); + } + @Override public void onTridentDamage(@NotNull final LivingEntity attacker, @NotNull final LivingEntity victim, diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Atmospheric.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Atmospheric.java index 3fc94e47..6a21f2b8 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Atmospheric.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Atmospheric.java @@ -1,5 +1,6 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal; +import com.willfp.eco.util.NumberUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -16,6 +17,11 @@ public class Atmospheric extends EcoEnchant { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier") * level * 100); + } + @Override public void onTridentLaunch(@NotNull final LivingEntity shooter, @NotNull final Trident trident, diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Backstab.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Backstab.java index 638557a0..372e958a 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Backstab.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Backstab.java @@ -1,5 +1,6 @@ package com.willfp.ecoenchants.enchantments.ecoenchants.normal; +import com.willfp.eco.util.NumberUtils; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -15,6 +16,11 @@ public class Backstab extends EcoEnchant { ); } + @Override + public String getPlaceholder(final int level) { + return NumberUtils.format(this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier") * level * 100); + } + @Override public void onMeleeAttack(@NotNull final LivingEntity attacker, @NotNull final LivingEntity victim, diff --git a/eco-core/core-plugin/src/main/resources/enchants/curse/callingcurse.yml b/eco-core/core-plugin/src/main/resources/enchants/curse/callingcurse.yml index 8b3a5d39..3a8fe0d9 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/curse/callingcurse.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/curse/callingcurse.yml @@ -3,7 +3,7 @@ # name: "Curse of Calling" -description: Angers all nearby mobs. +description: Angers all mobs within &a%value%&r blocks. enabled: true obtaining: diff --git a/eco-core/core-plugin/src/main/resources/enchants/curse/fragilitycurse.yml b/eco-core/core-plugin/src/main/resources/enchants/curse/fragilitycurse.yml index 51d1ad6a..d5fff7ab 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/curse/fragilitycurse.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/curse/fragilitycurse.yml @@ -3,7 +3,7 @@ # name: "Curse of Fragility" -description: Decreases item durability. +description: Decreases item durability by &a%value%&r times. enabled: true obtaining: diff --git a/eco-core/core-plugin/src/main/resources/enchants/curse/hungercurse.yml b/eco-core/core-plugin/src/main/resources/enchants/curse/hungercurse.yml index 381d3b81..650f5f1d 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/curse/hungercurse.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/curse/hungercurse.yml @@ -3,7 +3,7 @@ # name: "Curse of Hunger" -description: Increases hunger loss. +description: Increases hunger loss by &a%value%&rx. enabled: true obtaining: diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/abattoir.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/abattoir.yml index e7713ea8..5528ba0c 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/abattoir.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/abattoir.yml @@ -3,7 +3,7 @@ # name: "Abattoir" -description: Increases damage against passive mobs. +description: Increases damage against passive mobs by &a%value%&r. enabled: true obtaining: diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/abrasion.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/abrasion.yml index 51b51f57..86d278da 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/abrasion.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/abrasion.yml @@ -3,7 +3,7 @@ # name: "Abrasion" -description: Damages your opponents armor. +description: Damages your opponents armor by &a%value%&r. enabled: true obtaining: diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/aerial.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/aerial.yml index 607bfdd3..82be5c37 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/aerial.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/aerial.yml @@ -3,7 +3,7 @@ # name: "Aerial" -description: Increases arrow damage when shot while in air. +description: Increases arrow damage by &a%value%%&r when shot while in air. enabled: true obtaining: diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/aquatic.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/aquatic.yml index 0c3921f5..758bfcc6 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/aquatic.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/aquatic.yml @@ -3,7 +3,7 @@ # name: "Aquatic" -description: Trident deals additional damage when shot from water. +description: Trident deals &a%value%%&r more damage when shot from water. enabled: true obtaining: diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/arachnid.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/arachnid.yml index 5b0a2713..5847cd02 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/arachnid.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/arachnid.yml @@ -3,7 +3,7 @@ # name: "Arachnid" -description: Increases damage against spiders. +description: Increases damage against spiders by &a%value%%&r. enabled: true obtaining: diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/atmospheric.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/atmospheric.yml index dfc3a1e4..1a9689e9 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/atmospheric.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/atmospheric.yml @@ -3,7 +3,7 @@ # name: "Atmospheric" -description: Increases trident damage when you are in air. +description: Increases trident damage by &a%value%%&r when you are in air. enabled: true obtaining: diff --git a/eco-core/core-plugin/src/main/resources/enchants/normal/backstab.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/backstab.yml index e0f37b1d..aad7217e 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/normal/backstab.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/backstab.yml @@ -3,7 +3,7 @@ # name: "Backstab" -description: Increases damage when behind opponent. +description: Deal &a%value%%&r more damage from behind. enabled: true obtaining: