From ae1f49bd137fd2461e572772e721268273a367f8 Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 2 Sep 2021 19:17:46 +0200 Subject: [PATCH] Earth Ponies can now sneak to reduce their fall damage --- .../com/minelittlepony/unicopia/entity/player/Pony.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 4bb6bb0c..603a4683 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/player/Pony.java @@ -332,7 +332,7 @@ public class Pony extends Living implements Transmittable, Copieab boolean extraProtection = getSpellSlot().get(SpellType.SHIELD, false).isPresent(); - if (g != 1 || extraProtection || getSpecies().canFly() && !entity.isCreative() && !entity.isSpectator()) { + if ((g != 1 || extraProtection) && !entity.isCreative() && !entity.isSpectator()) { if (extraProtection) { distance /= (getLevel().get() + 1); @@ -341,7 +341,11 @@ public class Pony extends Living implements Transmittable, Copieab } } - distance = Math.max(0, (distance * g) - 5); + distance *= g; + if (getSpecies().canFly() || (getSpecies().canUseEarth() && entity.isSneaking())) { + distance -= 5; + } + distance = Math.max(0, distance); handleFall(distance, damageMultiplier, cause); return Optional.of(distance);