mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-06-26 06:14:42 +02:00
[BLEEDING] First version of horizontal push.
New issue: * Horizontal push can lead to vdistrel violations with yDistance = 1, even with air blocks next to the foot position.
This commit is contained in:
parent
7646476993
commit
1c024c072c
|
@ -1032,6 +1032,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||
debug(player, "checkPastStateBounceAscend: Don't add velocity.");
|
||||
}
|
||||
}
|
||||
// TODO: There is a special case with 1.0 up on pistons pushing horizontal only (!).
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1493,6 +1493,27 @@ public class SurvivalFly extends Check {
|
|||
hDistanceAboveLimit = thisMove.hDistance - hAllowedDistance;
|
||||
tags.add("permchecks");
|
||||
}
|
||||
|
||||
// Check being moved by blocks.
|
||||
if (cc.trackBlockMove && hDistanceAboveLimit > 0.0
|
||||
&& hDistanceAboveLimit < 0.515 // MAGIC
|
||||
) {
|
||||
// Push by 0.49-0.51 in one direction.
|
||||
final double xDistance = to.getX() - from.getX();
|
||||
final double zDistance = to.getZ() - from.getZ();
|
||||
if (Math.abs(xDistance) > 0.485 && Math.abs(xDistance) < 1.025
|
||||
&& from.matchBlockChange(blockChangeTracker, data.blockChangeRef,
|
||||
xDistance < 0 ? Direction.X_NEG : Direction.X_POS, 0.05)) {
|
||||
hAllowedDistance = thisMove.hDistance; // MAGIC
|
||||
hDistanceAboveLimit = 0.0;
|
||||
}
|
||||
else if (Math.abs(zDistance) > 0.485 && Math.abs(zDistance) < 1.025
|
||||
&& from.matchBlockChange(blockChangeTracker, data.blockChangeRef,
|
||||
zDistance < 0 ? Direction.Z_NEG : Direction.Z_POS, 0.05)) {
|
||||
hAllowedDistance = thisMove.hDistance; // MAGIC
|
||||
hDistanceAboveLimit = 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
// Check velocity.
|
||||
double hFreedom = 0.0; // Horizontal velocity used.
|
||||
|
|
Loading…
Reference in New Issue
Block a user