Interface ConnectionStrategy

All Known Subinterfaces:
InWorldNetworkNodeContainer
All Known Implementing Classes:
ColoredConnectionStrategy, InWorldNetworkNodeContainerImpl, SimpleConnectionStrategy

@API(status=STABLE, since="2.0.0-milestone.3.6") public interface ConnectionStrategy
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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.
  • Method Details

    • addOutgoingConnections

      void addOutgoingConnections(ConnectionSink sink)
      Add outgoing connections here. Called when a node is about to be added into the network graph. If the outgoing connections ever change, call RefinedStorageApi.updateNetworkNodeContainer(InWorldNetworkNodeContainer, Level).
      Parameters:
      sink - the sink that accepts outgoing connections
    • canAcceptIncomingConnection

      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. Changes to this return value won't cause a rebuild of the network state. If the return value ever changes, call RefinedStorageApi.updateNetworkNodeContainer(InWorldNetworkNodeContainer, Level).
      Parameters:
      incomingDirection - the incoming direction
      connectingState - the state wanting to connect
      Returns:
      whether the node can accept an incoming connection