Class ColonyConnectionNode

java.lang.Object
com.minecolonies.api.colony.connections.ColonyConnectionNode
Direct Known Subclasses:
PendingConnectionNode

public class ColonyConnectionNode extends Object
Node in the path from one colony to another.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ColonyConnectionNode(net.minecraft.core.BlockPos position)
    Create a new connection node at a given pos.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    alterNextNode(net.minecraft.core.BlockPos nextNode)
    Alter the next node connection.
    void
    alterPreviousNode(net.minecraft.core.BlockPos previousNode)
    Alter the previous node connection.
    net.minecraft.core.BlockPos
    Get the next node.
    net.minecraft.core.BlockPos
    Get position of this point.
    net.minecraft.core.BlockPos
    Get the previous node.
    int
    Get the connected target colony id.
    boolean
    If another node can connect to this.
    void
    read(@NotNull net.minecraft.nbt.CompoundTag compound)
    Read connections from saved NBT data.
    void
    setTargetColonyId(int targetColonyId)
    Set the target colony id.
    net.minecraft.nbt.CompoundTag
    Write connections to NBT data for saving.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ColonyConnectionNode

      public ColonyConnectionNode(net.minecraft.core.BlockPos position)
      Create a new connection node at a given pos.
      Parameters:
      position - the pos.
  • Method Details

    • alterPreviousNode

      public void alterPreviousNode(net.minecraft.core.BlockPos previousNode)
      Alter the previous node connection.
      Parameters:
      previousNode - the previous node pos.
    • alterNextNode

      public void alterNextNode(net.minecraft.core.BlockPos nextNode)
      Alter the next node connection.
      Parameters:
      nextNode - the next nod epos.
    • getPosition

      public net.minecraft.core.BlockPos getPosition()
      Get position of this point.
      Returns:
      the position.
    • getPreviousNode

      public net.minecraft.core.BlockPos getPreviousNode()
      Get the previous node.
      Returns:
      prev node pos or zero if not set.
    • getNextNode

      public net.minecraft.core.BlockPos getNextNode()
      Get the next node.
      Returns:
      next node pos or ZERO if not set.
    • getTargetColonyId

      public int getTargetColonyId()
      Get the connected target colony id.
      Returns:
      the target colony id.
    • setTargetColonyId

      public void setTargetColonyId(int targetColonyId)
      Set the target colony id.
      Parameters:
      targetColonyId - the id to set.
    • write

      public net.minecraft.nbt.CompoundTag write()
      Write connections to NBT data for saving.
      Returns:
      compound NBT-Tag.
    • read

      public void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound)
      Read connections from saved NBT data.
      Parameters:
      compound - NBT Tag.
    • hasNextNode

      public boolean hasNextNode()
      If another node can connect to this.
      Returns:
      true if so.