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 newNetworkManagerwith the given capacity.NetworkManager(int maxStepSize, boolean enableVisualizer, boolean deleteExcessItems) This creates a newNetworkManagerwith the given capacity. -
Method Summary
Modifier and TypeMethodDescriptionintThis method returns the limit of nodes aNetworkcan have.getNetworkFromLocation(org.bukkit.Location l, Class<T> type) getNetworksFromLocation(org.bukkit.Location l, Class<T> type) booleanThis returns whether excess items from aCargoNetshould be voided instead of being dropped to the ground.booleanThis returns whether theNetworkvisualizer is enabled.voidregisterNetwork(Network network) This registers a givenNetwork.voidunregisterNetwork(Network network) This removes aNetworkfrom the network system.voidupdateAllNetworks(org.bukkit.Location l) This method updates everyNetworkfound at the givenLocation.
-
Constructor Details
-
NetworkManager
public NetworkManager(int maxStepSize, boolean enableVisualizer, boolean deleteExcessItems) This creates a newNetworkManagerwith the given capacity. -
NetworkManager
public NetworkManager(int maxStepSize) This creates a newNetworkManagerwith the given capacity.- Parameters:
maxStepSize- The maximum amount of nodes aNetworkcan have
-
-
Method Details
-
getMaxSize
public int getMaxSize()This method returns the limit of nodes aNetworkcan have. This value is read from theConfigfile.- Returns:
- the maximum amount of nodes a
Networkcan have
-
isVisualizerEnabled
public boolean isVisualizerEnabled()This returns whether theNetworkvisualizer is enabled.- Returns:
- Whether the
Networkvisualizer is enabled
-
isItemDeletionEnabled
public boolean isItemDeletionEnabled()This returns whether excess items from aCargoNetshould 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- TheNetworkto register
-
unregisterNetwork
This removes aNetworkfrom the network system.- Parameters:
network- TheNetworkto remove
-
updateAllNetworks
public void updateAllNetworks(@Nonnull org.bukkit.Location l) This method updates everyNetworkfound at the givenLocation. More precisely,Network.markDirty(Location)will be called.- Parameters:
l- TheLocationto update
-