Record Class AnchorVisualConfig

java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig
Record Components:
texture - Optional Identifier pointing to a vertical sprite-sheet texture for billboard rendering.
modelId - Optional Identifier identifying a registered AnchorModelRenderer.
scale - The visual scale multiplier applied to the rendered quad and culling bounding box.
frameCount - The total number of vertical animation frames in the sprite sheet (minimum 1).
ticksPerFrame - The number of client ticks each animation frame is displayed before advancing (minimum 1).
tint - The 24-bit RGB hexadecimal color tint applied to the rendered sprite (defaults to 0xFFFFFF).

public record AnchorVisualConfig(Optional<net.minecraft.resources.Identifier> texture, Optional<net.minecraft.resources.Identifier> modelId, float scale, int frameCount, int ticksPerFrame, int tint) extends Record
Data-driven visual configuration record for a SpellFieldAnchorEntity.

Defines either a custom 3D model delegate (resolved via AnchorRendererRegistry) or a billboarded sprite animation rendered by SpellFieldAnchorRenderer.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<AnchorVisualConfig>
    Codec for serializing and deserializing AnchorVisualConfig instances from JSON or NBT.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AnchorVisualConfig(Optional<net.minecraft.resources.Identifier> texture, Optional<net.minecraft.resources.Identifier> modelId, float scale, int frameCount, int ticksPerFrame, int tint)
    Creates an instance of a AnchorVisualConfig record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the frameCount record component.
    final int
    Returns a hash code value for this object.
    Optional<net.minecraft.resources.Identifier>
    Returns the value of the modelId record component.
    float
    Returns the value of the scale record component.
    Optional<net.minecraft.resources.Identifier>
    Returns the value of the texture record component.
    int
    Returns the value of the ticksPerFrame record component.
    int
    Returns the value of the tint record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

  • Constructor Details

    • AnchorVisualConfig

      public AnchorVisualConfig(Optional<net.minecraft.resources.Identifier> texture, Optional<net.minecraft.resources.Identifier> modelId, float scale, int frameCount, int ticksPerFrame, int tint)
      Creates an instance of a AnchorVisualConfig record class.
      Parameters:
      texture - the value for the texture record component
      modelId - the value for the modelId record component
      scale - the value for the scale record component
      frameCount - the value for the frameCount record component
      ticksPerFrame - the value for the ticksPerFrame record component
      tint - the value for the tint 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 the compare method from their corresponding wrapper classes.
      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.
    • texture

      public Optional<net.minecraft.resources.Identifier> texture()
      Returns the value of the texture record component.
      Returns:
      the value of the texture record component
    • modelId

      public Optional<net.minecraft.resources.Identifier> modelId()
      Returns the value of the modelId record component.
      Returns:
      the value of the modelId record component
    • scale

      public float scale()
      Returns the value of the scale record component.
      Returns:
      the value of the scale record component
    • frameCount

      public int frameCount()
      Returns the value of the frameCount record component.
      Returns:
      the value of the frameCount record component
    • ticksPerFrame

      public int ticksPerFrame()
      Returns the value of the ticksPerFrame record component.
      Returns:
      the value of the ticksPerFrame record component
    • tint

      public int tint()
      Returns the value of the tint record component.
      Returns:
      the value of the tint record component