mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-30 16:28:00 +01:00
Fixed ground pound not triggering properly if the player's fall event doesn't trigger. Closes #29
This commit is contained in:
parent
0cd45ad1ae
commit
782bb86f0c
1 changed files with 12 additions and 7 deletions
|
@ -44,8 +44,12 @@ public abstract class Living<T extends LivingEntity> implements Equine<T>, Caste
|
|||
}
|
||||
|
||||
public void waitForFall(Runnable action) {
|
||||
if (entity.isOnGround()) {
|
||||
action.run();
|
||||
} else {
|
||||
landEvent = action;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean sneakingChanged() {
|
||||
return entity.isSneaking() != prevSneaking;
|
||||
|
@ -93,10 +97,15 @@ public abstract class Living<T extends LivingEntity> implements Equine<T>, Caste
|
|||
invinsibilityTicks--;
|
||||
}
|
||||
|
||||
prevSneaking = entity.isSneaking();
|
||||
prevLanded = entity.isOnGround();
|
||||
if (landEvent != null && entity.isOnGround() && landedChanged()) {
|
||||
landEvent.run();
|
||||
landEvent = null;
|
||||
}
|
||||
|
||||
enchants.tick();
|
||||
|
||||
prevSneaking = entity.isSneaking();
|
||||
prevLanded = entity.isOnGround();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -148,10 +157,6 @@ public abstract class Living<T extends LivingEntity> implements Equine<T>, Caste
|
|||
}
|
||||
|
||||
protected void handleFall(float distance, float damageMultiplier) {
|
||||
if (landEvent != null) {
|
||||
landEvent.run();
|
||||
landEvent = null;
|
||||
}
|
||||
getSpellOrEmpty(DisguiseSpell.class, false).ifPresent(spell -> {
|
||||
spell.getDisguise().onImpact(this, distance, damageMultiplier);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue