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)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    addNode(IGridNode gridNode, @Nullable net.minecraft.nbt.CompoundTag savedData)
    Informs the grid service about a node that was added to the grid.
    default void
    debugDump(com.google.gson.stream.JsonWriter writer, net.minecraft.core.HolderLookup.Provider registries)
    Write debug information about this service to the given writer.
    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
    Informs the grid service, that a node was removed from the grid.
    default void
    saveNodeData(IGridNode gridNode, net.minecraft.nbt.CompoundTag savedData)
    Save provider-specific data for the given node to the given tag.
  • 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

      @Deprecated(forRemoval=true, since="1.20.1") default void addNode(IGridNode gridNode)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • addNode

      default void addNode(IGridNode gridNode, @Nullable @Nullable net.minecraft.nbt.CompoundTag savedData)
      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
      savedData - The grid-related saved data for the node joining the grid. May be null. Contains data written by saveNodeData(appeng.api.networking.IGridNode, net.minecraft.nbt.CompoundTag).
    • saveNodeData

      default void saveNodeData(IGridNode gridNode, net.minecraft.nbt.CompoundTag savedData)
      Save provider-specific data for the given node to the given tag. Note that the tag is shared between all providers, so take care to use unique names for your properties!
    • debugDump

      default void debugDump(com.google.gson.stream.JsonWriter writer, net.minecraft.core.HolderLookup.Provider registries) throws IOException
      Write debug information about this service to the given writer.
      Throws:
      IOException