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 p_77620_, Mob p_77621_)
      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 p_230632_)
    • canStartAt

      protected boolean canStartAt(BlockPos p_262596_)
    • getTarget

      public Target getTarget(double p_326793_, double p_326919_, double p_326802_)
      Specified by:
      getTarget in class NodeEvaluator
    • getNeighbors

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

      protected boolean isNeighborValid(@Nullable Node p_77627_, Node p_77628_)
    • isDiagonalValid

      protected boolean isDiagonalValid(Node p_326907_, @Nullable Node p_326803_, @Nullable Node p_326821_)
    • isDiagonalValid

      protected boolean isDiagonalValid(@Nullable Node p_77630_)
    • doesBlockHavePartialCollision

      private static boolean doesBlockHavePartialCollision(PathType p_326827_)
    • canReachWithoutCollision

      private boolean canReachWithoutCollision(Node p_77625_)
    • getFloorLevel

      protected double getFloorLevel(BlockPos p_164733_)
    • getFloorLevel

      public static double getFloorLevel(BlockGetter p_77612_, BlockPos p_77613_)
    • isAmphibious

      protected boolean isAmphibious()
    • findAcceptedNode

      @Nullable protected Node findAcceptedNode(int p_164726_, int p_164727_, int p_164728_, int p_164729_, double p_164730_, Direction p_164731_, PathType p_326873_)
    • getMobJumpHeight

      private double getMobJumpHeight()
    • getNodeAndUpdateCostToMax

      private Node getNodeAndUpdateCostToMax(int p_230620_, int p_230621_, int p_230622_, PathType p_326789_, float p_230624_)
    • getBlockedNode

      private Node getBlockedNode(int p_230628_, int p_230629_, int p_230630_)
    • getClosedNode

      private Node getClosedNode(int p_326935_, int p_326904_, int p_326845_, PathType p_326820_)
    • tryJumpOn

      @Nullable private Node tryJumpOn(int p_326914_, int p_326900_, int p_326886_, int p_326902_, double p_326800_, Direction p_326868_, PathType p_326831_, BlockPos.MutableBlockPos p_326839_)
    • tryFindFirstNonWaterBelow

      @Nullable private Node tryFindFirstNonWaterBelow(int p_326959_, int p_326927_, int p_326932_, @Nullable Node p_326880_)
    • tryFindFirstGroundNodeBelow

      private Node tryFindFirstGroundNodeBelow(int p_326892_, int p_326901_, int p_326809_)
    • hasCollisions

      private boolean hasCollisions(AABB p_77635_)
    • getCachedPathType

      protected PathType getCachedPathType(int p_326926_, int p_326795_, int p_326824_)
    • getPathTypeOfMob

      public PathType getPathTypeOfMob(PathfindingContext p_330551_, int p_326939_, int p_326943_, int p_326876_, Mob p_326786_)
      Specified by:
      getPathTypeOfMob in class NodeEvaluator
    • getPathTypeWithinMobBB

      public Set<PathType> getPathTypeWithinMobBB(PathfindingContext p_331617_, int p_326916_, int p_326906_, int p_326848_)
    • getPathType

      public PathType getPathType(PathfindingContext p_330217_, int p_326856_, int p_326857_, int p_326859_)
      Specified by:
      getPathType in class NodeEvaluator
    • getPathTypeStatic

      public static PathType getPathTypeStatic(Mob p_332010_, BlockPos p_330520_)
    • getPathTypeStatic

      public static PathType getPathTypeStatic(PathfindingContext p_330755_, BlockPos.MutableBlockPos p_331020_)
    • checkNeighbourBlocks

      public static PathType checkNeighbourBlocks(PathfindingContext p_331893_, int p_332169_, int p_330433_, int p_331506_, PathType p_326944_)
    • getPathTypeFromState

      protected static PathType getPathTypeFromState(BlockGetter p_77644_, BlockPos p_77645_)