Class PendingConnectionNode
java.lang.Object
com.minecolonies.api.colony.connections.ColonyConnectionNode
com.minecolonies.api.colony.connections.PendingConnectionNode
Pending connected colony data while pathfinding is still trying to connect.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe different connection types. -
Constructor Summary
ConstructorsConstructorDescriptionPendingConnectionNode(net.minecraft.core.BlockPos pos) Constructor for deserialization/serialization.PendingConnectionNode(net.minecraft.core.BlockPos pos, PathResult<PathJobMoveToLocation> pathResult, PendingConnectionNode.PendingConnectionType connectionType) Create a new pending node. -
Method Summary
Modifier and TypeMethodDescription@Nullable PathResult<PathJobMoveToLocation>Get the cached path result.If this is a regular connection, or a mending connection (pending connection does not destroy sign if fail to path) or a colony connection.voidread(@NotNull net.minecraft.nbt.CompoundTag compound) Read connections from saved NBT data.voidsetCachedPathResult(PathResult<PathJobMoveToLocation> cachedPathResult) Store the cached path result.net.minecraft.nbt.CompoundTagwrite()Write connections to NBT data for saving.Methods inherited from class com.minecolonies.api.colony.connections.ColonyConnectionNode
alterNextNode, alterPreviousNode, getNextNode, getPosition, getPreviousNode, getTargetColonyId, hasNextNode, setTargetColonyId
-
Constructor Details
-
PendingConnectionNode
public PendingConnectionNode(net.minecraft.core.BlockPos pos, PathResult<PathJobMoveToLocation> pathResult, PendingConnectionNode.PendingConnectionType connectionType) Create a new pending node.- Parameters:
pos- it's pos.pathResult- the path result.connectionType- the connection type.
-
PendingConnectionNode
public PendingConnectionNode(net.minecraft.core.BlockPos pos) Constructor for deserialization/serialization.
-
-
Method Details
-
write
public net.minecraft.nbt.CompoundTag write()Write connections to NBT data for saving.- Overrides:
writein classColonyConnectionNode- Returns:
- compound NBT-Tag.
-
read
public void read(@NotNull @NotNull net.minecraft.nbt.CompoundTag compound) Read connections from saved NBT data.- Overrides:
readin classColonyConnectionNode- Parameters:
compound- NBT Tag.
-
getPendingConnectionType
If this is a regular connection, or a mending connection (pending connection does not destroy sign if fail to path) or a colony connection.- Returns:
- the enum type.
-
setCachedPathResult
Store the cached path result.- Parameters:
cachedPathResult- the cached path result.
-
getCachedPathResult
Get the cached path result.- Returns:
- the cached path result.
-