Record Class AnchorVisualConfig
java.lang.Object
java.lang.Record
johnsmith.enchantmentcore.api.enchantment.spellfield.entity.AnchorVisualConfig
- Record Components:
texture- OptionalIdentifierpointing to a vertical sprite-sheet texture for billboard rendering.modelId- OptionalIdentifieridentifying a registeredAnchorModelRenderer.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 (minimum1).ticksPerFrame- The number of client ticks each animation frame is displayed before advancing (minimum1).tint- The 24-bit RGB hexadecimal color tint applied to the rendered sprite (defaults to0xFFFFFF).
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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AnchorVisualConfig> Codec for serializing and deserializingAnchorVisualConfiginstances from JSON or NBT. -
Constructor Summary
ConstructorsConstructorDescriptionAnchorVisualConfig(Optional<net.minecraft.resources.Identifier> texture, Optional<net.minecraft.resources.Identifier> modelId, float scale, int frameCount, int ticksPerFrame, int tint) Creates an instance of aAnchorVisualConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of theframeCountrecord component.final inthashCode()Returns a hash code value for this object.Optional<net.minecraft.resources.Identifier> modelId()Returns the value of themodelIdrecord component.floatscale()Returns the value of thescalerecord component.Optional<net.minecraft.resources.Identifier> texture()Returns the value of thetexturerecord component.intReturns the value of theticksPerFramerecord component.inttint()Returns the value of thetintrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
Codec for serializing and deserializingAnchorVisualConfiginstances from JSON or NBT.
-
-
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 aAnchorVisualConfigrecord class.- Parameters:
texture- the value for thetexturerecord componentmodelId- the value for themodelIdrecord componentscale- the value for thescalerecord componentframeCount- the value for theframeCountrecord componentticksPerFrame- the value for theticksPerFramerecord componenttint- the value for thetintrecord 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 '=='. -
texture
Returns the value of thetexturerecord component.- Returns:
- the value of the
texturerecord component
-
modelId
Returns the value of themodelIdrecord component.- Returns:
- the value of the
modelIdrecord component
-
scale
public float scale()Returns the value of thescalerecord component.- Returns:
- the value of the
scalerecord component
-
frameCount
public int frameCount()Returns the value of theframeCountrecord component.- Returns:
- the value of the
frameCountrecord component
-
ticksPerFrame
public int ticksPerFrame()Returns the value of theticksPerFramerecord component.- Returns:
- the value of the
ticksPerFramerecord component
-
tint
public int tint()Returns the value of thetintrecord component.- Returns:
- the value of the
tintrecord component
-