Class Node
java.lang.Object
net.minecraft.world.level.pathfinder.Node
- Direct Known Subclasses:
Target
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanfloatThe additional cost of the path point.floatThe total cost of the path containing this path point.floatThe total cost of all path points up to this one.floatThe estimated cost from this path point to the target.private final intintThe index in the PathHeap. -1 if not assigned.floatfinal intfinal intfinal int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasVec3()cloneAndMove(int pX, int pY, int pZ) static NodecreateFromStream(FriendlyByteBuf pBuffer) static intcreateHash(int pX, int pY, int pZ) floatdistanceManhattan(BlockPos pPos) floatdistanceManhattan(Node pPoint) floatdistanceTo(BlockPos pPos) floatdistanceTo(Node pPoint) Returns the linear distance to another path pointfloatdistanceToSqr(BlockPos pPos) floatdistanceToSqr(Node pPoint) Returns the squared distance to another path pointfloatdistanceToXZ(Node pPoint) booleaninthashCode()booleanprotected static voidreadContents(FriendlyByteBuf pBuffer, Node pNode) toString()voidwriteToStream(FriendlyByteBuf pBuffer)
-
Field Details
-
x
public final int x -
y
public final int y -
z
public final int z -
hash
private final int hash -
heapIdx
public int heapIdxThe index in the PathHeap. -1 if not assigned. -
g
public float gThe total cost of all path points up to this one. Corresponds to the A* g-score. -
h
public float hThe estimated cost from this path point to the target. Corresponds to the A* h-score. -
f
public float fThe total cost of the path containing this path point. Used as sort criteria in PathHeap. Corresponds to the A* f-score. -
cameFrom
-
closed
public boolean closed -
walkedDistance
public float walkedDistance -
costMalus
public float costMalusThe additional cost of the path point. If negative, the path point will be sorted out by NodeProcessors. -
type
-
-
Constructor Details
-
Node
public Node(int pX, int pY, int pZ)
-
-
Method Details
-
cloneAndMove
-
createHash
public static int createHash(int pX, int pY, int pZ) -
distanceTo
Returns the linear distance to another path point -
distanceToXZ
-
distanceTo
-
distanceToSqr
Returns the squared distance to another path point -
distanceToSqr
-
distanceManhattan
-
distanceManhattan
-
asBlockPos
-
asVec3
-
equals
-
hashCode
public int hashCode() -
inOpenSet
public boolean inOpenSet() -
toString
-
writeToStream
-
createFromStream
-
readContents
-