mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-12-17 23:48:00 +01:00
Shields will now reduce the amound of fall damage you take
This commit is contained in:
parent
301acdf1d2
commit
d057e09877
1 changed files with 11 additions and 1 deletions
|
@ -13,6 +13,7 @@ import com.minelittlepony.unicopia.ability.AbilityDispatcher;
|
|||
import com.minelittlepony.unicopia.ability.magic.Attached;
|
||||
import com.minelittlepony.unicopia.ability.magic.Caster;
|
||||
import com.minelittlepony.unicopia.ability.magic.Spell;
|
||||
import com.minelittlepony.unicopia.ability.magic.spell.ShieldSpell;
|
||||
import com.minelittlepony.unicopia.ability.magic.spell.SpellRegistry;
|
||||
import com.minelittlepony.unicopia.entity.Physics;
|
||||
import com.minelittlepony.unicopia.entity.PonyContainer;
|
||||
|
@ -326,7 +327,16 @@ public class Pony implements Caster<PlayerEntity>, Equine<PlayerEntity>, Transmi
|
|||
|
||||
float g = gravity.getGravityModifier();
|
||||
|
||||
if (g != 1 || getSpecies().canFly() && !entity.isCreative() && !entity.isSpectator()) {
|
||||
boolean extraProtection = getSpell(ShieldSpell.class, false) != null;
|
||||
|
||||
if (g != 1 || extraProtection || getSpecies().canFly() && !entity.isCreative() && !entity.isSpectator()) {
|
||||
|
||||
if (extraProtection) {
|
||||
distance /= (getLevel().get() + 1);
|
||||
if (entity.isSneaking()) {
|
||||
distance /= 2;
|
||||
}
|
||||
}
|
||||
|
||||
distance *= g;
|
||||
|
||||
|
|
Loading…
Reference in a new issue