From 1f6eba483c004419c8d16ed9ca73cd0125dc19f0 Mon Sep 17 00:00:00 2001 From: Provismet <17149901+Provismet@users.noreply.github.com> Date: Sat, 10 Feb 2024 19:37:24 +0000 Subject: [PATCH] Rebalance movement staff spells. --- .../enchantments/staff/BoostEnchantment.java | 6 +++++- .../enchantments/staff/JumpEnchantment.java | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/provismet/AdditionalArmoury/enchantments/staff/BoostEnchantment.java b/src/main/java/com/provismet/AdditionalArmoury/enchantments/staff/BoostEnchantment.java index 40d1e77..56d46b2 100644 --- a/src/main/java/com/provismet/AdditionalArmoury/enchantments/staff/BoostEnchantment.java +++ b/src/main/java/com/provismet/AdditionalArmoury/enchantments/staff/BoostEnchantment.java @@ -1,8 +1,10 @@ package com.provismet.AdditionalArmoury.enchantments.staff; import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.MovementType; import net.minecraft.item.ItemStack; import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; public class BoostEnchantment extends StaffEnchantment { public BoostEnchantment () { @@ -13,8 +15,10 @@ public BoostEnchantment () { public boolean castSpell (ItemStack stack, LivingEntity user) { double dx = -MathHelper.sin(user.getHeadYaw() / MathHelper.DEGREES_PER_RADIAN); double dz = MathHelper.cos(user.getHeadYaw() / MathHelper.DEGREES_PER_RADIAN); + Vec3d velocity = new Vec3d(dx, 0.0, dz).multiply(1.25).add(0.0, 0.2, 0.0); - user.addVelocity(dx, 0.35, dz); + if (user.isOnGround()) user.move(MovementType.SELF, new Vec3d(0.0, 0.2, 0.0)); + user.addVelocity(velocity); return true; } } diff --git a/src/main/java/com/provismet/AdditionalArmoury/enchantments/staff/JumpEnchantment.java b/src/main/java/com/provismet/AdditionalArmoury/enchantments/staff/JumpEnchantment.java index 619e06a..a812e60 100644 --- a/src/main/java/com/provismet/AdditionalArmoury/enchantments/staff/JumpEnchantment.java +++ b/src/main/java/com/provismet/AdditionalArmoury/enchantments/staff/JumpEnchantment.java @@ -8,15 +8,16 @@ public class JumpEnchantment extends StaffEnchantment { public JumpEnchantment () { - super(Rarity.COMMON, 0xA2C663, 64, 10); + super(Rarity.COMMON, 0xA2C663, 32, 10); } @Override public boolean castSpell (ItemStack stack, LivingEntity user) { user.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOW_FALLING, 40)); + user.fallDistance = 0f; Vec3d velocity = user.getVelocity(); - user.setVelocity(velocity.x, 1, velocity.z); + user.setVelocity(velocity.x, 0.75, velocity.z); return true; } }