Interface SparkAttachable

All Known Implementing Classes:
ManaEnchanterBlockEntity, ManaPoolBlockEntity, TerrestrialAgglomerationPlateBlockEntity

public interface SparkAttachable
A block entity with this capability can have a mana spark attached to it. For the Spark to be allowed to have upgrades, the same block position must also have an ManaPool capability
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.ResourceLocation
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Return true if this Tile no longer requires mana and all Sparks transferring mana to it should cancel their transfer.
    default void
    Called when the Spark is attached.
    boolean
    canAttachSpark(net.minecraft.world.item.ItemStack stack)
    Can this block have a Spark attached to it.
    Gets the Spark that is attached to this block.
    int
    Returns how much space for mana is available in this block, normally the total - the current.
  • Field Details

    • ID

      static final net.minecraft.resources.ResourceLocation ID
  • Method Details

    • canAttachSpark

      boolean canAttachSpark(net.minecraft.world.item.ItemStack stack)
      Can this block have a Spark attached to it. Note that this will not unattach the Spark if it's changed later.
    • attachSpark

      default void attachSpark(ManaSpark entity)
      Called when the Spark is attached.
    • getAvailableSpaceForMana

      int getAvailableSpaceForMana()
      Returns how much space for mana is available in this block, normally the total - the current. Should NEVER return negative values. Make sure to check against that.
    • getAttachedSpark

      ManaSpark getAttachedSpark()
      Gets the Spark that is attached to this block. A common implementation is to check for Spark entities above using world.getEntitiesWithinAABB()
    • areIncomingTranfersDone

      boolean areIncomingTranfersDone()
      Return true if this Tile no longer requires mana and all Sparks transferring mana to it should cancel their transfer.