java.lang.Object
com.minecolonies.core.entity.ai.workers.util.MineNode

public class MineNode extends Object
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

  • Constructor Details

    • MineNode

      public MineNode(int x, int z, @Nullable @Nullable Vec2i parent)
      Initializes the node. Requires a location in the node as parameters
      Parameters:
      x - X-coordinate in the node
      z - Z-coordinate in the node
      parent - 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

      @NotNull public @NotNull MineNode.NodeStatus getStatus()
      Returns the MineNode.NodeStatus of the current node.
      Returns:
      MineNode.NodeStatus
    • setStatus

      public void setStatus(@NotNull @NotNull MineNode.NodeStatus status)
      Sets the status of the current node.
      Parameters:
      status - MineNode.NodeStatus
    • getParent

      @Nullable public @Nullable Vec2i getParent()
      Getter for the parent value.
      Returns:
      tuple of parent position.
    • toString

      @NotNull public @NotNull String toString()
      Overrides:
      toString in class Object
    • getStyle

      @NotNull public @NotNull MineNode.NodeType getStyle()
      Returns the MineNode.NodeType of the current node.
      Returns:
      MineNode.NodeType
    • setStyle

      public void setStyle(@NotNull @NotNull MineNode.NodeType style)
      Sets the MineNode.NodeType of 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

      public Vec2i getNorthNodeCenter()
      Calculates the next Node north.
      Returns:
      position of the new Node.
    • getSouthNodeCenter

      public Vec2i getSouthNodeCenter()
      Calculates the next Node south.
      Returns:
      position of the new Node.
    • getEastNodeCenter

      public Vec2i getEastNodeCenter()
      Calculates the next Node east.
      Returns:
      position of the new Node.
    • getWestNodeCenter

      public Vec2i getWestNodeCenter()
      Calculates the next Node west.
      Returns:
      position of the new Node.
    • getRandomNextNode

      @Nullable public @Nullable MineNode getRandomNextNode(MinerLevel level, int step)
      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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getRotationMirror

      public Optional<com.ldtteam.structurize.api.RotationMirror> 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 -