Class InWorldNetworkNodeContainerImpl
java.lang.Object
com.refinedmods.refinedstorage.common.support.network.InWorldNetworkNodeContainerImpl
- All Implemented Interfaces:
NetworkNodeContainer
,ConnectionStrategy
,InWorldNetworkNodeContainer
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.refinedmods.refinedstorage.common.api.support.network.InWorldNetworkNodeContainer
InWorldNetworkNodeContainer.Builder
-
Constructor Summary
ConstructorDescriptionInWorldNetworkNodeContainerImpl
(net.minecraft.world.level.block.entity.BlockEntity blockEntity, NetworkNode node, String name, int priority, ConnectionStrategy connectionStrategy, Supplier<Object> keyProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add outgoing connections here.boolean
canAcceptIncomingConnection
(net.minecraft.core.Direction incomingDirection, net.minecraft.world.level.block.state.BlockState connectingState) Returns whether the (not yet discovered) node can accept an incoming connection.If this container needs to be indexed by the network graph, so it can be queried quickly (by key), you can return a key here.net.minecraft.world.level.block.state.BlockState
net.minecraft.core.BlockPos
getName()
getNode()
net.minecraft.core.GlobalPos
int
The container priority determines the order in which the remainder containers as the result of a network split are re-initialized with a new network.boolean
-
Constructor Details
-
InWorldNetworkNodeContainerImpl
public InWorldNetworkNodeContainerImpl(net.minecraft.world.level.block.entity.BlockEntity blockEntity, NetworkNode node, String name, int priority, ConnectionStrategy connectionStrategy, @Nullable Supplier<Object> keyProvider)
-
-
Method Details
-
getNode
- Specified by:
getNode
in interfaceNetworkNodeContainer
-
addOutgoingConnections
Description copied from interface:ConnectionStrategy
Add outgoing connections here. Called when a node is about to be added into the network graph. If the outgoing connections ever change, callRefinedStorageApi.updateNetworkNodeContainer(InWorldNetworkNodeContainer, Level)
.- Specified by:
addOutgoingConnections
in interfaceConnectionStrategy
- Parameters:
sink
- the sink that accepts outgoing connections
-
canAcceptIncomingConnection
public boolean canAcceptIncomingConnection(net.minecraft.core.Direction incomingDirection, net.minecraft.world.level.block.state.BlockState connectingState) Description copied from interface:ConnectionStrategy
Returns whether the (not yet discovered) node can accept an incoming connection. Changes to this return value won't cause a rebuild of the network state. If the return value ever changes, callRefinedStorageApi.updateNetworkNodeContainer(InWorldNetworkNodeContainer, Level)
.- Specified by:
canAcceptIncomingConnection
in interfaceConnectionStrategy
- Parameters:
incomingDirection
- the incoming directionconnectingState
- the state wanting to connect- Returns:
- whether the node can accept an incoming connection
-
getBlockState
public net.minecraft.world.level.block.state.BlockState getBlockState()- Specified by:
getBlockState
in interfaceInWorldNetworkNodeContainer
-
isRemoved
public boolean isRemoved()- Specified by:
isRemoved
in interfaceInWorldNetworkNodeContainer
-
getPosition
public net.minecraft.core.GlobalPos getPosition()- Specified by:
getPosition
in interfaceInWorldNetworkNodeContainer
-
getLocalPosition
public net.minecraft.core.BlockPos getLocalPosition()- Specified by:
getLocalPosition
in interfaceInWorldNetworkNodeContainer
-
getName
- Specified by:
getName
in interfaceInWorldNetworkNodeContainer
-
getPriority
public int getPriority()Description copied from interface:NetworkNodeContainer
The container priority determines the order in which the remainder containers as the result of a network split are re-initialized with a new network. A container with the highest priority will be re-initialized first.- Specified by:
getPriority
in interfaceNetworkNodeContainer
- Returns:
- the priority
-
createKey
Description copied from interface:NetworkNodeContainer
If this container needs to be indexed by the network graph, so it can be queried quickly (by key), you can return a key here. The key must be kept stable, and must stay the same for the lifetime of the container. If it changes after adding it into the graph, the container would not be removed from the key index when the container is removed! The container can be queried byGraphNetworkComponent.getContainer(Object)
.- Specified by:
createKey
in interfaceNetworkNodeContainer
- Returns:
- the key, or null if indexing is not required
-