mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 11:10:05 +01:00
Allow updating set-back, when small-range TP leads to a safe position.
This commit is contained in:
parent
343b5ac9e3
commit
0b7a259985
@ -943,7 +943,7 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
|
||||
final TeleportCause cause = event.getCause();
|
||||
if (cause == TeleportCause.UNKNOWN) {
|
||||
// Check special small range teleports (moved too quickly).
|
||||
// Check special small range teleports (server moves players out of blocks).
|
||||
if (from != null && from.getWorld().equals(to.getWorld())) {
|
||||
if (TrigUtil.distance(from, to) < margin) {
|
||||
smallRange = true;
|
||||
@ -954,6 +954,11 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
||||
smallRange = true;
|
||||
}
|
||||
}
|
||||
// Override smallRange, if the teleport seems ok.
|
||||
if (smallRange && BlockProperties.isOnGroundOrResetCond(player, to, cc.yOnGround) && BlockProperties.isPassable(to)) {
|
||||
// TODO: Consider to remove the smallRange workaround and re-evaluate [Block jump on protected region into fence].
|
||||
smallRange = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (cause == TeleportCause.ENDER_PEARL) {
|
||||
|
Loading…
Reference in New Issue
Block a user