From 0b7a25998542ab639d205910f5971e9d6734aa77 Mon Sep 17 00:00:00 2001 From: asofold Date: Sun, 18 Oct 2015 17:06:18 +0200 Subject: [PATCH] Allow updating set-back, when small-range TP leads to a safe position. --- .../nocheatplus/checks/moving/MovingListener.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index e56e982b..f0c8abc5 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -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) {