Fixed heavy enchant making pegasi faster. Fixes #380

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

View file

@ -377,16 +377,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()) {