Class ParticleEmitter

java.lang.Object
foundry.veil.api.quasar.particle.ParticleEmitter

public class ParticleEmitter extends Object
  • Method Details

    • clearErrors

      @Internal public static void clearErrors()
    • render

      @Internal public void render(MatrixStack matrixStack, net.minecraft.client.renderer.MultiBufferSource bufferSource, net.minecraft.client.Camera camera, float partialTicks)
    • addCodeModule

      public void addCodeModule(CodeModule module)

      Adds a custom module with user code that is added to all particles spawned after this is called.

      The module is not able to be serialized and does not affect the state of any other emitters.

      Parameters:
      module - The module to add
    • trim

      public int trim(int count)
      Attempts to remove the oldest specified number of particles.
      Parameters:
      count - The number of particles to attempt to remove
      Returns:
      The number of particles removed
    • remove

      public void remove()
      Marks this emitter to be removed next tick.
    • reset

      public void reset()
      Resets the emitter to its initial state
    • getRegistryName

      @Nullable public @Nullable net.minecraft.resources.ResourceLocation getRegistryName()
    • isRemoved

      public boolean isRemoved()
      Whether the emitter has completed its lifetime
    • getPosition

      public org.joml.Vector3d getPosition()
      Position of the emitter
    • getData

      public ParticleEmitterData getData()
    • getParticleCount

      public int getParticleCount()
    • getMaxLifetime

      public int getMaxLifetime()
    • isLoop

      public boolean isLoop()
    • getRate

      public int getRate()
    • getCount

      public int getCount()
    • getMaxParticles

      public int getMaxParticles()
    • getEmitterShapeSettings

      public List<EmitterShapeSettings> getEmitterShapeSettings()
    • getParticleSettings

      public ParticleSettings getParticleSettings()
    • isForceSpawn

      public boolean isForceSpawn()
    • getParticleData

      public QuasarParticleData getParticleData()
    • getAttachedEntity

      @Nullable public @Nullable net.minecraft.world.entity.Entity getAttachedEntity()
      Returns:
      The entity this emitter is attached to and will apply
    • setPosition

      @Deprecated public void setPosition(net.minecraft.world.phys.Vec3 position)
      Deprecated.
    • setPosition

      public void setPosition(org.joml.Vector3dc position)
      Sets the position of the emitter relative to the origin of the world or attached entity.
      Parameters:
      position - The position
    • setPosition

      public void setPosition(double x, double y, double z)
      Sets the position of the emitter relative to the origin of the world or attached entity.
      Parameters:
      x - The x position
      y - The y position
      z - The z position
    • setMaxLifetime

      public void setMaxLifetime(int maxLifetime)
    • setLoop

      public void setLoop(boolean loop)
    • setRate

      public void setRate(int rate)
    • setCount

      public void setCount(int count)
    • setMaxParticles

      public void setMaxParticles(int maxParticles)
    • setEmitterShapeSettings

      public void setEmitterShapeSettings(List<EmitterShapeSettings> emitterShapeSettings)
    • setParticleSettings

      public void setParticleSettings(ParticleSettings particleSettings)
    • setForceSpawn

      public void setForceSpawn(boolean forceSpawn)
    • setParticleData

      public void setParticleData(QuasarParticleData particleData)
    • setAttachedEntity

      public void setAttachedEntity(@Nullable @Nullable net.minecraft.world.entity.Entity entity)
      Sets the origin of the emitter position to match the specified entity. That means the value set by setPosition(double, double, double) will not be interpreted as an offset from the entity position.
      Parameters:
      entity - The entity to attach to