mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-23 21:38:00 +01:00
Gravity is now accounted for in fall damage
This commit is contained in:
parent
ec0e0052e0
commit
7e2886b1e2
1 changed files with 7 additions and 1 deletions
|
@ -281,7 +281,13 @@ public class Pony implements Caster<PlayerEntity>, Equine<PlayerEntity>, Transmi
|
|||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue