diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/Passable.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/Passable.java index f340c271..2fcf12bf 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/Passable.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/Passable.java @@ -22,16 +22,18 @@ public class Passable extends Check { public Location check(final Player player, Location loc, final PlayerLocation from, final PlayerLocation to, final MovingData data, final MovingConfig cc) { - // Simple check (only from, to, player.getLocation). // TODO: if (!from.isSameCoords(loc)){...check passable for loc -> from !?... + sf etc too?} // TODO: Future: Account for the players bounding box? [test very-strict setting for at least the end points...] String tags = ""; // Block distances (sum, max) for from-to (not for loc!). final int manhattan = from.manhattan(to); + // Skip moves inside of ignored blocks right away. + if (manhattan == 0 && (BlockProperties.getBlockFlags(from.getTypeId()) & BlockProperties.F_IGN_PASSABLE) != 0){ + return null; + } boolean toPassable = to.isPassable(); // General condition check for using ray-tracing. - // TODO: consider in case of flying: sf does not cover moving up. - if (toPassable && cc.passableRayTracingCheck && (!cc.passableRayTracingVclipOnly || from.getY() > to.getY()) && (!cc.passableRayTracingBlockChangeOnly || manhattan > 0)){ + if (toPassable && cc.passableRayTracingCheck && (!cc.passableRayTracingVclipOnly || from.getY() != to.getY()) && (!cc.passableRayTracingBlockChangeOnly || manhattan > 0)){ rayTracing.set(from, to); rayTracing.loop(); if (rayTracing.collides() || rayTracing.getStepsDone() >= rayTracing.getMaxSteps()){ @@ -53,9 +55,9 @@ public class Passable extends Check { toPassable = false; tags = "raytracing_"; } + // TODO: Future: If accuracy is demanded, also check the head position (or bounding box right away). + rayTracing.cleanup(); } - // TODO: Future: If accuracy is demanded, also check the head position (or bounding box right away). - rayTracing.cleanup(); } // TODO: Checking order: If loc is not the same as from, a quick return here might not be wanted.