Record Class CapStaticMediaHolder
java.lang.Object
java.lang.Record
at.petrak.hexcasting.forge.cap.adimpl.CapStaticMediaHolder
- All Implemented Interfaces:
at.petrak.hexcasting.api.addldata.ADMediaHolder
public record CapStaticMediaHolder(Supplier<Long> baseWorth, int consumptionPriority, net.minecraft.world.item.ItemStack stack)
extends Record
implements at.petrak.hexcasting.api.addldata.ADMediaHolder
Things that always hold a constant amount of media, like amethyst
-
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
ConstructorsConstructorDescriptionCapStaticMediaHolder(Supplier<Long> baseWorth, int consumptionPriority, net.minecraft.world.item.ItemStack stack) Creates an instance of aCapStaticMediaHolderrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebaseWorthrecord component.booleanbooleanbooleanintReturns the value of theconsumptionPriorityrecord component.final booleanIndicates whether some other object is "equal to" this one.intlonglonggetMedia()final inthashCode()Returns a hash code value for this object.voidsetMedia(long media) net.minecraft.world.item.ItemStackstack()Returns the value of thestackrecord component.final StringtoString()Returns a string representation of this record class.longwithdrawMedia(long cost, boolean simulate) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface at.petrak.hexcasting.api.addldata.ADMediaHolder
insertMedia
-
Constructor Details
-
CapStaticMediaHolder
public CapStaticMediaHolder(Supplier<Long> baseWorth, int consumptionPriority, net.minecraft.world.item.ItemStack stack) Creates an instance of aCapStaticMediaHolderrecord class.- Parameters:
baseWorth- the value for thebaseWorthrecord componentconsumptionPriority- the value for theconsumptionPriorityrecord componentstack- the value for thestackrecord component
-
-
Method Details
-
getMedia
public long getMedia()- Specified by:
getMediain interfaceat.petrak.hexcasting.api.addldata.ADMediaHolder
-
getMaxMedia
public long getMaxMedia()- Specified by:
getMaxMediain interfaceat.petrak.hexcasting.api.addldata.ADMediaHolder
-
setMedia
public void setMedia(long media) - Specified by:
setMediain interfaceat.petrak.hexcasting.api.addldata.ADMediaHolder
-
canRecharge
public boolean canRecharge()- Specified by:
canRechargein interfaceat.petrak.hexcasting.api.addldata.ADMediaHolder
-
canProvide
public boolean canProvide()- Specified by:
canProvidein interfaceat.petrak.hexcasting.api.addldata.ADMediaHolder
-
getConsumptionPriority
public int getConsumptionPriority()- Specified by:
getConsumptionPriorityin interfaceat.petrak.hexcasting.api.addldata.ADMediaHolder
-
canConstructBattery
public boolean canConstructBattery()- Specified by:
canConstructBatteryin interfaceat.petrak.hexcasting.api.addldata.ADMediaHolder
-
withdrawMedia
public long withdrawMedia(long cost, boolean simulate) - Specified by:
withdrawMediain interfaceat.petrak.hexcasting.api.addldata.ADMediaHolder
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
baseWorth
Returns the value of thebaseWorthrecord component.- Returns:
- the value of the
baseWorthrecord component
-
consumptionPriority
public int consumptionPriority()Returns the value of theconsumptionPriorityrecord component.- Returns:
- the value of the
consumptionPriorityrecord component
-
stack
public net.minecraft.world.item.ItemStack stack()Returns the value of thestackrecord component.- Returns:
- the value of the
stackrecord component
-