mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
Earth Ponies can now sneak to reduce their fall damage
This commit is contained in:
parent
c0df819a4c
commit
ae1f49bd13
1 changed files with 6 additions and 2 deletions
|
@ -332,7 +332,7 @@ public class Pony extends Living<PlayerEntity> implements Transmittable, Copieab
|
||||||
|
|
||||||
boolean extraProtection = getSpellSlot().get(SpellType.SHIELD, false).isPresent();
|
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) {
|
if (extraProtection) {
|
||||||
distance /= (getLevel().get() + 1);
|
distance /= (getLevel().get() + 1);
|
||||||
|
@ -341,7 +341,11 @@ public class Pony extends Living<PlayerEntity> 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);
|
handleFall(distance, damageMultiplier, cause);
|
||||||
return Optional.of(distance);
|
return Optional.of(distance);
|
||||||
|
|
Loading…
Reference in a new issue