Class CargoNet
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.network.Network
io.github.thebusybiscuit.slimefun4.core.networks.cargo.CargoNet
- All Implemented Interfaces:
HologramOwner,ItemAttribute
The
CargoNet is a type of Network which deals with ItemStack transportation.
It is also an extension of AbstractItemNetwork which provides methods to deal
with the addon ChestTerminal.- Author:
- meiamsome, Poslovitch, John000708, BigBadE, SoSeDiK, TheBusyBiscuit, Walshy, DNx5
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<org.bukkit.Location, org.bukkit.block.BlockFace> This is a cache for theBlockFacea node is facing, so we don't need to request theBlockDataeach time we visit a nodeprotected Map<org.bukkit.Location, io.github.thebusybiscuit.slimefun4.core.networks.cargo.ItemFilter> This is our cache for theItemFilterfor each node.Fields inherited from class io.github.thebusybiscuit.slimefun4.api.network.Network
connectedLocations, connectorNodes, regulator, regulatorNodes, terminusNodes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclassifyLocation(org.bukkit.Location l) This method assigns the givenLocationa type ofNetworkComponentfor classification.protected Optional<org.bukkit.block.Block> getAttachedBlock(org.bukkit.Location l) getId()Returns the identifier of the associatedSlimefunItem.protected io.github.thebusybiscuit.slimefun4.core.networks.cargo.ItemFiltergetItemFilter(org.bukkit.block.Block node) static CargoNetgetNetworkFromLocation(org.bukkit.Location l) static CargoNetgetNetworkFromLocationOrCreate(org.bukkit.Location l) intgetRange()This method returns the range of theNetwork.voidmarkCargoNodeConfigurationDirty(org.bukkit.Location node) This will mark theItemFilterof the given node dirty.voidmarkDirty(org.bukkit.Location l) This method marks the givenLocationas dirty and adds it to aQueueto handle this update.voidonClassificationChange(org.bukkit.Location l, NetworkComponent from, NetworkComponent to) This method is called whenever aLocationin thisNetworkchanges its classification.voidtick(org.bukkit.block.Block b, SlimefunBlockData blockData) Methods inherited from class io.github.thebusybiscuit.slimefun4.api.network.Network
addLocationToNetwork, connectsTo, display, getRegulator, getSize, tickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.HologramOwner
getHologramOffset, removeHologram, updateHologram, updateHologram
-
Field Details
-
roundRobin
-
connectorCache
This is a cache for theBlockFacea node is facing, so we don't need to request theBlockDataeach time we visit a node -
filterCache
protected Map<org.bukkit.Location,io.github.thebusybiscuit.slimefun4.core.networks.cargo.ItemFilter> filterCacheThis is our cache for theItemFilterfor each node.
-
-
Constructor Details
-
Method Details
-
getNetworkFromLocation
-
getNetworkFromLocationOrCreate
-
getId
Description copied from interface:ItemAttributeReturns the identifier of the associatedSlimefunItem.- Specified by:
getIdin interfaceItemAttribute- Returns:
- the identifier of the
SlimefunItem
-
getRange
public int getRange()Description copied from class:Network -
classifyLocation
Description copied from class:NetworkThis method assigns the givenLocationa type ofNetworkComponentfor classification.- Specified by:
classifyLocationin classNetwork- Parameters:
l- TheLocationto classify- Returns:
- The assigned type of
NetworkComponentfor thisLocation
-
onClassificationChange
public void onClassificationChange(org.bukkit.Location l, NetworkComponent from, NetworkComponent to) Description copied from class:NetworkThis method is called whenever aLocationin thisNetworkchanges its classification.- Specified by:
onClassificationChangein classNetwork- Parameters:
l- TheLocationthat is changing its classificationfrom- TheNetworkComponentthisLocationwas previously classified asto- TheNetworkComponentthisLocationis changing to
-
tick
-
getAttachedBlock
-
markDirty
public void markDirty(@Nonnull org.bukkit.Location l) Description copied from class:NetworkThis method marks the givenLocationas dirty and adds it to aQueueto handle this update. -
markCargoNodeConfigurationDirty
public void markCargoNodeConfigurationDirty(@Nonnull org.bukkit.Location node) This will mark theItemFilterof the given node dirty. It will also invalidate the cached rotation.- Parameters:
node- TheLocationof the cargo node
-
getItemFilter
@Nonnull protected io.github.thebusybiscuit.slimefun4.core.networks.cargo.ItemFilter getItemFilter(@Nonnull org.bukkit.block.Block node)
-