Interface NetworkBehavior

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface NetworkBehavior
How a network moves resources (SPI). Called once per tick while the network is active; a network that moved nothing sleeps until one of its machines' storages changes (ยง17).
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull NetworkBehavior
    Moves from every port that allows extraction into every other port that allows insertion, round-robin over the targets and within the network's rate.
    static @NotNull NetworkBehavior
    distributing(long everyTicks)
    distributing() once every everyTicks ticks, each time up to the network's rate: items move in batches (Mekanism's transporters pull a stack every half second).
    long
    tick(@NotNull NetworkContext context)
     
  • Method Details

    • tick

      long tick(@NotNull @NotNull NetworkContext context)
      Returns:
      how much was moved; 0 puts the network to sleep
    • distributing

      @NotNull static @NotNull NetworkBehavior distributing()
      Moves from every port that allows extraction into every other port that allows insertion, round-robin over the targets and within the network's rate. Only what the network's filter accepts moves. Each move is a transaction, so nothing is lost or created.
    • distributing

      @NotNull static @NotNull NetworkBehavior distributing(long everyTicks)
      distributing() once every everyTicks ticks, each time up to the network's rate: items move in batches (Mekanism's transporters pull a stack every half second). Between batches the network stays awake while a source holds something it carries, or while it pulls from a container (whose changes wake nothing).