Added %value% placeholders for all curses and Abattoir, Abrasion, Aquatic, Arachnid, Atmospheric, Aerial, and Backstab

This commit is contained in:
Auxilor 2021-08-05 15:57:21 +01:00
parent 0eeb1ab37c
commit 4f39736dc1
20 changed files with 72 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
#
name: "Curse of Fragility"
description: Decreases item durability.
description: Decreases item durability by &a%value%&r times.
enabled: true
obtaining:

View File

@ -3,7 +3,7 @@
#
name: "Curse of Hunger"
description: Increases hunger loss.
description: Increases hunger loss by &a%value%&rx.
enabled: true
obtaining:

View File

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

View File

@ -3,7 +3,7 @@
#
name: "Abrasion"
description: Damages your opponents armor.
description: Damages your opponents armor by &a%value%&r.
enabled: true
obtaining:

View File

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

View File

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

View File

@ -3,7 +3,7 @@
#
name: "Arachnid"
description: Increases damage against spiders.
description: Increases damage against spiders by &a%value%%&r.
enabled: true
obtaining:

View File

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

View File

@ -3,7 +3,7 @@
#
name: "Backstab"
description: Increases damage when behind opponent.
description: Deal &a%value%%&r more damage from behind.
enabled: true
obtaining: