Class WalkNodeEvaluator

java.lang.Object
net.minecraft.world.level.pathfinder.NodeEvaluator
net.minecraft.world.level.pathfinder.WalkNodeEvaluator
Direct Known Subclasses:
AmphibiousNodeEvaluator, FlyNodeEvaluator

public class WalkNodeEvaluator extends NodeEvaluator
  • Field Details

    • SPACE_BETWEEN_WALL_POSTS

      public static final double SPACE_BETWEEN_WALL_POSTS
      See Also:
    • DEFAULT_MOB_JUMP_HEIGHT

      private static final double DEFAULT_MOB_JUMP_HEIGHT
      See Also:
    • pathTypesByPosCacheByMob

      private final it.unimi.dsi.fastutil.longs.Long2ObjectMap<PathType> pathTypesByPosCacheByMob
    • collisionCache

      private final it.unimi.dsi.fastutil.objects.Object2BooleanMap<AABB> collisionCache
    • reusableNeighbors

      private final Node[] reusableNeighbors
  • Constructor Details

    • WalkNodeEvaluator

      public WalkNodeEvaluator()
  • Method Details

    • prepare

      public void prepare(PathNavigationRegion level, Mob mob)
      Overrides:
      prepare in class NodeEvaluator
    • done

      public void done()
      Overrides:
      done in class NodeEvaluator
    • getStart

      public Node getStart()
      Specified by:
      getStart in class NodeEvaluator
    • getStartNode

      protected Node getStartNode(BlockPos pos)
    • canStartAt

      protected boolean canStartAt(BlockPos pos)
    • getTarget

      public Target getTarget(double x, double y, double z)
      Specified by:
      getTarget in class NodeEvaluator
    • getNeighbors

      public int getNeighbors(Node[] outputArray, Node p_node)
      Specified by:
      getNeighbors in class NodeEvaluator
    • isNeighborValid

      protected boolean isNeighborValid(@Nullable Node neighbor, Node node)
    • isDiagonalValid

      protected boolean isDiagonalValid(Node root, @Nullable Node xNode, @Nullable Node zNode)
    • isDiagonalValid

      protected boolean isDiagonalValid(@Nullable Node node)
    • doesBlockHavePartialCollision

      private static boolean doesBlockHavePartialCollision(PathType pathType)
    • canReachWithoutCollision

      private boolean canReachWithoutCollision(Node node)
    • getFloorLevel

      protected double getFloorLevel(BlockPos pos)
    • getFloorLevel

      public static double getFloorLevel(BlockGetter level, BlockPos pos)
    • isAmphibious

      protected boolean isAmphibious()
    • findAcceptedNode

      @Nullable protected Node findAcceptedNode(int x, int y, int z, int verticalDeltaLimit, double nodeFloorLevel, Direction direction, PathType pathType)
    • getMobJumpHeight

      private double getMobJumpHeight()
    • getNodeAndUpdateCostToMax

      private Node getNodeAndUpdateCostToMax(int x, int y, int z, PathType pathType, float malus)
    • getBlockedNode

      private Node getBlockedNode(int x, int y, int z)
    • getClosedNode

      private Node getClosedNode(int x, int y, int z, PathType pathType)
    • tryJumpOn

      @Nullable private Node tryJumpOn(int x, int y, int z, int verticalDeltaLimit, double nodeFloorLevel, Direction direction, PathType pathType, BlockPos.MutableBlockPos pos)
    • tryFindFirstNonWaterBelow

      @Nullable private Node tryFindFirstNonWaterBelow(int x, int y, int z, @Nullable Node node)
    • tryFindFirstGroundNodeBelow

      private Node tryFindFirstGroundNodeBelow(int x, int y, int z)
    • hasCollisions

      private boolean hasCollisions(AABB boundingBox)
    • getCachedPathType

      protected PathType getCachedPathType(int x, int y, int z)
    • getPathTypeOfMob

      public PathType getPathTypeOfMob(PathfindingContext context, int x, int y, int z, Mob mob)
      Specified by:
      getPathTypeOfMob in class NodeEvaluator
    • getPathTypeWithinMobBB

      public Set<PathType> getPathTypeWithinMobBB(PathfindingContext context, int x, int y, int z)
    • getPathType

      public PathType getPathType(PathfindingContext context, int x, int y, int z)
      Specified by:
      getPathType in class NodeEvaluator
    • getPathTypeStatic

      public static PathType getPathTypeStatic(Mob mob, BlockPos pos)
    • getPathTypeStatic

      public static PathType getPathTypeStatic(PathfindingContext context, BlockPos.MutableBlockPos pos)
    • checkNeighbourBlocks

      public static PathType checkNeighbourBlocks(PathfindingContext context, int x, int y, int z, PathType pathType)
    • getPathTypeFromState

      protected static PathType getPathTypeFromState(BlockGetter level, BlockPos pos)