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
-
Field Summary
Fields inherited from interface at.petrak.hexcasting.api.addldata.ADMediaHolder
AMETHYST_DUST_PRIORITY, AMETHYST_SHARD_PRIORITY, BATTERY_PRIORITY, CHARGED_AMETHYST_PRIORITY, QUENCHED_ALLAY_PRIORITY, QUENCHED_SHARD_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionDebugUnlockerHolder(net.minecraft.world.item.ItemStack creativeUnlocker) Creates an instance of aDebugUnlockerHolderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the media inside this media holder may be used to construct a battery.booleanWhether this media holder can be extracted from.booleanWhether this media holder can have media inserted into it.net.minecraft.world.item.ItemStackReturns the value of thecreativeUnlockerrecord component.final booleanIndicates whether some other object is "equal to" this one.intThe priority for this media holder to be selected when casting a hex.longUsewithdrawMedia(-1, true) + insertMedia(-1, true)where possiblelonggetMedia()UsewithdrawMedia(-1, true)final inthashCode()Returns a hash code value for this object.longinsertMedia(long amount, boolean simulate) Inserts media into the holder.voidsetMedia(long media) UseinsertMedia(media - withdrawMedia(-1, true), false)where possiblefinal StringtoString()Returns a string representation of this record class.longwithdrawMedia(long cost, boolean simulate) Withdraws media from the holder.
-
Constructor Details
-
DebugUnlockerHolder
public DebugUnlockerHolder(net.minecraft.world.item.ItemStack creativeUnlocker) Creates an instance of aDebugUnlockerHolderrecord class.- Parameters:
creativeUnlocker- the value for thecreativeUnlockerrecord component
-
-
Method Details
-
getMedia
public long getMedia()Description copied from interface:ADMediaHolderUsewithdrawMedia(-1, true)- Specified by:
getMediain interfaceADMediaHolder- See Also:
-
getMaxMedia
public long getMaxMedia()Description copied from interface:ADMediaHolderUsewithdrawMedia(-1, true) + insertMedia(-1, true)where possible- Specified by:
getMaxMediain interfaceADMediaHolder- See Also:
-
setMedia
public void setMedia(long media) Description copied from interface:ADMediaHolderUseinsertMedia(media - withdrawMedia(-1, true), false)where possible- Specified by:
setMediain interfaceADMediaHolder- See Also:
-
canRecharge
public boolean canRecharge()Description copied from interface:ADMediaHolderWhether this media holder can have media inserted into it.- Specified by:
canRechargein interfaceADMediaHolder
-
canProvide
public boolean canProvide()Description copied from interface:ADMediaHolderWhether this media holder can be extracted from.- Specified by:
canProvidein interfaceADMediaHolder
-
getConsumptionPriority
public int getConsumptionPriority()Description copied from interface:ADMediaHolderThe 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:
getConsumptionPriorityin interfaceADMediaHolder
-
canConstructBattery
public boolean canConstructBattery()Description copied from interface:ADMediaHolderWhether the media inside this media holder may be used to construct a battery.- Specified by:
canConstructBatteryin interfaceADMediaHolder
-
withdrawMedia
public long withdrawMedia(long cost, boolean simulate) Description copied from interface:ADMediaHolderWithdraws 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:
withdrawMediain interfaceADMediaHolder
-
insertMedia
public long insertMedia(long amount, boolean simulate) Description copied from interface:ADMediaHolderInserts 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:
insertMediain interfaceADMediaHolder
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
creativeUnlocker
public net.minecraft.world.item.ItemStack creativeUnlocker()Returns the value of thecreativeUnlockerrecord component.- Returns:
- the value of the
creativeUnlockerrecord component
-