Record Class DebugUnlockerHolder

java.lang.Object
java.lang.Record
at.petrak.hexcasting.common.items.magic.DebugUnlockerHolder
All Implemented Interfaces:
ADMediaHolder

public record DebugUnlockerHolder(net.minecraft.world.item.ItemStack creativeUnlocker) extends Record implements ADMediaHolder
  • Constructor Details

    • DebugUnlockerHolder

      public DebugUnlockerHolder(net.minecraft.world.item.ItemStack creativeUnlocker)
      Creates an instance of a DebugUnlockerHolder record class.
      Parameters:
      creativeUnlocker - the value for the creativeUnlocker record component
  • Method Details

    • getMedia

      public long getMedia()
      Description copied from interface: ADMediaHolder
      Use withdrawMedia(-1, true)
      Specified by:
      getMedia in interface ADMediaHolder
      See Also:
    • getMaxMedia

      public long getMaxMedia()
      Description copied from interface: ADMediaHolder
      Use withdrawMedia(-1, true) + insertMedia(-1, true) where possible
      Specified by:
      getMaxMedia in interface ADMediaHolder
      See Also:
    • setMedia

      public void setMedia(long media)
      Description copied from interface: ADMediaHolder
      Use insertMedia(media - withdrawMedia(-1, true), false) where possible
      Specified by:
      setMedia in interface ADMediaHolder
      See Also:
    • canRecharge

      public boolean canRecharge()
      Description copied from interface: ADMediaHolder
      Whether this media holder can have media inserted into it.
      Specified by:
      canRecharge in interface ADMediaHolder
    • canProvide

      public boolean canProvide()
      Description copied from interface: ADMediaHolder
      Whether this media holder can be extracted from.
      Specified by:
      canProvide in interface ADMediaHolder
    • getConsumptionPriority

      public int getConsumptionPriority()
      Description copied from interface: ADMediaHolder
      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

      Specified by:
      getConsumptionPriority in interface ADMediaHolder
    • canConstructBattery

      public boolean canConstructBattery()
      Description copied from interface: ADMediaHolder
      Whether the media inside this media holder may be used to construct a battery.
      Specified by:
      canConstructBattery in interface ADMediaHolder
    • withdrawMedia

      public long withdrawMedia(long cost, boolean simulate)
      Description copied from interface: ADMediaHolder
      Withdraws media from the holder. Returns the amount of media extracted, which may be less or more than the cost.

      Even if ADMediaHolder.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.

      Specified by:
      withdrawMedia in interface ADMediaHolder
    • insertMedia

      public long insertMedia(long amount, boolean simulate)
      Description copied from interface: ADMediaHolder
      Inserts media into the holder. Returns the amount of media inserted, which may be less than the requested amount.

      Even if ADMediaHolder.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.

      Specified by:
      insertMedia in interface ADMediaHolder
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • creativeUnlocker

      public net.minecraft.world.item.ItemStack creativeUnlocker()
      Returns the value of the creativeUnlocker record component.
      Returns:
      the value of the creativeUnlocker record component