Skip to content

Commit

Permalink
Make A* pathfinder less permissive with AIR blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Oct 8, 2020
1 parent 9f667ec commit d516f6e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public PassableState isPassable(BlockSource source, PathPoint point) {
Material above = source.getMaterialAt(pos.getBlockX(), pos.getBlockY() + 1, pos.getBlockZ());
Material below = source.getMaterialAt(pos.getBlockX(), pos.getBlockY() - 1, pos.getBlockZ());
Material in = source.getMaterialAt(pos);
boolean canStand = below.isBlock() || canStandOn(below) || isLiquid(in, below) || isClimbable(below);
boolean canStand = canStandOn(below) || isLiquid(in, below) || isClimbable(below);
if (!canStand) {
return PassableState.UNPASSABLE;
}
Expand Down Expand Up @@ -220,7 +220,7 @@ public static boolean validPosition(Block in) {
private static final Set<Material> LIQUIDS = EnumSet.of(Material.WATER, Material.LAVA);
private static final Set<Material> NOT_JUMPABLE = EnumSet.of(Material.SPRUCE_FENCE, Material.BIRCH_FENCE,
Material.JUNGLE_FENCE, Material.ACACIA_FENCE, Material.DARK_OAK_FENCE);
private static final Set<Material> UNWALKABLE = EnumSet.of(Material.AIR, Material.LAVA, Material.CACTUS);
private static final Set<Material> UNWALKABLE = EnumSet.of(Material.AIR, Material.CACTUS);
private static Material WEB = SpigotUtil.isUsing1_13API() ? Material.COBWEB : Material.valueOf("WEB");

static {
Expand Down

0 comments on commit d516f6e

Please sign in to comment.