Class NetworkManager
java.lang.Object
io.github.thebusybiscuit.slimefun4.core.networks.NetworkManager
The
NetworkManager
is responsible for holding all instances of Network
and providing some utility methods that would have probably been static otherwise.- Author:
- TheBusyBiscuit, meiamsome
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkManager
(int maxStepSize) This creates a newNetworkManager
with the given capacity.NetworkManager
(int maxStepSize, boolean enableVisualizer, boolean deleteExcessItems) This creates a newNetworkManager
with the given capacity. -
Method Summary
Modifier and TypeMethodDescriptionint
This method returns the limit of nodes aNetwork
can have.getNetworkFromLocation
(Location l, Class<T> type) getNetworksFromLocation
(Location l, Class<T> type) boolean
This returns whether excess items from aCargoNet
should be voided instead of being dropped to the ground.boolean
This returns whether theNetwork
visualizer is enabled.void
registerNetwork
(Network network) This registers a givenNetwork
.void
unregisterNetwork
(Network network) This removes aNetwork
from the network system.void
-
Constructor Details
-
NetworkManager
public NetworkManager(int maxStepSize, boolean enableVisualizer, boolean deleteExcessItems) This creates a newNetworkManager
with the given capacity. -
NetworkManager
public NetworkManager(int maxStepSize) This creates a newNetworkManager
with the given capacity.- Parameters:
maxStepSize
- The maximum amount of nodes aNetwork
can have
-
-
Method Details
-
getMaxSize
public int getMaxSize()This method returns the limit of nodes aNetwork
can have. This value is read from theConfig
file.- Returns:
- the maximum amount of nodes a
Network
can have
-
isVisualizerEnabled
public boolean isVisualizerEnabled()This returns whether theNetwork
visualizer is enabled.- Returns:
- Whether the
Network
visualizer is enabled
-
isItemDeletionEnabled
public boolean isItemDeletionEnabled()This returns whether excess items from aCargoNet
should be voided instead of being dropped to the ground.- Returns:
- Whether to delete excess items
-
getNetworkList
-
getNetworkFromLocation
-
getNetworksFromLocation
-
registerNetwork
This registers a givenNetwork
.- Parameters:
network
- TheNetwork
to register
-
unregisterNetwork
This removes aNetwork
from the network system.- Parameters:
network
- TheNetwork
to remove
-
updateAllNetworks
This method updates everyNetwork
found at the givenLocation
. More precisely,Network.markDirty(Location)
will be called.- Parameters:
l
- TheLocation
to update
-