Gravity is now accounted for in fall damage

This commit is contained in:
Sollace 2020-09-28 20:18:37 +02:00
parent ec0e0052e0
commit 7e2886b1e2

View file

@ -281,7 +281,13 @@ public class Pony implements Caster<PlayerEntity>, Equine<PlayerEntity>, Transmi
} }
public Optional<Float> onImpact(float distance, float damageMultiplier) { public Optional<Float> 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)); return Optional.of(Math.max(0, distance - 5));
} }