Fixed heavy enchant making pegasi faster. Fixes #380

This commit is contained in:
Sollace 2024-09-18 18:44:25 +01:00
parent 5368255e05
commit c011394644
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -378,16 +378,17 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
tickGrounded(); tickGrounded();
} }
if (!entity.isOnGround()) {
float heavyness = 1 - EnchantmentHelper.getEquipmentLevel(UEnchantments.HEAVY, entity) * 0.015F;
velocity.x /= heavyness;
velocity.z /= heavyness;
}
float maximum = 1.5F; float maximum = 1.5F;
velocity.x = MathHelper.clamp(velocity.x, -maximum, maximum); velocity.x = MathHelper.clamp(velocity.x, -maximum, maximum);
velocity.y = MathHelper.clamp(velocity.y, -maximum, maximum); velocity.y = MathHelper.clamp(velocity.y, -maximum, maximum);
velocity.z = MathHelper.clamp(velocity.z, -maximum, maximum); velocity.z = MathHelper.clamp(velocity.z, -maximum, maximum);
if (!entity.isOnGround()) {
float heavyness = 1 + EnchantmentHelper.getEquipmentLevel(UEnchantments.HEAVY, entity) * 0.009F;
velocity.x /= heavyness;
velocity.z /= heavyness;
}
entity.setVelocity(velocity.toImmutable()); entity.setVelocity(velocity.toImmutable());
if (isFlying() && !entity.isFallFlying() && !pony.getAcrobatics().isHanging() && pony.isClient()) { if (isFlying() && !entity.isFallFlying() && !pony.getAcrobatics().isHanging() && pony.isClient()) {