java.lang.Object
net.minecraft.world.level.pathfinder.Path

public class Path extends Object
  • Field Details

    • nodes

      private final List<Node> nodes
    • debugData

      @Nullable private Path.DebugData debugData
    • nextNodeIndex

      private int nextNodeIndex
    • target

      private final BlockPos target
    • distToTarget

      private final float distToTarget
    • reached

      private final boolean reached
  • Constructor Details

  • Method Details

    • advance

      public void advance()
    • notStarted

      public boolean notStarted()
    • isDone

      public boolean isDone()
    • getEndNode

      @Nullable public Node getEndNode()
    • getNode

      public Node getNode(int pIndex)
      Returns the Node located at the specified index, usually the current one.
    • truncateNodes

      public void truncateNodes(int pLength)
    • replaceNode

      public void replaceNode(int pIndex, Node pPoint)
    • getNodeCount

      public int getNodeCount()
    • getNextNodeIndex

      public int getNextNodeIndex()
    • setNextNodeIndex

      public void setNextNodeIndex(int pCurrentPathIndex)
    • getEntityPosAtNode

      public Vec3 getEntityPosAtNode(Entity pEntity, int pIndex)
      Gets the vector of the Node associated with the given index.
    • getNodePos

      public BlockPos getNodePos(int pIndex)
    • getNextEntityPos

      public Vec3 getNextEntityPos(Entity pEntity)
      Returns:
      the current PathEntity target node as a Vec3D
    • getNextNodePos

      public BlockPos getNextNodePos()
    • getNextNode

      public Node getNextNode()
    • getPreviousNode

      @Nullable public Node getPreviousNode()
    • sameAs

      public boolean sameAs(@Nullable Path pPathentity)
      Returns true if the EntityPath are the same. Non instance related equals.
    • canReach

      public boolean canReach()
    • setDebug

      void setDebug(Node[] pOpenSet, Node[] pClosedSet, Set<Target> pTargetNodes)
    • debugData

      @Nullable public Path.DebugData debugData()
    • writeToStream

      public void writeToStream(FriendlyByteBuf pBuffer)
    • createFromStream

      public static Path createFromStream(FriendlyByteBuf pBuf)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTarget

      public BlockPos getTarget()
    • getDistToTarget

      public float getDistToTarget()
    • readNodeArray

      static Node[] readNodeArray(FriendlyByteBuf pBuffer)
    • writeNodeArray

      static void writeNodeArray(FriendlyByteBuf pBuffer, Node[] pNodeArray)
    • copy

      public Path copy()