Interface IFullNetworkListener
- All Known Subinterfaces:
INetwork
- All Known Implementing Classes:
EnergyNetwork,FullNetworkListenerAdapter,Network,PartNetwork,PositionedAddonsNetworkIngredients
public interface IFullNetworkListener
This should be implemented on network capabilities that wish to listen to all network events.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddNetworkElement(INetworkElement element, boolean networkPreinit) Add a given network element to the network Also checks if it can tick and will handle it accordingly.voidCalled when the server loaded this network.voidCalled when the server will save this network before stopping.booleancanUpdate(INetworkElement element) If the given element can update.voidinvalidateElement(INetworkElement element) Invalidate the given element.voidkill()Terminate the network elements for this network.voidonSkipUpdate(INetworkElement element) When the given element is not being updated becausecanUpdate(INetworkElement)returned false.voidpostUpdate(INetworkElement element) Called after a network element's update was called.voidremoveNetworkElementPost(INetworkElement element) Remove a given network element from the network.booleanremoveNetworkElementPre(INetworkElement element) Checks if the given network element can be removed from the networkbooleanremovePathElement(IPathElement pathElement, net.minecraft.core.Direction side) Remove the given path element from the network.voidrevalidateElement(INetworkElement element) Revalidate the given element.voidupdate()This network updating should be called each tick.voidThis guaranteed network updating should be called each tick, even in safe-mode.
-
Method Details
-
addNetworkElement
Add a given network element to the network Also checks if it can tick and will handle it accordingly.- Parameters:
element- The network element.networkPreinit- If the network is still in the process of being initialized.- Returns:
- If the addition succeeded.
-
removeNetworkElementPre
Checks if the given network element can be removed from the network- Parameters:
element- The network element.- Returns:
- If the element was can be removed from the network.
-
removeNetworkElementPost
Remove a given network element from the network. Also removed its tickable instance.- Parameters:
element- The network element.
-
kill
void kill()Terminate the network elements for this network. -
update
void update()This network updating should be called each tick. -
updateGuaranteed
void updateGuaranteed()This guaranteed network updating should be called each tick, even in safe-mode. -
removePathElement
Remove the given path element from the network. If the path element had any network elements registered in the network, these will be killed and removed as well.- Parameters:
pathElement- The path element.side- The side.- Returns:
- If the path element was removed.
-
afterServerLoad
void afterServerLoad()Called when the server loaded this network. This is the time to notify all network elements of this network. -
beforeServerStop
void beforeServerStop()Called when the server will save this network before stopping. This is the time to notify all network elements of this network. -
canUpdate
If the given element can update.- Parameters:
element- The network element.- Returns:
- If it can update.
-
postUpdate
Called after a network element's update was called.- Parameters:
element- The network element.
-
onSkipUpdate
When the given element is not being updated becausecanUpdate(INetworkElement)returned false.- Parameters:
element- The element that is not being updated.
-
invalidateElement
Invalidate the given element. Called when the element's chunk is being unloaded.- Parameters:
element- The network element to invalidate.
-
revalidateElement
Revalidate the given element. Called when the element's chunk is being reloaded.- Parameters:
element- The network element to invalidate.
-