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 enum
Gives a reason for why the active state of the node might have changed. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
onGridChanged
(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 void
onInWorldConnectionChanged
(T nodeOwner, IGridNode node) Called by theIGridNode
when the visible connections for the node have changed, useful for cable.default void
onOwnerChanged
(T nodeOwner, IGridNode node) Called by theIGridNode
when the node's owner has changed.void
onSaveChanges
(T nodeOwner, IGridNode node) Called by theIGridNode
when it's persistent state has changed and the host needs to ensure it is saved.default void
onStateChanged
(T nodeOwner, IGridNode node, IGridNodeListener.State state) Called when one of the node's state properties has changed.
-
Method Details
-
onSaveChanges
Called by theIGridNode
when 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 theIGridNode
when the visible connections for the node have changed, useful for cable. -
onOwnerChanged
Called by theIGridNode
when 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-state
as well.- Parameters:
state
- Indicates the node property that might have changed.
-