mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-28 02:11:22 +01:00
Ensure to reset the (mc) fall distance on ground.
This commit is contained in:
parent
06eecb704d
commit
135c89ca70
@ -62,7 +62,10 @@ public class NoFall extends Check {
|
||||
data.noFallSkipAirCheck = true;
|
||||
dealFallDamage(player, maxD);
|
||||
}
|
||||
else data.clearNoFallData();
|
||||
else {
|
||||
data.clearNoFallData();
|
||||
player.setFallDistance(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -157,8 +160,12 @@ public class NoFall extends Check {
|
||||
}
|
||||
else if (fromOnGround || data.noFallAssumeGround) {
|
||||
// Check if to deal damage (fall back damage check).
|
||||
if (cc.noFallDealDamage) handleOnGround(player, minY, true, data, cc);
|
||||
else adjustFallDistance(player, minY, true, data, cc);
|
||||
if (cc.noFallDealDamage) {
|
||||
handleOnGround(player, minY, true, data, cc);
|
||||
}
|
||||
else {
|
||||
adjustFallDistance(player, minY, true, data, cc);
|
||||
}
|
||||
}
|
||||
else if (toReset) {
|
||||
// Just reset.
|
||||
@ -170,8 +177,12 @@ public class NoFall extends Check {
|
||||
// In this case the player has traveled further: add the difference.
|
||||
data.noFallFallDistance -= yDiff;
|
||||
}
|
||||
if (cc.noFallDealDamage) handleOnGround(player, minY, true, data, cc);
|
||||
else adjustFallDistance(player, minY, true, data, cc);
|
||||
if (cc.noFallDealDamage) {
|
||||
handleOnGround(player, minY, true, data, cc);
|
||||
}
|
||||
else {
|
||||
adjustFallDistance(player, minY, true, data, cc);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Ensure fall distance is correct, or "anyway"?
|
||||
@ -199,8 +210,8 @@ public class NoFall extends Check {
|
||||
if (data.noFallFallDistance > 0) {
|
||||
data.noFallFallDistance = 0;
|
||||
}
|
||||
if (mcFallDistance > 0){
|
||||
player.setFallDistance(0);
|
||||
if (mcFallDistance > 0f) {
|
||||
player.setFallDistance(0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user