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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<net.minecraft.core.Holder<QuasarParticleData>> static final com.mojang.serialization.Codec
<QuasarParticleData> -
Constructor Summary
ConstructorDescriptionQuasarParticleData
(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 aQuasarParticleData
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
additive()
Returns the value of theadditive
record component.Stream
<net.minecraft.core.Holder<ParticleModuleData>> List
<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of thecollisionModules
record component.final boolean
Indicates whether some other object is "equal to" this one.boolean
Returns the value of thefaceVelocity
record component.List
<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of theforceModules
record component.@Nullable net.minecraft.resources.ResourceLocation
final int
hashCode()
Returns a hash code value for this object.List
<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of theinitModules
record component.List
<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of therenderModules
record component.Returns the value of therenderStyle
record component.boolean
Returns the value of theshouldCollide
record component.@Nullable SpriteData
Returns the value of thespriteData
record component.final String
toString()
Returns a string representation of this record class.List
<net.minecraft.core.Holder<ParticleModuleData>> Returns the value of theupdateModules
record component.float
Returns the value of thevelocityStretchFactor
record 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 aQuasarParticleData
record class.- Parameters:
shouldCollide
- the value for theshouldCollide
record componentfaceVelocity
- the value for thefaceVelocity
record componentvelocityStretchFactor
- the value for thevelocityStretchFactor
record componentinitModules
- the value for theinitModules
record componentupdateModules
- the value for theupdateModules
record componentcollisionModules
- the value for thecollisionModules
record componentforceModules
- the value for theforceModules
record componentrenderModules
- the value for therenderModules
record componentspriteData
- the value for thespriteData
record componentadditive
- the value for theadditive
record componentrenderStyle
- the value for therenderStyle
record component
-
-
Method Details
-
allModules
- Returns:
- A stream containing all modules in the particle.
-
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 theshouldCollide
record component.- Returns:
- the value of the
shouldCollide
record component
-
faceVelocity
public boolean faceVelocity()Returns the value of thefaceVelocity
record component.- Returns:
- the value of the
faceVelocity
record component
-
velocityStretchFactor
public float velocityStretchFactor()Returns the value of thevelocityStretchFactor
record component.- Returns:
- the value of the
velocityStretchFactor
record component
-
initModules
Returns the value of theinitModules
record component.- Returns:
- the value of the
initModules
record component
-
updateModules
Returns the value of theupdateModules
record component.- Returns:
- the value of the
updateModules
record component
-
collisionModules
Returns the value of thecollisionModules
record component.- Returns:
- the value of the
collisionModules
record component
-
forceModules
Returns the value of theforceModules
record component.- Returns:
- the value of the
forceModules
record component
-
renderModules
Returns the value of therenderModules
record component.- Returns:
- the value of the
renderModules
record component
-
spriteData
Returns the value of thespriteData
record component.- Returns:
- the value of the
spriteData
record component
-
additive
public boolean additive()Returns the value of theadditive
record component.- Returns:
- the value of the
additive
record component
-
renderStyle
Returns the value of therenderStyle
record component.- Returns:
- the value of the
renderStyle
record component
-