mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-03 19:00:30 +02:00
Another edge case of lost-ground (ascending + step-up when sprinting).
This commit is contained in:
parent
48b7bca266
commit
0932edd6ee
|
@ -644,11 +644,11 @@ public class SurvivalFly extends Check {
|
||||||
*/
|
*/
|
||||||
private boolean lostGround(final Player player, final PlayerLocation from, final PlayerLocation to, final double hDistance, final double yDistance, final boolean sprinting, final MovingData data, final MovingConfig cc) {
|
private boolean lostGround(final Player player, final PlayerLocation from, final PlayerLocation to, final double hDistance, final double yDistance, final boolean sprinting, final MovingData data, final MovingConfig cc) {
|
||||||
// TODO: Confine by max y distance and max/min xz-distance?
|
// TODO: Confine by max y distance and max/min xz-distance?
|
||||||
if (yDistance >= -0.5 && yDistance <= 0.52 + data.jumpAmplifier * 0.2) {
|
if (yDistance >= -0.5 && yDistance <= 0.594 + data.jumpAmplifier * 0.2) {
|
||||||
// "Mild" Ascending / descending.
|
// "Mild" Ascending / descending.
|
||||||
// Stairs.
|
// Stairs.
|
||||||
// TODO: More safety guards.
|
// TODO: More safety guards.
|
||||||
if (from.isAboveStairs()) {
|
if (yDistance <= 0.52 + data.jumpAmplifier * 0.2 && from.isAboveStairs()) {
|
||||||
applyLostGround(player, from, true, data, "stairs");
|
applyLostGround(player, from, true, data, "stairs");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1151,8 +1151,8 @@ public class SurvivalFly extends Check {
|
||||||
final double setBackYDistance = to.getY() - data.getSetBackY();
|
final double setBackYDistance = to.getY() - data.getSetBackY();
|
||||||
|
|
||||||
// Half block step up.
|
// Half block step up.
|
||||||
if (yDistance <= 0.5 && hDistance < 0.5 && setBackYDistance <= 1.3 + 0.2 * data.jumpAmplifier && to.isOnGround()) {
|
if (yDistance <= (sprinting ? 0.594 : 0.5) && hDistance < 0.5 && setBackYDistance <= 1.3 + 0.2 * data.jumpAmplifier && to.isOnGround()) {
|
||||||
if (data.sfLastYDist < 0.0 || from.isOnGround(0.5 - Math.abs(yDistance))) {
|
if (data.sfLastYDist < 0.0 || yDistance <= 0.5 && from.isOnGround(0.5 - Math.abs(yDistance))) {
|
||||||
return applyLostGround(player, from, true, data, "step");
|
return applyLostGround(player, from, true, data, "step");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user