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_334058_, double p_329070_, double p_328068_)
      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_77630_, @Nullable Node p_77631_, @Nullable Node p_77632_)
    • isDiagonalValid

      protected boolean isDiagonalValid(@Nullable Node p_332817_)
    • doesBlockHavePartialCollision

      private static boolean doesBlockHavePartialCollision(PathType p_332557_)
    • 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_330077_)
    • getMobJumpHeight

      private double getMobJumpHeight()
    • getNodeAndUpdateCostToMax

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

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

      private Node getClosedNode(int p_332713_, int p_333094_, int p_327804_, PathType p_334600_)
    • tryJumpOn

      @Nullable private Node tryJumpOn(int p_335353_, int p_333388_, int p_331837_, int p_329120_, double p_335627_, Direction p_334618_, PathType p_330418_, BlockPos.MutableBlockPos p_329431_)
    • tryFindFirstNonWaterBelow

      @Nullable private Node tryFindFirstNonWaterBelow(int p_334565_, int p_335840_, int p_330496_, @Nullable Node p_327969_)
    • tryFindFirstGroundNodeBelow

      private Node tryFindFirstGroundNodeBelow(int p_335495_, int p_328639_, int p_335885_)
    • hasCollisions

      private boolean hasCollisions(AABB p_77635_)
    • getCachedPathType

      protected PathType getCachedPathType(int p_328411_, int p_334833_, int p_334446_)
    • getPathTypeOfMob

      public PathType getPathTypeOfMob(PathfindingContext p_336212_, int p_330284_, int p_332224_, int p_335362_, Mob p_327680_)
      Specified by:
      getPathTypeOfMob in class NodeEvaluator
    • getPathTypeWithinMobBB

      public Set<PathType> getPathTypeWithinMobBB(PathfindingContext p_334304_, int p_335980_, int p_330052_, int p_334476_)
    • getPathType

      public PathType getPathType(PathfindingContext p_333098_, int p_327758_, int p_329863_, int p_328680_)
      Specified by:
      getPathType in class NodeEvaluator
    • getPathTypeStatic

      public static PathType getPathTypeStatic(Mob p_332988_, BlockPos p_332803_)
    • getPathTypeStatic

      public static PathType getPathTypeStatic(PathfindingContext p_335315_, BlockPos.MutableBlockPos p_334167_)
    • checkNeighbourBlocks

      public static PathType checkNeighbourBlocks(PathfindingContext p_334221_, int p_336062_, int p_335259_, int p_336315_, PathType p_333971_)
    • getPathTypeFromState

      protected static PathType getPathTypeFromState(BlockGetter p_335222_, BlockPos p_331935_)