Allow updating set-back, when small-range TP leads to a safe position.

This commit is contained in:
asofold 2015-10-18 17:06:18 +02:00
parent 343b5ac9e3
commit 0b7a259985

View File

@ -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) {