Class MineNode
java.lang.Object
com.minecolonies.core.entity.ai.workers.util.MineNode
Miner Node Data StructureIterator.
When a node is completed we should add the surrounding nodes to level as AVAILABLE also note that we don't want node (0, -1) because there will be a ladder on the back wall of the initial node, and we cant put the connection through the ladder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSets the status of the node.static enumSets the node style used. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull MineNodecreateFromNBT(@NotNull net.minecraft.nbt.CompoundTag compound) Creates a node from the NBT Tag.booleanCalculates the next Node east.Calculates the next Node north.@Nullable Vec2iGetter for the parent value.@Nullable MineNodegetRandomNextNode(MinerLevel level, int step) Return a random next node to work at, might be at this node or at a parent.Optional<com.ldtteam.structurize.api.RotationMirror> Get rotation stored in the node as an optional, only set if actually stored.Calculates the next Node south.@NotNull MineNode.NodeStatusReturns theMineNode.NodeStatusof the current node.@NotNull MineNode.NodeTypegetStyle()Returns theMineNode.NodeTypeof the current node.Calculates the next Node west.intgetX()Returns the x-coordinate in the node.intgetZ()Returns the z-coordinate in the node.inthashCode()voidsetRotationMirror(com.ldtteam.structurize.api.RotationMirror rot) Set rotation storaged in the nodevoidsetStatus(@NotNull MineNode.NodeStatus status) Sets the status of the current node.voidsetStyle(@NotNull MineNode.NodeType style) Sets theMineNode.NodeTypeof the current node.@NotNull StringtoString()voidwrite(@NotNull net.minecraft.nbt.CompoundTag compound) Writes the node to a NBT-compound.
-
Constructor Details
-
MineNode
Initializes the node. Requires a location in the node as parameters- Parameters:
x- X-coordinate in the nodez- Z-coordinate in the nodeparent- the parent of the node.
-
-
Method Details
-
createFromNBT
@NotNull public static @NotNull MineNode createFromNBT(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Creates a node from the NBT Tag. Returns the created node- Parameters:
compound- Compound to read from- Returns:
- Node created from compound
-
write
public void write(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Writes the node to a NBT-compound.- Parameters:
compound- Compound to write to
-
getStatus
Returns theMineNode.NodeStatusof the current node.- Returns:
MineNode.NodeStatus
-
setStatus
Sets the status of the current node.- Parameters:
status-MineNode.NodeStatus
-
getParent
Getter for the parent value.- Returns:
- tuple of parent position.
-
toString
-
getStyle
Returns theMineNode.NodeTypeof the current node.- Returns:
MineNode.NodeType
-
setStyle
Sets theMineNode.NodeTypeof the current node.- Parameters:
style-MineNode.NodeType
-
getX
public int getX()Returns the x-coordinate in the node.- Returns:
- x-coordinate
-
getZ
public int getZ()Returns the z-coordinate in the node.- Returns:
- z-coordinate
-
getNorthNodeCenter
Calculates the next Node north.- Returns:
- position of the new Node.
-
getSouthNodeCenter
Calculates the next Node south.- Returns:
- position of the new Node.
-
getEastNodeCenter
Calculates the next Node east.- Returns:
- position of the new Node.
-
getWestNodeCenter
Calculates the next Node west.- Returns:
- position of the new Node.
-
getRandomNextNode
Return a random next node to work at, might be at this node or at a parent.- Parameters:
level- the level it is part of.step- the step.- Returns:
- the next node to go to.
-
equals
-
hashCode
public int hashCode() -
getRotationMirror
Get rotation stored in the node as an optional, only set if actually stored.- Returns:
-
setRotationMirror
public void setRotationMirror(com.ldtteam.structurize.api.RotationMirror rot) Set rotation storaged in the node- Parameters:
rot-
-