mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
Chi no longer takes fall damage if sprinting
This commit is contained in:
parent
4ef2e12287
commit
b90552537f
|
@ -1032,11 +1032,16 @@ public class PKListener implements Listener {
|
|||
&& Methods.isBender(player.getName(), Element.Chi)
|
||||
&& event.getCause() == DamageCause.FALL
|
||||
&& Methods.canBendPassive(player.getName(), Element.Chi)) {
|
||||
if (player.isSprinting()) {
|
||||
event.setDamage(0);
|
||||
event.setCancelled(true);
|
||||
} else {
|
||||
double initdamage = event.getDamage();
|
||||
double newdamage = event.getDamage() * ChiPassive.FallReductionFactor;
|
||||
double finaldamage = initdamage - newdamage;
|
||||
event.setDamage(finaldamage);
|
||||
}
|
||||
}
|
||||
|
||||
if (!event.isCancelled() && event.getCause() == DamageCause.FALL) {
|
||||
Player source = Flight.getLaunchedBy(player);
|
||||
|
|
Loading…
Reference in a new issue