Class ColonyConnectionNode
java.lang.Object
com.minecolonies.api.colony.connections.ColonyConnectionNode
- Direct Known Subclasses:
PendingConnectionNode
Node in the path from one colony to another.
-
Constructor Summary
ConstructorsConstructorDescriptionColonyConnectionNode(net.minecraft.core.BlockPos position) Create a new connection node at a given pos. -
Method Summary
Modifier and TypeMethodDescriptionvoidalterNextNode(net.minecraft.core.BlockPos nextNode) Alter the next node connection.voidalterPreviousNode(net.minecraft.core.BlockPos previousNode) Alter the previous node connection.net.minecraft.core.BlockPosGet the next node.net.minecraft.core.BlockPosGet position of this point.net.minecraft.core.BlockPosGet the previous node.intGet the connected target colony id.booleanIf another node can connect to this.voidread(@NotNull net.minecraft.nbt.CompoundTag compound) Read connections from saved NBT data.voidsetTargetColonyId(int targetColonyId) Set the target colony id.net.minecraft.nbt.CompoundTagwrite()Write connections to NBT data for saving.
-
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.
-