Class ColonyConnectionManager
java.lang.Object
com.minecolonies.core.colony.managers.ColonyConnectionManager
- All Implemented Interfaces:
IColonyConnectionManager,net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddNewConnectionNode(net.minecraft.core.BlockPos connectionPoint) Add a new connection point and connect to neighbors.voidaddNewGateHouse(net.minecraft.core.BlockPos gateHouseConnectionNode) Add a new gatehouse.booleanattemptEstablishConnection(net.minecraft.core.BlockPos targetColonyConnectionPos, IColony targetColony) Attempt to establish a connection.voiddeserializeFromView(@NotNull net.minecraft.network.FriendlyByteBuf buf) Deserialize connection manager from buffer for client side usage.voiddeserializeNBT(net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) 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.net.minecraft.nbt.CompoundTagserializeNBT(net.minecraft.core.HolderLookup.Provider provider) 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.
-
Constructor Details
-
ColonyConnectionManager
Create a new connection manager.- Parameters:
colony- its colony.
-
-
Method Details
-
addNewConnectionNode
public boolean addNewConnectionNode(net.minecraft.core.BlockPos connectionPoint) Description copied from interface:IColonyConnectionManagerAdd a new connection point and connect to neighbors.- Specified by:
addNewConnectionNodein interfaceIColonyConnectionManager- Parameters:
connectionPoint- the node position.- Returns:
-
removeConnectionNode
public void removeConnectionNode(net.minecraft.core.BlockPos connectionPoint) Description copied from interface:IColonyConnectionManagerRemove a connection point and update neighbors.- Specified by:
removeConnectionNodein interfaceIColonyConnectionManager- Parameters:
connectionPoint- the node position.
-
attemptEstablishConnection
public boolean attemptEstablishConnection(net.minecraft.core.BlockPos targetColonyConnectionPos, IColony targetColony) Description copied from interface:IColonyConnectionManagerAttempt to establish a connection.- Specified by:
attemptEstablishConnectionin interfaceIColonyConnectionManager- Parameters:
targetColonyConnectionPos- the clicked position.targetColony- , the colony we're trying to connect to.
-
tick
public void tick()Description copied from interface:IColonyConnectionManagerTick to process work.- Specified by:
tickin interfaceIColonyConnectionManager
-
getDirectlyConnectedColonies
Description copied from interface:IColonyConnectionManagerGet all directly connected colonies.- Specified by:
getDirectlyConnectedColoniesin interfaceIColonyConnectionManager- Returns:
- the map of directly connected colonies.
-
getIndirectlyConnectedColonies
Description copied from interface:IColonyConnectionManagerGet all indirectly connected colonies.- Specified by:
getIndirectlyConnectedColoniesin interfaceIColonyConnectionManager- Returns:
- the map of them.
-
getNode
Description copied from interface:IColonyConnectionManagerGet a connection node.- Specified by:
getNodein interfaceIColonyConnectionManager- Parameters:
blockPos- its position.- Returns:
- the node object.
-
addNewGateHouse
public void addNewGateHouse(net.minecraft.core.BlockPos gateHouseConnectionNode) Description copied from interface:IColonyConnectionManagerAdd a new gatehouse.- Specified by:
addNewGateHousein interfaceIColonyConnectionManager- Parameters:
gateHouseConnectionNode- the blockpos.
-
removeGateHouse
public void removeGateHouse(net.minecraft.core.BlockPos gateHousePosition) Description copied from interface:IColonyConnectionManagerRemove a gatehouse.- Specified by:
removeGateHousein interfaceIColonyConnectionManager- Parameters:
gateHousePosition- the blockpos.
-
serializeToView
public void serializeToView(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:IColonyConnectionManagerSerialize connection manager to view.- Specified by:
serializeToViewin interfaceIColonyConnectionManager- Parameters:
buf- the buf to serialize it to.
-
deserializeFromView
public void deserializeFromView(@NotNull @NotNull net.minecraft.network.FriendlyByteBuf buf) Description copied from interface:IColonyConnectionManagerDeserialize connection manager from buffer for client side usage.- Specified by:
deserializeFromViewin interfaceIColonyConnectionManager- Parameters:
buf- the buf to read it from.
-
deserializeNBT
public void deserializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider, net.minecraft.nbt.CompoundTag compound) - Specified by:
deserializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT(@NotNull net.minecraft.core.HolderLookup.Provider provider) - Specified by:
serializeNBTin interfacenet.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
-
triggerConnectionEvent
Description copied from interface:IColonyConnectionManagerTrigger a connection event at a colony.- Specified by:
triggerConnectionEventin interfaceIColonyConnectionManager- Parameters:
connectionEventData- the source colony data.
-
getConnectionEvents
Description copied from interface:IColonyConnectionManagerGet the list of connection events.- Specified by:
getConnectionEventsin interfaceIColonyConnectionManager- Returns:
- the connection events.
-
getColonyDiplomacyStatus
Description copied from interface:IColonyConnectionManagerGet colony diplomacy status by id.- Specified by:
getColonyDiplomacyStatusin interfaceIColonyConnectionManager- Parameters:
id- the id to query from.- Returns:
- the diplomacy status.
-