mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Fixed heavy enchant making pegasi faster. Fixes #380
This commit is contained in:
parent
5368255e05
commit
c011394644
1 changed files with 7 additions and 6 deletions
|
@ -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()) {
|
||||||
|
|
Loading…
Reference in a new issue