Record Class AiSpellField.AnchorPayload
java.lang.Object
java.lang.Record
johnsmith.enchantingoverhauled.api.enchantment.spellfield.AiSpellField.AnchorPayload
- Record Components:
duration- Total lifetime of the anchor in ticks (default:100).tickRate- Interval in ticks between spell field applications (default:1).activationDelay- Initial delay in ticks before the anchor begins applying effects (default:0).activePhase- Duration in ticks of each active pulsing phase, or0for continuous (default:0).restPhase- Duration in ticks of each dormant phase between active phases (default:0).visualConfig- Optional visual configuration for rendering the anchor entity.
- Enclosing class:
AiSpellField
public static record AiSpellField.AnchorPayload(int duration, int tickRate, int activationDelay, int activePhase, int restPhase, Optional<johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig> visualConfig)
extends Record
Configuration record defining the lifecycle and visual parameters for a persistent
SpellFieldAnchorEntity deployed by an AiSpellField.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AiSpellField.AnchorPayload> The codec responsible for serializing and deserializingAiSpellField.AnchorPayloaddefinitions from JSON. -
Constructor Summary
ConstructorsConstructorDescriptionAnchorPayload(int duration, int tickRate, int activationDelay, int activePhase, int restPhase, Optional<johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig> visualConfig) Creates an instance of aAnchorPayloadrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theactivationDelayrecord component.intReturns the value of theactivePhaserecord component.intduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of therestPhaserecord component.inttickRate()Returns the value of thetickRaterecord component.final StringtoString()Returns a string representation of this record class.Optional<johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig> Returns the value of thevisualConfigrecord component.
-
Field Details
-
CODEC
The codec responsible for serializing and deserializingAiSpellField.AnchorPayloaddefinitions from JSON.
-
-
Constructor Details
-
AnchorPayload
public AnchorPayload(int duration, int tickRate, int activationDelay, int activePhase, int restPhase, Optional<johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig> visualConfig) Creates an instance of aAnchorPayloadrecord class.- Parameters:
duration- the value for thedurationrecord componenttickRate- the value for thetickRaterecord componentactivationDelay- the value for theactivationDelayrecord componentactivePhase- the value for theactivePhaserecord componentrestPhase- the value for therestPhaserecord componentvisualConfig- the value for thevisualConfigrecord 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 '=='. -
duration
public int duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-
tickRate
public int tickRate()Returns the value of thetickRaterecord component.- Returns:
- the value of the
tickRaterecord component
-
activationDelay
public int activationDelay()Returns the value of theactivationDelayrecord component.- Returns:
- the value of the
activationDelayrecord component
-
activePhase
public int activePhase()Returns the value of theactivePhaserecord component.- Returns:
- the value of the
activePhaserecord component
-
restPhase
public int restPhase()Returns the value of therestPhaserecord component.- Returns:
- the value of the
restPhaserecord component
-
visualConfig
public Optional<johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig> visualConfig()Returns the value of thevisualConfigrecord component.- Returns:
- the value of the
visualConfigrecord component
-