Class Node
java.lang.Object
net.minecraft.world.level.pathfinder.Node
- Direct Known Subclasses:
Target
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
float
The additional cost of the path point.float
The total cost of the path containing this path point.float
The total cost of all path points up to this one.float
The estimated cost from this path point to the target.private final int
int
The index in the PathHeap. -1 if not assigned.float
final int
final int
final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasVec3()
cloneAndMove
(int pX, int pY, int pZ) static Node
createFromStream
(FriendlyByteBuf pBuffer) static int
createHash
(int pX, int pY, int pZ) float
distanceManhattan
(BlockPos pPos) float
distanceManhattan
(Node pPoint) float
distanceTo
(BlockPos pPos) float
distanceTo
(Node pPoint) Returns the linear distance to another path pointfloat
distanceToSqr
(BlockPos pPos) float
distanceToSqr
(Node pPoint) Returns the squared distance to another path pointfloat
distanceToXZ
(Node pPoint) boolean
int
hashCode()
boolean
protected static void
readContents
(FriendlyByteBuf pBuffer, Node pNode) toString()
void
writeToStream
(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
-