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