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, or 0 for 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

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<AiSpellField.AnchorPayload>
    The codec responsible for serializing and deserializing AiSpellField.AnchorPayload definitions from JSON.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnchorPayload(int duration, int tickRate, int activationDelay, int activePhase, int restPhase, Optional<johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig> visualConfig)
    Creates an instance of a AnchorPayload record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the value of the activationDelay record component.
    int
    Returns the value of the activePhase record component.
    int
    Returns the value of the duration record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the restPhase record component.
    int
    Returns the value of the tickRate record component.
    final String
    Returns a string representation of this record class.
    Optional<johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig>
    Returns the value of the visualConfig record component.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • 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 a AnchorPayload record class.
      Parameters:
      duration - the value for the duration record component
      tickRate - the value for the tickRate record component
      activationDelay - the value for the activationDelay record component
      activePhase - the value for the activePhase record component
      restPhase - the value for the restPhase record component
      visualConfig - the value for the visualConfig record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • duration

      public int duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • tickRate

      public int tickRate()
      Returns the value of the tickRate record component.
      Returns:
      the value of the tickRate record component
    • activationDelay

      public int activationDelay()
      Returns the value of the activationDelay record component.
      Returns:
      the value of the activationDelay record component
    • activePhase

      public int activePhase()
      Returns the value of the activePhase record component.
      Returns:
      the value of the activePhase record component
    • restPhase

      public int restPhase()
      Returns the value of the restPhase record component.
      Returns:
      the value of the restPhase record component
    • visualConfig

      public Optional<johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig> visualConfig()
      Returns the value of the visualConfig record component.
      Returns:
      the value of the visualConfig record component