From c01c91841d095825ca9e9b439be7b88e574a5344 Mon Sep 17 00:00:00 2001 From: angel Date: Sat, 17 Jan 2026 15:36:35 -0600 Subject: [PATCH] 1.1.0, level of enchantment is equal to level of the effects --- .../enchantment/effect/CripplingEnchantmentEffect.java | 6 ++---- .../enchantment/effect/PoisonEnchantmentEffect.java | 5 ++--- .../enchantment/effect/WitheringEnchantmentEffect.java | 3 +-- update.json | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/CripplingEnchantmentEffect.java b/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/CripplingEnchantmentEffect.java index 6e34b87..8abb546 100644 --- a/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/CripplingEnchantmentEffect.java +++ b/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/CripplingEnchantmentEffect.java @@ -26,19 +26,17 @@ public record CripplingEnchantmentEffect(LevelBasedValue duration) implements En if (target instanceof LivingEntity victim) { if (context.owner() != null && context.owner() instanceof Player player) { int Duration = (int) (this.duration.calculate(level) * 50); // Convert to ticks - int slownessAmplifier = level - 1; // Level 1 = Slowness 0, Level 2 = Slowness I, Level 3 = Slowness II - int weaknessAmplifier = level - 1; // Level 1 = Weakness 0, Level 2 = Weakness I, Level 3 = Weakness II victim.addEffect(new MobEffectInstance( MobEffects.SLOWNESS, Duration, - slownessAmplifier, + level, false, true )); victim.addEffect(new MobEffectInstance( MobEffects.WEAKNESS, Duration, - weaknessAmplifier, + level, false, true )); diff --git a/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/PoisonEnchantmentEffect.java b/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/PoisonEnchantmentEffect.java index 8f31f07..be0e1cb 100644 --- a/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/PoisonEnchantmentEffect.java +++ b/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/PoisonEnchantmentEffect.java @@ -24,13 +24,12 @@ public record PoisonEnchantmentEffect(LevelBasedValue duration) implements Encha public void apply(ServerLevel world, int level, EnchantedItemInUse context, Entity target, Vec3 pos) { if (target instanceof LivingEntity victim) { if (context.owner() != null && context.owner() instanceof Player player) { - int poisonDuration = (int) (this.duration.calculate(level) * 40); // Convert to ticks - int poisonAmplifier = level - 2; // Level 1 = Poison 0, Level 2 = Poison I, Level 3 = Poison II + int poisonDuration = (int) (this.duration.calculate(level) * 50); // Convert to ticks victim.addEffect(new MobEffectInstance( MobEffects.POISON, poisonDuration, - poisonAmplifier, + level, false, true )); diff --git a/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/WitheringEnchantmentEffect.java b/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/WitheringEnchantmentEffect.java index 7f12dc0..e6bef4a 100644 --- a/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/WitheringEnchantmentEffect.java +++ b/common/src/main/java/dev/sillyangel/more_spear_enchantments/enchantment/effect/WitheringEnchantmentEffect.java @@ -25,12 +25,11 @@ public record WitheringEnchantmentEffect(LevelBasedValue duration) implements En if (target instanceof LivingEntity victim) { if (context.owner() != null && context.owner() instanceof Player player) { int witherDuration = (int) (this.duration.calculate(level) * 40); // Convert to ticks - int witherAmplifier = level - 2; // Level 1 = Wither 0, Level 2 = Wither I, Level 3 = Wither II victim.addEffect(new MobEffectInstance( MobEffects.WITHER, witherDuration, - witherAmplifier, + level, false, true )); diff --git a/update.json b/update.json index 137ef72..29fc3c4 100644 --- a/update.json +++ b/update.json @@ -1,7 +1,7 @@ { "homepage": "https://modrinth.com/mod/more-spear-enchantments", "1.21.11": { - "1.1.0": "added to enchantment table (wow angel how did you forget, that is literally the whole point of the mod )\n, and switch to mojang mapping from yarn" + "1.1.0": "added to enchantment table (wow angel how did you forget, that is literally the whole point of the mod )\n, and switch to mojang mapping from yarn\n and the level of the book matches with the level of the effect, and each lvl duration is calculated by (level * 50) with 50 being ticks " }, "promos": { "1.21.11-latest": "1.1.0",