java.lang.Object
io.github.thebusybiscuit.slimefun4.api.network.Network
io.github.thebusybiscuit.slimefun4.core.networks.cargo.CargoNet
All Implemented Interfaces:
HologramOwner, ItemAttribute

public class CargoNet extends Network implements HologramOwner
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 Details

    • roundRobin

      protected final Map<org.bukkit.Location,Integer> roundRobin
    • connectorCache

      protected Map<org.bukkit.Location,org.bukkit.block.BlockFace> connectorCache
      This is a cache for the BlockFace a node is facing, so we don't need to request the BlockData each time we visit a node
    • filterCache

      protected Map<org.bukkit.Location,io.github.thebusybiscuit.slimefun4.core.networks.cargo.ItemFilter> filterCache
      This is our cache for the ItemFilter for each node.
  • Constructor Details

    • CargoNet

      protected CargoNet(@Nonnull org.bukkit.Location l)
      This constructs a new CargoNet at the given Location.
      Parameters:
      l - The Location marking the manager of this Network.
  • Method Details

    • getNetworkFromLocation

      @Nullable public static CargoNet getNetworkFromLocation(@Nonnull org.bukkit.Location l)
    • getNetworkFromLocationOrCreate

      @Nonnull public static CargoNet getNetworkFromLocationOrCreate(@Nonnull org.bukkit.Location l)
    • getId

      public String getId()
      Description copied from interface: ItemAttribute
      Returns the identifier of the associated SlimefunItem.
      Specified by:
      getId in interface ItemAttribute
      Returns:
      the identifier of the SlimefunItem
    • getRange

      public int getRange()
      Description copied from class: Network
      This method returns the range of the Network. The range determines how far the Network will search for nearby nodes from any given node. It basically translates to the maximum distance between nodes.
      Specified by:
      getRange in class Network
      Returns:
      the range of this Network
    • classifyLocation

      public NetworkComponent classifyLocation(@Nonnull org.bukkit.Location l)
      Description copied from class: Network
      This method assigns the given Location a type of NetworkComponent for classification.
      Specified by:
      classifyLocation in class Network
      Parameters:
      l - The Location to classify
      Returns:
      The assigned type of NetworkComponent for this Location
    • onClassificationChange

      public void onClassificationChange(org.bukkit.Location l, NetworkComponent from, NetworkComponent to)
      Description copied from class: Network
      This method is called whenever a Location in this Network changes its classification.
      Specified by:
      onClassificationChange in class Network
      Parameters:
      l - The Location that is changing its classification
      from - The NetworkComponent this Location was previously classified as
      to - The NetworkComponent this Location is changing to
    • tick

      public void tick(@Nonnull org.bukkit.block.Block b, SlimefunBlockData blockData)
    • getAttachedBlock

      protected Optional<org.bukkit.block.Block> getAttachedBlock(@Nonnull org.bukkit.Location l)
    • markDirty

      public void markDirty(@Nonnull org.bukkit.Location l)
      Description copied from class: Network
      This method marks the given Location as dirty and adds it to a Queue to handle this update.
      Overrides:
      markDirty in class Network
      Parameters:
      l - The Location to update
    • markCargoNodeConfigurationDirty

      public void markCargoNodeConfigurationDirty(@Nonnull org.bukkit.Location node)
      This will mark the ItemFilter of the given node dirty. It will also invalidate the cached rotation.
      Parameters:
      node - The Location of the cargo node
    • getItemFilter

      @Nonnull protected io.github.thebusybiscuit.slimefun4.core.networks.cargo.ItemFilter getItemFilter(@Nonnull org.bukkit.block.Block node)