Package foundry.veil.api.quasar.data
Record Class QuasarParticleData
java.lang.Object
java.lang.Record
foundry.veil.api.quasar.data.QuasarParticleData
public record QuasarParticleData(boolean shouldCollide, boolean faceVelocity, float velocityStretchFactor, List<net.minecraft.core.Holder<ParticleModuleData>> initModules, List<net.minecraft.core.Holder<ParticleModuleData>> updateModules, List<net.minecraft.core.Holder<ParticleModuleData>> collisionModules, List<net.minecraft.core.Holder<ParticleModuleData>> forceModules, List<net.minecraft.core.Holder<ParticleModuleData>> renderModules, @Nullable SpriteData spriteData, boolean additive, RenderStyle renderStyle)
extends Record
Data passed to each particle when it is created.
This class is used to store all the data that is passed to each particle when it is created. This includes the particle settings, whether or not the particle should collide with blocks, whether or not the particle should face its velocity, and the list of sub emitters.
This class also stores the list of particle modules that are applied to each particle. These modules are used to modify the particle's behavior. The following are valid particle modules:
- Init Modules - Applied when a particle is created
- Update Modules - Applied at the beginning of the particle tick
- Collision Modules - Applied when the particle collides with a block or entity
- Force Modules - Applied each physics tick to update velocity
- Render Modules - Applied when the particle is rendered
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<net.minecraft.core.Holder<QuasarParticleData>> static final com.mojang.serialization.Codec<QuasarParticleData> -
Constructor Summary
ConstructorsConstructorDescriptionQuasarParticleData(boolean shouldCollide, boolean faceVelocity, float velocityStretchFactor, List<net.minecraft.core.Holder<ParticleModuleData>> initModules, List<net.minecraft.core.Holder<ParticleModuleData>> updateModules, List<net.minecraft.core.Holder<ParticleModuleData>> collisionModules, List<net.minecraft.core.Holder<ParticleModuleData>> forceModules, List<net.minecraft.core.Holder<ParticleModuleData>> renderModules, @Nullable SpriteData spriteData, boolean additive, RenderStyle renderStyle) Creates an instance of aQuasarParticleDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadditive()Returns the value of theadditiverecord component.List<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of thecollisionModulesrecord component.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thefaceVelocityrecord component.List<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of theforceModulesrecord component.List<net.minecraft.core.Holder<ParticleModuleData>> @Nullable net.minecraft.resources.ResourceLocationfinal inthashCode()Returns a hash code value for this object.List<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of theinitModulesrecord component.List<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of therenderModulesrecord component.Returns the value of therenderStylerecord component.booleanReturns the value of theshouldColliderecord component.@Nullable SpriteDataReturns the value of thespriteDatarecord component.final StringtoString()Returns a string representation of this record class.List<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of theupdateModulesrecord component.floatReturns the value of thevelocityStretchFactorrecord component.
-
Field Details
-
DIRECT_CODEC
-
CODEC
public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<QuasarParticleData>> CODEC
-
-
Constructor Details
-
QuasarParticleData
public QuasarParticleData(boolean shouldCollide, boolean faceVelocity, float velocityStretchFactor, List<net.minecraft.core.Holder<ParticleModuleData>> initModules, List<net.minecraft.core.Holder<ParticleModuleData>> updateModules, List<net.minecraft.core.Holder<ParticleModuleData>> collisionModules, List<net.minecraft.core.Holder<ParticleModuleData>> forceModules, List<net.minecraft.core.Holder<ParticleModuleData>> renderModules, @Nullable @Nullable SpriteData spriteData, boolean additive, RenderStyle renderStyle) Creates an instance of aQuasarParticleDatarecord class.- Parameters:
shouldCollide- the value for theshouldColliderecord componentfaceVelocity- the value for thefaceVelocityrecord componentvelocityStretchFactor- the value for thevelocityStretchFactorrecord componentinitModules- the value for theinitModulesrecord componentupdateModules- the value for theupdateModulesrecord componentcollisionModules- the value for thecollisionModulesrecord componentforceModules- the value for theforceModulesrecord componentrenderModules- the value for therenderModulesrecord componentspriteData- the value for thespriteDatarecord componentadditive- the value for theadditiverecord componentrenderStyle- the value for therenderStylerecord component
-
-
Method Details
-
getAllModules
- Returns:
- A list containing all modules in the particle
- Since:
- 1.3.0
-
getRegistryId
@Nullable public @Nullable net.minecraft.resources.ResourceLocation getRegistryId() -
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 '=='. -
shouldCollide
public boolean shouldCollide()Returns the value of theshouldColliderecord component.- Returns:
- the value of the
shouldColliderecord component
-
faceVelocity
public boolean faceVelocity()Returns the value of thefaceVelocityrecord component.- Returns:
- the value of the
faceVelocityrecord component
-
velocityStretchFactor
public float velocityStretchFactor()Returns the value of thevelocityStretchFactorrecord component.- Returns:
- the value of the
velocityStretchFactorrecord component
-
initModules
Returns the value of theinitModulesrecord component.- Returns:
- the value of the
initModulesrecord component
-
updateModules
Returns the value of theupdateModulesrecord component.- Returns:
- the value of the
updateModulesrecord component
-
collisionModules
Returns the value of thecollisionModulesrecord component.- Returns:
- the value of the
collisionModulesrecord component
-
forceModules
Returns the value of theforceModulesrecord component.- Returns:
- the value of the
forceModulesrecord component
-
renderModules
Returns the value of therenderModulesrecord component.- Returns:
- the value of the
renderModulesrecord component
-
spriteData
Returns the value of thespriteDatarecord component.- Returns:
- the value of the
spriteDatarecord component
-
additive
public boolean additive()Returns the value of theadditiverecord component.- Returns:
- the value of the
additiverecord component
-
renderStyle
Returns the value of therenderStylerecord component.- Returns:
- the value of the
renderStylerecord component
-