Package appeng.api.networking
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 TypeMethodDescriptiondefault voidInforms the grid service about a node that was added to the grid.default voidonJoin(IGridStorage sourceStorage) Called when two grids merge into one, AE will call a join as it Iteratively processes changes.default voidonLevelEndTick(net.minecraft.world.level.Level level) Called each tick for the network, allows you to have active network wide behaviors.default voidonLevelStartTick(net.minecraft.world.level.Level level) Called each tick for the network, allows you to have active network wide behaviors.default voidCalled each tick for the network, allows you to have active network wide behaviors.default voidCalled each tick for the network, allows you to have active network wide behaviors.default voidonSplit(IGridStorage destinationStorage) Called when a grid splits into two grids, AE will call a split as it iteratively processes changes.default voidpopulateGridStorage(IGridStorage destinationStorage) Called when saving changes,default voidremoveNode(IGridNode gridNode) 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
Levelseparately. -
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
Levelseparately. -
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
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
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
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
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
Called when saving changes,- Parameters:
destinationStorage- storage
-