diff --git a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/MCAccessBukkit.java b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/MCAccessBukkit.java index 19045d69..7cf73218 100644 --- a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/MCAccessBukkit.java +++ b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/MCAccessBukkit.java @@ -47,10 +47,10 @@ public class MCAccessBukkit extends MCAccessBukkitBase implements BlockPropertie if (!mat.isBlock()) { continue; } - if (fullBlocks.contains(mat)) { + else if (fullBlocks.contains(mat)) { continue; } - if (!mat.isOccluding() || !mat.isSolid() || mat.isTransparent()) { + else if (guessItchyBlock(mat)) { // Uncertain bounding-box, allow passing through. long flags = BlockProperties.F_IGN_PASSABLE; if ((BlockProperties.isSolid(mat) || BlockProperties.isGround(mat)) && !BlockProperties.isLiquid(mat)) { diff --git a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/MCAccessBukkitBase.java b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/MCAccessBukkitBase.java index 94ed7ee0..ae0096de 100644 --- a/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/MCAccessBukkitBase.java +++ b/NCPCompatBukkit/src/main/java/fr/neatmonster/nocheatplus/compat/bukkit/MCAccessBukkitBase.java @@ -40,14 +40,26 @@ public class MCAccessBukkitBase implements MCAccess { // private AlmostBoolean entityPlayerAvailable = AlmostBoolean.MAYBE; protected final boolean bukkitHasGetHeightAndGetWidth; + private boolean guessItchyBlockPre1_13(final Material mat) { + return !mat.isOccluding() || !mat.isSolid() || mat.isTransparent(); + } + + protected boolean guessItchyBlock(final Material mat) { + // TODO: Use working route. + return guessItchyBlockPre1_13(mat); + } + + private void testItchyBlock() { + // TODO: Route to what works. + guessItchyBlockPre1_13(Material.AIR); + } + /** * Constructor to let it fail. */ public MCAccessBukkitBase() { // TODO: Add more that might fail if not supported ? - Material.AIR.isSolid(); - Material.AIR.isOccluding(); - Material.AIR.isTransparent(); + testItchyBlock(); // TODO: Deactivate checks that might not work. => MCAccess should have availability method, NCP deactivates check on base of that. // TODO: Move getHeight and the like to EntityAccessXY. bukkitHasGetHeightAndGetWidth = ReflectionUtil.getMethodNoArgs(Entity.class, "getHeight", double.class) != null