Class ParticleSpawnerBuilder
java.lang.Object
at.minecraftschurli.mods.arsmagicalegacy.api.client.particle.ParticleSpawnerBuilder
Builder class for
ParticleSpawner, for use in ParticleSpawnerProvider. Get an instance via ParticleSpawnerProvider.builder(Identifier, ParticleOptions, int, int).-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionParticleSpawnerBuilder(net.minecraft.resources.Identifier id, net.minecraft.core.particles.ParticleOptions particle, int count, int lifetime) ParticleSpawnerBuilder(net.minecraft.resources.Identifier id, net.minecraft.core.particles.ParticleOptions particle, int count, int minLifetime, int maxLifetime) -
Method Summary
Modifier and TypeMethodDescriptionaddCondition(net.neoforged.neoforge.common.conditions.ICondition condition) alpha(float alpha) build()color(int color) controller(ParticleController controller) List<net.neoforged.neoforge.common.conditions.ICondition> gravity(float gravity) offset(double x, double y, double z) Sets the offset of the particles.offset(double minX, double maxX, double minY, double maxY, double minZ, double maxZ) Sets the offset of the particles.scale(float scale) speed(double x, double y, double z) Sets the speed of the particles.speed(double minX, double maxX, double y, double minZ, double maxZ) Sets the speed of the particles.speed(double minX, double maxX, double minY, double maxY, double minZ, double maxZ) Sets the speed of the particles.
-
Field Details
-
id
public final net.minecraft.resources.Identifier id
-
-
Constructor Details
-
ParticleSpawnerBuilder
public ParticleSpawnerBuilder(net.minecraft.resources.Identifier id, net.minecraft.core.particles.ParticleOptions particle, int count, int minLifetime, int maxLifetime) - Parameters:
id- The id of theParticleSpawnerbeing built.particle- TheParticleOptionsto use.count- The amount of particles to spawn.minLifetime- The min lifetime of the particles.maxLifetime- The max lifetime of the particles.
-
ParticleSpawnerBuilder
public ParticleSpawnerBuilder(net.minecraft.resources.Identifier id, net.minecraft.core.particles.ParticleOptions particle, int count, int lifetime) - Parameters:
id- The id of theParticleSpawnerbeing built.particle- TheParticleOptionsto use.count- The amount of particles to spawn.lifetime- The lifetime of the particles.
-
-
Method Details
-
offset
public ParticleSpawnerBuilder offset(double minX, double maxX, double minY, double maxY, double minZ, double maxZ) Sets the offset of the particles. Particles will be randomly offset between (minX, minY, minZ) and (maxX, maxY, maxZ).- Parameters:
minX- The min x offset.maxX- The max x offset.minY- The min y offset.maxY- The max y offset.minZ- The min z offset.maxZ- The max z offset.- Returns:
- This builder, for chaining.
-
offset
Sets the offset of the particles.- Parameters:
x- The x offset.y- The y offset.z- The z offset.- Returns:
- This builder, for chaining.
-
speed
public ParticleSpawnerBuilder speed(double minX, double maxX, double minY, double maxY, double minZ, double maxZ) Sets the speed of the particles. Particles will be randomly given a speed between (minX, minY, minZ) and (maxX, maxY, maxZ).- Parameters:
minX- The min x speed.maxX- The max x speed.minY- The min y speed.maxY- The max y speed.minZ- The min z speed.maxZ- The max z speed.- Returns:
- This builder, for chaining.
-
speed
Sets the speed of the particles. Particles will be randomly given a speed between (minX, y, minZ) and (maxX, y, maxZ).- Parameters:
minX- The min x speed.maxX- The max x speed.y- The y speed.minZ- The min z speed.maxZ- The max z speed.- Returns:
- This builder, for chaining.
-
speed
Sets the speed of the particles.- Parameters:
x- The x speed.y- The y speed.z- The z speed.- Returns:
- This builder, for chaining.
-
gravity
- Parameters:
gravity- The gravity of the particles.- Returns:
- This builder, for chaining.
-
scale
- Parameters:
scale- The scale of the particles.- Returns:
- This builder, for chaining.
-
color
- Parameters:
color- The color of the particles.- Returns:
- This builder, for chaining.
-
alpha
- Parameters:
alpha- The alpha of the particles.- Returns:
- This builder, for chaining.
-
controller
- Parameters:
controller- TheParticleControllerto add.- Returns:
- This builder, for chaining.
-
addCondition
public ParticleSpawnerBuilder addCondition(net.neoforged.neoforge.common.conditions.ICondition condition) - Parameters:
condition- TheIConditionto add.- Returns:
- This builder, for chaining.
-
getConditions
- Returns:
- All
IConditionin the builder.
-
build
- Returns:
- The built
ParticleSpawner.
-