Package foundry.veil.api.quasar.particle
Record Class SpriteData
java.lang.Object
java.lang.Record
foundry.veil.api.quasar.particle.SpriteData
public record SpriteData(net.minecraft.resources.ResourceLocation sprite, int frameCount, float frameTime, int frameWidth, int frameHeight, boolean stretchToLifetime)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSpriteData(net.minecraft.resources.ResourceLocation sprite, int frameCount, float frameTime, int frameWidth, int frameHeight, boolean stretchToLifetime) Creates an instance of aSpriteDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of theframeCountrecord component.intReturns the value of theframeHeightrecord component.floatReturns the value of theframeTimerecord component.intReturns the value of theframeWidthrecord component.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationsprite()Returns the value of thespriterecord component.booleanReturns the value of thestretchToLifetimerecord component.final StringtoString()Returns a string representation of this record class.floatu(float renderAge, float agePercent, float u) org.joml.Vector4fuv(float renderAge, float agePercent, org.joml.Vector4f store) Calculates the UV x, y, width, and height.floatv(float renderAge, float agePercent, float v)
-
Field Details
-
CODEC
-
-
Constructor Details
-
SpriteData
public SpriteData(net.minecraft.resources.ResourceLocation sprite, int frameCount, float frameTime, int frameWidth, int frameHeight, boolean stretchToLifetime) Creates an instance of aSpriteDatarecord class.- Parameters:
sprite- the value for thespriterecord componentframeCount- the value for theframeCountrecord componentframeTime- the value for theframeTimerecord componentframeWidth- the value for theframeWidthrecord componentframeHeight- the value for theframeHeightrecord componentstretchToLifetime- the value for thestretchToLifetimerecord component
-
-
Method Details
-
uv
public org.joml.Vector4f uv(float renderAge, float agePercent, org.joml.Vector4f store) Calculates the UV x, y, width, and height.- Parameters:
renderAge- The age of the particle in ticksagePercent- The percentage age from 0 to 1store- The vector to store into- Since:
- 1.3.0
-
u
public float u(float renderAge, float agePercent, float u) -
v
public float v(float renderAge, float agePercent, float v) -
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 '=='. -
sprite
public net.minecraft.resources.ResourceLocation sprite()Returns the value of thespriterecord component.- Returns:
- the value of the
spriterecord component
-
frameCount
public int frameCount()Returns the value of theframeCountrecord component.- Returns:
- the value of the
frameCountrecord component
-
frameTime
public float frameTime()Returns the value of theframeTimerecord component.- Returns:
- the value of the
frameTimerecord component
-
frameWidth
public int frameWidth()Returns the value of theframeWidthrecord component.- Returns:
- the value of the
frameWidthrecord component
-
frameHeight
public int frameHeight()Returns the value of theframeHeightrecord component.- Returns:
- the value of the
frameHeightrecord component
-
stretchToLifetime
public boolean stretchToLifetime()Returns the value of thestretchToLifetimerecord component.- Returns:
- the value of the
stretchToLifetimerecord component
-