Only regenerate when the pegasus has reached the ground. Fixes #356

This commit is contained in:
Sollace 2024-05-19 00:16:18 +01:00
parent c09b02d8c8
commit 2cdce6504c
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -99,13 +99,13 @@ class ManaContainer implements MagicReserves, Tickable, NbtSerialisable, Copyabl
energy.addPercent(-1); energy.addPercent(-1);
} }
if (pony.getCompositeRace().canFly() && !pony.getPhysics().isFlying()) { if (pony.getCompositeRace().canFly() && !pony.getPhysics().isFlying() && pony.asEntity().isOnGround()) {
exhaustion.multiply(0.8F); exhaustion.multiply(0.99F);
} else { } else {
exhaustion.addPercent(-1); exhaustion.addPercent(-1);
} }
if (!pony.getCompositeRace().canFly() || !pony.getPhysics().isFlying()) { if (!pony.getCompositeRace().canFly() || (!pony.getPhysics().isFlying() && pony.asEntity().isOnGround())) {
if (mana.getPercentFill() < 1 && mana.getShadowFill(1) <= mana.getPercentFill(1)) { if (mana.getPercentFill() < 1 && mana.getShadowFill(1) <= mana.getPercentFill(1)) {
mana.addPercent(MathHelper.clamp(1 + pony.getLevel().get(), 1, 50) / 4F); mana.addPercent(MathHelper.clamp(1 + pony.getLevel().get(), 1, 50) / 4F);
} }