Package foundry.veil.api.quasar.particle
Class ParticleEmitter
java.lang.Object
foundry.veil.api.quasar.particle.ParticleEmitter
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCodeModule
(CodeModule module) Adds a custom module with user code that is added to all particles spawned after this is called.static void
@Nullable net.minecraft.world.entity.Entity
int
getCount()
getData()
int
int
int
org.joml.Vector3d
Position of the emitterint
getRate()
@Nullable net.minecraft.resources.ResourceLocation
boolean
boolean
isLoop()
boolean
Whether the emitter has completed its lifetimevoid
remove()
Marks this emitter to be removed next tick.void
render
(MatrixStack matrixStack, net.minecraft.client.renderer.MultiBufferSource bufferSource, net.minecraft.client.Camera camera, float partialTicks) void
reset()
Resets the emitter to its initial statevoid
setAttachedEntity
(@Nullable net.minecraft.world.entity.Entity entity) Sets the origin of the emitter position to match the specified entity.void
setCount
(int count) void
setEmitterShapeSettings
(List<EmitterShapeSettings> emitterShapeSettings) void
setForceSpawn
(boolean forceSpawn) void
setLoop
(boolean loop) void
setMaxLifetime
(int maxLifetime) void
setMaxParticles
(int maxParticles) void
setParticleData
(QuasarParticleData particleData) void
setParticleSettings
(ParticleSettings particleSettings) void
setPosition
(double x, double y, double z) Sets the position of the emitter relative to the origin of the world or attached entity.void
setPosition
(net.minecraft.world.phys.Vec3 position) Deprecated.void
setPosition
(org.joml.Vector3dc position) Sets the position of the emitter relative to the origin of the world or attached entity.void
setRate
(int rate) int
trim
(int count) Attempts to remove the oldest specified number of particles.
-
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
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
-
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
-
getParticleSettings
-
isForceSpawn
public boolean isForceSpawn() -
getParticleData
-
getAttachedEntity
@Nullable public @Nullable net.minecraft.world.entity.Entity getAttachedEntity()- Returns:
- The entity this emitter is attached to and will apply
-
setPosition
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 positiony
- The y positionz
- 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
-
setParticleSettings
-
setForceSpawn
public void setForceSpawn(boolean forceSpawn) -
setParticleData
-
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 bysetPosition(double, double, double)
will not be interpreted as an offset from the entity position.- Parameters:
entity
- The entity to attach to
-