Package com.wdiscute.artisan.upgrades
Record Class MachineSettings
java.lang.Object
java.lang.Record
com.wdiscute.artisan.upgrades.MachineSettings
public record MachineSettings(List<AbstractUpgrade> baseUpgrades, int upgradeSlots, boolean canUseRepeatedUpgrades)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MachineSettings> static final MachineSettings -
Constructor Summary
ConstructorsConstructorDescriptionMachineSettings(List<AbstractUpgrade> baseUpgrades, int upgradeSlots, boolean canUseRepeatedUpgrades) Creates an instance of aMachineSettingsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebaseUpgradesrecord component.booleanReturns the value of thecanUseRepeatedUpgradesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.intReturns the value of theupgradeSlotsrecord component.
-
Field Details
-
DEFAULT
-
CODEC
-
-
Constructor Details
-
MachineSettings
public MachineSettings(List<AbstractUpgrade> baseUpgrades, int upgradeSlots, boolean canUseRepeatedUpgrades) Creates an instance of aMachineSettingsrecord class.- Parameters:
baseUpgrades- the value for thebaseUpgradesrecord componentupgradeSlots- the value for theupgradeSlotsrecord componentcanUseRepeatedUpgrades- the value for thecanUseRepeatedUpgradesrecord component
-
-
Method Details
-
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 '=='. -
baseUpgrades
Returns the value of thebaseUpgradesrecord component.- Returns:
- the value of the
baseUpgradesrecord component
-
upgradeSlots
public int upgradeSlots()Returns the value of theupgradeSlotsrecord component.- Returns:
- the value of the
upgradeSlotsrecord component
-
canUseRepeatedUpgrades
public boolean canUseRepeatedUpgrades()Returns the value of thecanUseRepeatedUpgradesrecord component.- Returns:
- the value of the
canUseRepeatedUpgradesrecord component
-