Record Class SpellPartData
java.lang.Object
java.lang.Record
at.minecraftschurli.mods.arsmagicalegacy.api.spell.SpellPartData
- Record Components:
mana- The mana cost of theSpellPart.burnout- The burnout cost of theSpellPart. If empty, will be calculated from the mana cost.affinityShifts- AMapofAffinitys to doubles, representing the affinity shifts when casting theSpellPart.recipe- AListofSpellIngredients required to craft theSpellPart.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<net.minecraft.core.Holder<SpellPartData>> static final SpellPartDatastatic final com.mojang.serialization.Codec<SpellPartData> -
Constructor Summary
ConstructorsConstructorDescriptionSpellPartData(double mana, Optional<Double> burnout, Map<net.minecraft.core.Holder<Affinity>, Double> affinityShifts, List<SpellIngredient> recipe) Creates an instance of aSpellPartDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaffinityShiftsrecord component.burnout()Returns the value of theburnoutrecord component.doublefinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublemana()Returns the value of themanarecord component.recipe()Returns the value of thereciperecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
-
DIRECT_CODEC
-
CODEC
-
-
Constructor Details
-
SpellPartData
public SpellPartData(double mana, Optional<Double> burnout, Map<net.minecraft.core.Holder<Affinity>, Double> affinityShifts, List<SpellIngredient> recipe) Creates an instance of aSpellPartDatarecord class.- Parameters:
mana- the value for themanarecord componentburnout- the value for theburnoutrecord componentaffinityShifts- the value for theaffinityShiftsrecord componentrecipe- the value for thereciperecord component
-
-
Method Details
-
burnoutOrGenerated
public double burnoutOrGenerated()- Returns:
- The burnout value. Will use
burnoutor, if that is empty, calculate the value frommana.
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
mana
-
burnout
-
affinityShifts
Returns the value of theaffinityShiftsrecord component.- Returns:
- the value of the
affinityShiftsrecord component
-
recipe
-