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 Details

    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<QuasarParticleData> 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 a QuasarParticleData record class.
      Parameters:
      shouldCollide - the value for the shouldCollide record component
      faceVelocity - the value for the faceVelocity record component
      velocityStretchFactor - the value for the velocityStretchFactor record component
      initModules - the value for the initModules record component
      updateModules - the value for the updateModules record component
      collisionModules - the value for the collisionModules record component
      forceModules - the value for the forceModules record component
      renderModules - the value for the renderModules record component
      spriteData - the value for the spriteData record component
      additive - the value for the additive record component
      renderStyle - the value for the renderStyle record component
  • Method Details

    • allModules

      public Stream<net.minecraft.core.Holder<ParticleModuleData>> allModules()
      Returns:
      A stream containing all modules in the particle.
    • getRegistryId

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation getRegistryId()
    • 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 '=='.
      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.
    • shouldCollide

      public boolean shouldCollide()
      Returns the value of the shouldCollide record component.
      Returns:
      the value of the shouldCollide record component
    • faceVelocity

      public boolean faceVelocity()
      Returns the value of the faceVelocity record component.
      Returns:
      the value of the faceVelocity record component
    • velocityStretchFactor

      public float velocityStretchFactor()
      Returns the value of the velocityStretchFactor record component.
      Returns:
      the value of the velocityStretchFactor record component
    • initModules

      public List<net.minecraft.core.Holder<ParticleModuleData>> initModules()
      Returns the value of the initModules record component.
      Returns:
      the value of the initModules record component
    • updateModules

      public List<net.minecraft.core.Holder<ParticleModuleData>> updateModules()
      Returns the value of the updateModules record component.
      Returns:
      the value of the updateModules record component
    • collisionModules

      public List<net.minecraft.core.Holder<ParticleModuleData>> collisionModules()
      Returns the value of the collisionModules record component.
      Returns:
      the value of the collisionModules record component
    • forceModules

      public List<net.minecraft.core.Holder<ParticleModuleData>> forceModules()
      Returns the value of the forceModules record component.
      Returns:
      the value of the forceModules record component
    • renderModules

      public List<net.minecraft.core.Holder<ParticleModuleData>> renderModules()
      Returns the value of the renderModules record component.
      Returns:
      the value of the renderModules record component
    • spriteData

      @Nullable public @Nullable SpriteData spriteData()
      Returns the value of the spriteData record component.
      Returns:
      the value of the spriteData record component
    • additive

      public boolean additive()
      Returns the value of the additive record component.
      Returns:
      the value of the additive record component
    • renderStyle

      public RenderStyle renderStyle()
      Returns the value of the renderStyle record component.
      Returns:
      the value of the renderStyle record component