From cbe0b5c0d7b269a0eb15fbed2701c40e4cbd4d98 Mon Sep 17 00:00:00 2001 From: asofold Date: Fri, 15 Feb 2013 18:53:38 +0100 Subject: [PATCH] Workaround for standing on the block below a cactus (simplistic). --- .../nocheatplus/utilities/BlockProperties.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockProperties.java b/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockProperties.java index 5660679e..2bea525d 100644 --- a/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockProperties.java +++ b/NCPCompat/src/main/java/fr/neatmonster/nocheatplus/utilities/BlockProperties.java @@ -1415,9 +1415,9 @@ public class BlockProperties { // TODO: further exclude simple full shape blocks, or confine to itchy block types // TODO: make flags for it. // Simplistic hot fix attempt for same type + same shape. - double[] bounds = access.getBounds(x, y, z); + final double[] bounds = access.getBounds(x, y, z); if (bounds == null) return true; - double[] aboveBounds = access.getBounds(x, y + 1, z); + final double[] aboveBounds = access.getBounds(x, y + 1, z); if (aboveBounds == null) return true; boolean fullBounds = false; for (int i = 0; i < 3; i++){ @@ -1438,6 +1438,12 @@ public class BlockProperties { } } } + // Workarounds. + if (aboveId == Material.CACTUS.getId() && aboveId != id){ + // TODO: This is a rough estimate, assumes sand underneath, further relies on passable. + // TODO: General workaround for slightly inset blocks which have full bounds for passable. + return true; + } // Not regarded as ground. continue; }