Interface IGridServiceProvider


public interface IGridServiceProvider
Allows you to create a grid-wide service. AE2 uses these for providing item, spatial, and tunnel services.

Any class that implements this needs to be registered with GridServices.

  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addNode(IGridNode gridNode)
    Informs the grid service about a node that was added to the grid.
    default void
    onJoin(IGridStorage sourceStorage)
    Called when two grids merge into one, AE will call a join as it Iteratively processes changes.
    default void
    onLevelEndTick(net.minecraft.world.level.Level level)
    Called each tick for the network, allows you to have active network wide behaviors.
    default void
    onLevelStartTick(net.minecraft.world.level.Level level)
    Called each tick for the network, allows you to have active network wide behaviors.
    default void
    Called each tick for the network, allows you to have active network wide behaviors.
    default void
    Called each tick for the network, allows you to have active network wide behaviors.
    default void
    onSplit(IGridStorage destinationStorage)
    Called when a grid splits into two grids, AE will call a split as it iteratively processes changes.
    default void
    populateGridStorage(IGridStorage destinationStorage)
    Called when saving changes,
    default void
    Informs the grid service, that a node was removed from the grid.
  • Method Details

    • onServerStartTick

      default void onServerStartTick()
      Called each tick for the network, allows you to have active network wide behaviors.

      Called at the beginning of a server tick.

    • onLevelStartTick

      default void onLevelStartTick(net.minecraft.world.level.Level level)
      Called each tick for the network, allows you to have active network wide behaviors.

      Called at the beginning of a level tick. Will happen for each Level separately.

    • onLevelEndTick

      default void onLevelEndTick(net.minecraft.world.level.Level level)
      Called each tick for the network, allows you to have active network wide behaviors.

      Called at the end of a level tick. Will happen for each Level separately.

    • onServerEndTick

      default void onServerEndTick()
      Called each tick for the network, allows you to have active network wide behaviors.

      Called at the end of a server tick.

    • removeNode

      default void removeNode(IGridNode gridNode)
      Informs the grid service, that a node was removed from the grid.

      Important: Do not trust the grids state in this method, interact only with the node you are passed, if you need to manage other grid information, do it on the next updateTick.

      Parameters:
      gridNode - removed from that grid
    • addNode

      default void addNode(IGridNode gridNode)
      Informs the grid service about a node that was added to the grid.

      Important: Do not trust the grids state in this method, interact only with the node you are passed, if you need to manage other grid information, do it on the next updateTick.

      Parameters:
      gridNode - added to grid node
    • onSplit

      default void onSplit(IGridStorage destinationStorage)
      Called when a grid splits into two grids, AE will call a split as it iteratively processes changes. The destination should receive half, and the current service should retain half.
      Parameters:
      destinationStorage - storage which receives half of old grid
    • onJoin

      default void onJoin(IGridStorage sourceStorage)
      Called when two grids merge into one, AE will call a join as it Iteratively processes changes. Use this method to incorporate all the data from the source into your service.
      Parameters:
      sourceStorage - old storage
    • populateGridStorage

      default void populateGridStorage(IGridStorage destinationStorage)
      Called when saving changes,
      Parameters:
      destinationStorage - storage