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 pLevel, Mob pMob)
      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 pPos)
    • canStartAt

      protected boolean canStartAt(BlockPos pPos)
    • getTarget

      public Target getTarget(double pX, double pY, double pZ)
      Specified by:
      getTarget in class NodeEvaluator
    • getNeighbors

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

      protected boolean isNeighborValid(@Nullable Node pNeighbor, Node pNode)
    • isDiagonalValid

      protected boolean isDiagonalValid(Node pRoot, @Nullable Node pXNode, @Nullable Node pZNode)
    • isDiagonalValid

      protected boolean isDiagonalValid(@Nullable Node pNode)
    • doesBlockHavePartialCollision

      private static boolean doesBlockHavePartialCollision(PathType pPathType)
    • canReachWithoutCollision

      private boolean canReachWithoutCollision(Node pNode)
    • getFloorLevel

      protected double getFloorLevel(BlockPos pPos)
    • getFloorLevel

      public static double getFloorLevel(BlockGetter pLevel, BlockPos pPos)
    • isAmphibious

      protected boolean isAmphibious()
    • findAcceptedNode

      @Nullable protected Node findAcceptedNode(int pX, int pY, int pZ, int pVerticalDeltaLimit, double pNodeFloorLevel, Direction pDirection, PathType pPathType)
    • getMobJumpHeight

      private double getMobJumpHeight()
    • getNodeAndUpdateCostToMax

      private Node getNodeAndUpdateCostToMax(int pX, int pY, int pZ, PathType pPathType, float pMalus)
    • getBlockedNode

      private Node getBlockedNode(int pX, int pY, int pZ)
    • getClosedNode

      private Node getClosedNode(int pX, int pY, int pZ, PathType pPathType)
    • tryJumpOn

      @Nullable private Node tryJumpOn(int pX, int pY, int pZ, int pVerticalDeltaLimit, double pNodeFloorLevel, Direction pDirection, PathType pPathType, BlockPos.MutableBlockPos pPos)
    • tryFindFirstNonWaterBelow

      @Nullable private Node tryFindFirstNonWaterBelow(int pX, int pY, int pZ, @Nullable Node pNode)
    • tryFindFirstGroundNodeBelow

      private Node tryFindFirstGroundNodeBelow(int pX, int pY, int pZ)
    • hasCollisions

      private boolean hasCollisions(AABB pBoundingBox)
    • getCachedPathType

      protected PathType getCachedPathType(int pX, int pY, int pZ)
    • getPathTypeOfMob

      public PathType getPathTypeOfMob(PathfindingContext pContext, int pX, int pY, int pZ, Mob pMob)
      Specified by:
      getPathTypeOfMob in class NodeEvaluator
    • getPathTypeWithinMobBB

      public Set<PathType> getPathTypeWithinMobBB(PathfindingContext pContext, int pX, int pY, int pZ)
    • getPathType

      public PathType getPathType(PathfindingContext pContext, int pX, int pY, int pZ)
      Specified by:
      getPathType in class NodeEvaluator
    • getPathTypeStatic

      public static PathType getPathTypeStatic(Mob pMob, BlockPos pPos)
    • getPathTypeStatic

      public static PathType getPathTypeStatic(PathfindingContext pContext, BlockPos.MutableBlockPos pPos)
    • checkNeighbourBlocks

      public static PathType checkNeighbourBlocks(PathfindingContext pContext, int pX, int pY, int pZ, PathType pPathType)
    • getPathTypeFromState

      protected static PathType getPathTypeFromState(BlockGetter pLevel, BlockPos pPos)