From ac1ac5d903078737f65e688b6e846a10027f2b6c Mon Sep 17 00:00:00 2001 From: Sollace Date: Wed, 18 Sep 2024 18:44:25 +0100 Subject: [PATCH] Fixed heavy enchant making pegasi faster. Fixes #380 --- .../unicopia/entity/player/PlayerPhysics.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java index 6b729dfd..01850b5b 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/PlayerPhysics.java @@ -377,16 +377,17 @@ public class PlayerPhysics extends EntityPhysics implements Tickab tickGrounded(); } - if (!entity.isOnGround()) { - float heavyness = 1 - EnchantmentHelper.getEquipmentLevel(UEnchantments.HEAVY, entity) * 0.015F; - velocity.x /= heavyness; - velocity.z /= heavyness; - } - float maximum = 1.5F; velocity.x = MathHelper.clamp(velocity.x, -maximum, maximum); velocity.y = MathHelper.clamp(velocity.y, -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()); if (isFlying() && !entity.isFallFlying() && !pony.getAcrobatics().isHanging() && pony.isClient()) {