From 7e2886b1e21868e5281828951f801cdf09cd1a6e Mon Sep 17 00:00:00 2001 From: Sollace Date: Mon, 28 Sep 2020 20:18:37 +0200 Subject: [PATCH] Gravity is now accounted for in fall damage --- .../com/minelittlepony/unicopia/entity/player/Pony.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java index a30eab5f..181c4cdb 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -281,7 +281,13 @@ public class Pony implements Caster, Equine, Transmi } public Optional onImpact(float distance, float damageMultiplier) { - if (getSpecies().canFly() && !entity.isCreative() && !entity.isSpectator()) { + + float g = gravity.getGravityModifier(); + + if (g != 1 || getSpecies().canFly() && !entity.isCreative() && !entity.isSpectator()) { + + distance *= g; + return Optional.of(Math.max(0, distance - 5)); }