Interface IGrid


public interface IGrid
Gives you access to Grid based information.

Don't Implement.

  • Method Details

    • getService

      <C extends IGridService> C getService(Class<C> iface)
      Get Access to various grid modules
      Parameters:
      iface - face
      Returns:
      the IGridCache you requested.
    • postEvent

      <T extends GridEvent> T postEvent(T ev)
      Post an event into the network event bus.
      Parameters:
      ev - - event to post
      Returns:
      returns ev back to original poster
    • getMachineClasses

      Iterable<Class<?>> getMachineClasses()
      get a list of the diversity of classes, you can use this to better detect which machines your interested in, rather then iterating the entire grid to test them.
      Returns:
      IReadOnlyCollection of all available host types (Of Type IGridHost).
    • getMachineNodes

      Iterable<IGridNode> getMachineNodes(Class<?> machineClass)
      Get machine nodes on the network.
      Parameters:
      machineClass - class of the machine associated with a grid node
      Returns:
      all nodes belonging to machines of specified class. keep in mind that machines can have multiple nodes.
    • getMachines

      <T> Set<T> getMachines(Class<T> machineClass)
      Get machines connected to the network via grid nodes.
      Parameters:
      machineClass - class of the machine associated with a grid node
      Returns:
      all unique machines of specified class. if a machine is connected to the grid with multiple nodes, this will only return the machine once.
    • getActiveMachines

      <T> Set<T> getActiveMachines(Class<T> machineClass)
      Get machines connected to the network via grid nodes that are powered and have their needed channels.
      Parameters:
      machineClass - class of the machine associated with a grid node
      Returns:
      all unique machines of specified class. if a machine is connected to the grid with multiple nodes, this will only return the machine once.
    • getNodes

      Iterable<IGridNode> getNodes()
      Returns:
      IReadOnlyCollection for all nodes on the network, node visitors are preferred.
    • isEmpty

      boolean isEmpty()
      Returns:
      true if the last node has been removed from the grid.
    • getPivot

      IGridNode getPivot()
      Returns:
      the node considered the pivot point of the grid.
    • size

      int size()
      Returns:
      The number of nodes in this grid.
    • getTickManager

      default ITickManager getTickManager()
      Get this grids ITickManager.
      See Also:
    • getStorageService

      default IStorageService getStorageService()
      Get this grids IStorageService.
      See Also:
    • getEnergyService

      default IEnergyService getEnergyService()
      Get this grids IEnergyService.
      See Also:
    • getCraftingService

      default ICraftingService getCraftingService()
      Get this grids ICraftingService.
      See Also:
    • getPathingService

      default IPathingService getPathingService()
      Get this grids IPathingService.
      See Also:
    • getSpatialService

      default ISpatialService getSpatialService()
      Get this grids ISpatialService.
      See Also:
    • export

      void export(com.google.gson.stream.JsonWriter jsonWriter) throws IOException
      Dump debug information about this grid to the given JSON writer.
      Throws:
      IOException