False positive fixes: Nofall false with shulkers, flight false positive with snow, speed false positive with snow, waterwalk false positive with boats and KillAura false positive with thorns

This commit is contained in:
Rammelkast committed 2020-07-30 13:26:46 +02:00
1 parent 4deb8ae0fb
commit e9a99f0463
7 files changed
+76 -43

No files matched your search

@@ -176,6 +176,31 @@ public final class Utilities {
|| isIce(location.getBlock().getRelative(BlockFace.SOUTH_WEST));
}
/**
* Determine whether a block is a shulker box
*
* @param block block to check
* @return true if block is a shulker box
*/
public static boolean isShulkerBox(Block block) {
Material type = block.getType();
return type.name().endsWith("SHULKER_BOX");
}
public static boolean isNearShulkerBox(Location location) {
if (VersionUtil.isBountifulUpdate())
return false;
return isShulkerBox(location.getBlock())
|| isShulkerBox(location.getBlock().getRelative(BlockFace.NORTH))
|| isShulkerBox(location.getBlock().getRelative(BlockFace.SOUTH))
|| isShulkerBox(location.getBlock().getRelative(BlockFace.EAST))
|| isShulkerBox(location.getBlock().getRelative(BlockFace.WEST))
|| isShulkerBox(location.getBlock().getRelative(BlockFace.NORTH_EAST))
|| isShulkerBox(location.getBlock().getRelative(BlockFace.NORTH_WEST))
|| isShulkerBox(location.getBlock().getRelative(BlockFace.SOUTH_EAST))
|| isShulkerBox(location.getBlock().getRelative(BlockFace.SOUTH_WEST));
}
/**
* Determine whether a player could be standing on a halfblock
*
@@ -201,7 +226,7 @@ public final class Utilities {
}
public static boolean isHalfblock(Block block) {
return isSlab(block) || isStair(block) || isWall(block);
return isSlab(block) || isStair(block) || isWall(block) || block.getType() == Material.SNOW;
}