Interface IColonyConnectionManager
- All Superinterfaces:
net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- All Known Implementing Classes:
ColonyConnectionManager
public interface IColonyConnectionManager
extends net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Connection manager interface.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddNewConnectionNode(net.minecraft.core.BlockPos connectionPoint) Add a new connection point and connect to neighbors.voidaddNewGateHouse(net.minecraft.core.BlockPos gateHousePosition) Add a new gatehouse.booleanattemptEstablishConnection(net.minecraft.core.BlockPos clickedPos, IColony targetColony) Attempt to establish a connection.voiddeserializeFromView(@NotNull net.minecraft.network.FriendlyByteBuf buf) Deserialize connection manager from buffer for client side usage.getColonyDiplomacyStatus(int id) Get colony diplomacy status by id.Get the list of connection events.Get all directly connected colonies.Get all indirectly connected colonies.getNode(net.minecraft.core.BlockPos blockPos) Get a connection node.voidremoveConnectionNode(net.minecraft.core.BlockPos connectionPoint) Remove a connection point and update neighbors.voidremoveGateHouse(net.minecraft.core.BlockPos gateHousePosition) Remove a gatehouse.voidserializeToView(@NotNull net.minecraft.network.FriendlyByteBuf buf) Serialize connection manager to view.voidtick()Tick to process work.voidtriggerConnectionEvent(ConnectionEvent connectionEventData) Trigger a connection event at a colony.Methods inherited from interface net.minecraftforge.common.util.INBTSerializable
deserializeNBT, serializeNBT
-
Method Details
-
addNewConnectionNode
boolean addNewConnectionNode(net.minecraft.core.BlockPos connectionPoint) Add a new connection point and connect to neighbors.- Parameters:
connectionPoint- the node position.- Returns:
-
removeConnectionNode
void removeConnectionNode(net.minecraft.core.BlockPos connectionPoint) Remove a connection point and update neighbors.- Parameters:
connectionPoint- the node position.
-
tick
void tick()Tick to process work. -
getDirectlyConnectedColonies
TreeMap<Integer,ColonyConnection> getDirectlyConnectedColonies()Get all directly connected colonies.- Returns:
- the map of directly connected colonies.
-
getIndirectlyConnectedColonies
TreeMap<Integer,ColonyConnection> getIndirectlyConnectedColonies()Get all indirectly connected colonies.- Returns:
- the map of them.
-
getNode
Get a connection node.- Parameters:
blockPos- its position.- Returns:
- the node object.
-
addNewGateHouse
void addNewGateHouse(net.minecraft.core.BlockPos gateHousePosition) Add a new gatehouse.- Parameters:
gateHousePosition- the blockpos.
-
removeGateHouse
void removeGateHouse(net.minecraft.core.BlockPos gateHousePosition) Remove a gatehouse.- Parameters:
gateHousePosition- the blockpos.
-
attemptEstablishConnection
Attempt to establish a connection.- Parameters:
clickedPos- the clicked position.targetColony- , the colony we're trying to connect to.
-
serializeToView
void serializeToView(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Serialize connection manager to view.- Parameters:
buf- the buf to serialize it to.
-
deserializeFromView
void deserializeFromView(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Deserialize connection manager from buffer for client side usage.- Parameters:
buf- the buf to read it from.
-
triggerConnectionEvent
Trigger a connection event at a colony.- Parameters:
connectionEventData- the source colony data.
-
getConnectionEvents
List<ConnectionEvent> getConnectionEvents()Get the list of connection events.- Returns:
- the connection events.
-
getColonyDiplomacyStatus
Get colony diplomacy status by id.- Parameters:
id- the id to query from.- Returns:
- the diplomacy status.
-