From 3255bf97d7ae54ffea14684151a14d318493b3ef Mon Sep 17 00:00:00 2001 From: asofold Date: Sun, 21 Jul 2013 00:02:12 +0200 Subject: [PATCH] More conditions for waterwalk. Prevent triggering if walking into water on a half step, by excluding any on-ground moves. --- .../neatmonster/nocheatplus/checks/moving/SurvivalFly.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java index 833028c1..3b108b3d 100644 --- a/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java +++ b/NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/SurvivalFly.java @@ -203,7 +203,10 @@ public class SurvivalFly extends Check { // Prevent players from walking on a liquid in a too simple way. // TODO: Find something more effective against more smart methods (limitjump helps already). // TODO: yDistance == 0D <- should there not be a tolerance +- or 0...x ? - if (hDistanceAboveLimit <= 0D && hDistance > 0.1D && yDistance == 0D && BlockProperties.isLiquid(to.getTypeId()) && !toOnGround && to.getY() % 1D < 0.8D) { + // TODO: Complete re-modeling. + if (hDistanceAboveLimit <= 0D && hDistance > 0.1D && yDistance == 0D && data.sfLastYDist == 0D && !toOnGround && !fromOnGround && BlockProperties.isLiquid(to.getTypeId())) { + // TODO: Relative hdistance. + // TODO: Might check actual bounds, might implement + use BlockProperties.getCorrectedBounds. hDistanceAboveLimit = Math.max(hDistanceAboveLimit, hDistance); tags.add("waterwalk"); }