mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-10-06 10:27:26 +02:00
Fix false positives when jumping down half-blocks/stairs
This commit is contained in:
parent
3d338d5a65
commit
d9985e1721
@ -48,7 +48,7 @@ public class FlyingCheck {
|
||||
|
||||
// Walk or start Jump
|
||||
if(fromOnGround) {
|
||||
distanceAboveLimit = toY - Math.floor(fromY) - limit;
|
||||
distanceAboveLimit = toY - fromY - limit;
|
||||
}
|
||||
// Land or Fly/Fall
|
||||
else {
|
||||
@ -66,7 +66,7 @@ public class FlyingCheck {
|
||||
if(toOnGround)
|
||||
limit += stepHeight;
|
||||
|
||||
distanceAboveLimit = toY - Math.floor(l.getY()) - limit;
|
||||
distanceAboveLimit = toY - l.getY() - limit;
|
||||
|
||||
// Always give some bonus points in case of identical Y values in
|
||||
// midair (hovering player)
|
||||
|
@ -88,6 +88,7 @@ public class MovingCheck extends Check {
|
||||
|
||||
Location newToLocation = null;
|
||||
|
||||
System.out.println(from.getY() + " " + to.getY() + (from.getY() > to.getY() ? " down" : "horiz/up"));
|
||||
final long startTime = System.nanoTime();
|
||||
|
||||
/************* DECIDE WHICH CHECKS NEED TO BE RUN *************/
|
||||
@ -128,9 +129,10 @@ public class MovingCheck extends Check {
|
||||
|
||||
data.jumpPhase++;
|
||||
|
||||
if(fromOnGround) {
|
||||
if(fromOnGround && from.getY() >= to.getY()) {
|
||||
data.setBackPoint = from;
|
||||
data.jumpPhase = 0;
|
||||
System.out.println("New setback point");
|
||||
} else if(result <= 0 && toOnGround) {
|
||||
data.jumpPhase = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user