Class FullNetworkListenerAdapter
java.lang.Object
org.cyclops.integrateddynamics.api.network.FullNetworkListenerAdapter
- All Implemented Interfaces:
IFullNetworkListener
- Direct Known Subclasses:
PartNetwork
Default implementation of
IFullNetworkListener.-
Constructor Summary
Constructors -
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 becauseIFullNetworkListener.canUpdate(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.
-
Constructor Details
-
FullNetworkListenerAdapter
public FullNetworkListenerAdapter()
-
-
Method Details
-
addNetworkElement
Description copied from interface:IFullNetworkListenerAdd a given network element to the network Also checks if it can tick and will handle it accordingly.- Specified by:
addNetworkElementin interfaceIFullNetworkListener- Parameters:
element- The network element.networkPreinit- If the network is still in the process of being initialized.- Returns:
- If the addition succeeded.
-
removeNetworkElementPre
Description copied from interface:IFullNetworkListenerChecks if the given network element can be removed from the network- Specified by:
removeNetworkElementPrein interfaceIFullNetworkListener- Parameters:
element- The network element.- Returns:
- If the element was can be removed from the network.
-
removeNetworkElementPost
Description copied from interface:IFullNetworkListenerRemove a given network element from the network. Also removed its tickable instance.- Specified by:
removeNetworkElementPostin interfaceIFullNetworkListener- Parameters:
element- The network element.
-
kill
public void kill()Description copied from interface:IFullNetworkListenerTerminate the network elements for this network.- Specified by:
killin interfaceIFullNetworkListener
-
updateGuaranteed
public void updateGuaranteed()Description copied from interface:IFullNetworkListenerThis guaranteed network updating should be called each tick, even in safe-mode.- Specified by:
updateGuaranteedin interfaceIFullNetworkListener
-
update
public void update()Description copied from interface:IFullNetworkListenerThis network updating should be called each tick.- Specified by:
updatein interfaceIFullNetworkListener
-
removePathElement
Description copied from interface:IFullNetworkListenerRemove 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.- Specified by:
removePathElementin interfaceIFullNetworkListener- Parameters:
pathElement- The path element.side- The side.- Returns:
- If the path element was removed.
-
afterServerLoad
public void afterServerLoad()Description copied from interface:IFullNetworkListenerCalled when the server loaded this network. This is the time to notify all network elements of this network.- Specified by:
afterServerLoadin interfaceIFullNetworkListener
-
beforeServerStop
public void beforeServerStop()Description copied from interface:IFullNetworkListenerCalled when the server will save this network before stopping. This is the time to notify all network elements of this network.- Specified by:
beforeServerStopin interfaceIFullNetworkListener
-
canUpdate
Description copied from interface:IFullNetworkListenerIf the given element can update.- Specified by:
canUpdatein interfaceIFullNetworkListener- Parameters:
element- The network element.- Returns:
- If it can update.
-
postUpdate
Description copied from interface:IFullNetworkListenerCalled after a network element's update was called.- Specified by:
postUpdatein interfaceIFullNetworkListener- Parameters:
element- The network element.
-
onSkipUpdate
Description copied from interface:IFullNetworkListenerWhen the given element is not being updated becauseIFullNetworkListener.canUpdate(INetworkElement)returned false.- Specified by:
onSkipUpdatein interfaceIFullNetworkListener- Parameters:
element- The element that is not being updated.
-
invalidateElement
Description copied from interface:IFullNetworkListenerInvalidate the given element. Called when the element's chunk is being unloaded.- Specified by:
invalidateElementin interfaceIFullNetworkListener- Parameters:
element- The network element to invalidate.
-
revalidateElement
Description copied from interface:IFullNetworkListenerRevalidate the given element. Called when the element's chunk is being reloaded.- Specified by:
revalidateElementin interfaceIFullNetworkListener- Parameters:
element- The network element to invalidate.
-