From eedc4c77a77c8c690109920be6cfa9fe690767d4 Mon Sep 17 00:00:00 2001 From: asofold Date: Sat, 3 Nov 2012 04:46:37 +0100 Subject: [PATCH] Bleeding: Let Passable prefer the data's set-back location. This might not fully fix all fly bypasses, but it prevents the Passable check from resetting players into the air for moves that may cover any distance from air into ground, leading to resetting the player into the air, which allows for a fly bypass, effectively. Preferring the data's set-back location will set the player back onto ground if it is passable, this still leaves some area for cheat attempts, but the order of speed and passable checks shows the dilemma that either can undo the others effects with the set-back locations used by the checks. [Subject to review.] --- src/fr/neatmonster/nocheatplus/checks/moving/Passable.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/Passable.java b/src/fr/neatmonster/nocheatplus/checks/moving/Passable.java index 6532f288..fabdae05 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/Passable.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/Passable.java @@ -54,6 +54,10 @@ public class Passable extends Check { } } } + + // Prefer the set-back location from the data. + if (data.setBack != null && BlockProperties.isPassable(from.getBlockAccess(), data.setBack)) loc = data.setBack; + // Return the reset position. data.passableVL += 1d; final ViolationData vd = new ViolationData(this, player, data.passableVL, 1, cc.passableActions); @@ -61,7 +65,7 @@ public class Passable extends Check { if (executeActions(vd)){ // TODO: Consider another set back position for this, also keeping track of players moving around in blocks. final Location newTo; - if (!from.isPassable() && loc == null){ + if (loc == null && !from.isPassable()){ // Check if passable. loc = player.getLocation(); if (to.isSamePos(loc) || !BlockProperties.isPassable(from.getBlockAccess(), loc.getX(), loc.getY(), loc.getZ(), from.getTypeId(from.getBlockX(), from.getBlockY(), from.getBlockZ()))){