Interface ADMediaHolder

All Known Implementing Classes:
DebugUnlockerHolder

public interface ADMediaHolder
  • Field Details

  • Method Details

    • getMedia

      @OverrideOnly long getMedia()
      Use withdrawMedia(-1, true)
      See Also:
    • getMaxMedia

      @OverrideOnly long getMaxMedia()
      Use withdrawMedia(-1, true) + insertMedia(-1, true) where possible
      See Also:
    • setMedia

      @OverrideOnly void setMedia(long media)
      Use insertMedia(media - withdrawMedia(-1, true), false) where possible
      See Also:
    • canRecharge

      boolean canRecharge()
      Whether this media holder can have media inserted into it.
    • canProvide

      boolean canProvide()
      Whether this media holder can be extracted from.
    • getConsumptionPriority

      int getConsumptionPriority()
      The priority for this media holder to be selected when casting a hex. Higher priorities are taken first.

      By default, * Charged Amethyst has priority 1000 * Amethyst Shards have priority 2000 * Amethyst Dust has priority 3000 * Items which hold media have priority 4000

    • canConstructBattery

      boolean canConstructBattery()
      Whether the media inside this media holder may be used to construct a battery.
    • withdrawMedia

      default long withdrawMedia(long cost, boolean simulate)
      Withdraws media from the holder. Returns the amount of media extracted, which may be less or more than the cost.

      Even if canProvide() is false, you can still withdraw media this way.

      Withdrawing a negative amount will act as though you attempted to withdraw as much media as the holder contains.

    • insertMedia

      default long insertMedia(long amount, boolean simulate)
      Inserts media into the holder. Returns the amount of media inserted, which may be less than the requested amount.

      Even if canRecharge() is false, you can still insert media this way.

      Inserting a negative amount will act as though you attempted to insert exactly as much media as the holder was missing.