Interface CorporeaSpark

All Superinterfaces:
SparkEntity
All Known Implementing Classes:
CorporeaSparkEntity

public interface CorporeaSpark extends SparkEntity
An interface for a Corporea Spark. Includes functions for handling connections.
  • Method Details

    • introduceNearbyTo

      void introduceNearbyTo(Set<CorporeaSpark> network, CorporeaSpark master)
      Look around this spark for neighbors and introduce them to the network by adding them to network. If they weren't already in network, this method should then recursively call this method on all newcomers. This spark should then retain the network object internally for quick access to all members of the network.
    • getSparkNode

      CorporeaNode getSparkNode()
      Returns:
      Corporea node this spark is attached to, generally belonging to the block below it
    • getConnections

      Set<CorporeaSpark> getConnections()
      Returns:
      All sparks in the same logical corporea network as this one, including this spark itself.
    • getRelatives

      List<CorporeaSpark> getRelatives()
      Gets the list of sparks that this spark added to the list of connections during registerConnections(), this is mainly used to create a non messy chain of particles to display the network when a spark is right clicked with a wand.
    • getMaster

      @Nullable @Nullable CorporeaSpark getMaster()
      Returns:
      The master spark of the network this spark is part of. A master spark's master is itself. Returns null if this spark is not in a network with a valid master.
    • onItemExtracted

      void onItemExtracted(net.minecraft.world.item.ItemStack stack)
      Called when an item is extracted from the node this spark is attached to through this spark.
      Parameters:
      stack - The itemstack, before any extraction was done. Do not mutate this.
    • onItemsRequested

      void onItemsRequested(List<net.minecraft.world.item.ItemStack> stacks)
      Called when this spark requests items, passes in the result of the request and not the actual requested stack(s).
    • isMaster

      boolean isMaster()
      Gets if this spark is considered a master spark.
    • isCreative

      boolean isCreative()
      Gets if this spark is considered a creative spark.