Package appeng.api.networking
Interface IGridNodeListener<T>
public interface IGridNodeListener<T>
Interface that allows a grid node to notify it's host about various events.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumGives a reason for why the active state of the node might have changed. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidonGridChanged(T nodeOwner, IGridNode node) called when the grid for the node has changed, the general grid state should not be trusted at this point.default voidonInWorldConnectionChanged(T nodeOwner, IGridNode node) Called by theIGridNodewhen the visible connections for the node have changed, useful for cable.default voidonOwnerChanged(T nodeOwner, IGridNode node) Called by theIGridNodewhen the node's owner has changed.voidonSaveChanges(T nodeOwner, IGridNode node) Called by theIGridNodewhen it's persistent state has changed and the host needs to ensure it is saved.default voidonStateChanged(T nodeOwner, IGridNode node, IGridNodeListener.State state) Called when one of the node's state properties has changed.
-
Method Details
-
onSaveChanges
Called by theIGridNodewhen it's persistent state has changed and the host needs to ensure it is saved. Can be implemented on block entities by delegating toBlockEntity.setChanged()for example. -
onInWorldConnectionChanged
Called by theIGridNodewhen the visible connections for the node have changed, useful for cable. -
onOwnerChanged
Called by theIGridNodewhen the node's owner has changed. The node's state needs to be saved. -
onGridChanged
called when the grid for the node has changed, the general grid state should not be trusted at this point. -
onStateChanged
Called when one of the node's state properties has changed. Any of those changes might have potentially changed theactive-stateas well.- Parameters:
state- Indicates the node property that might have changed.
-