Class ParticleSpawnerBuilder

java.lang.Object
at.minecraftschurli.mods.arsmagicalegacy.api.client.particle.ParticleSpawnerBuilder

public class ParticleSpawnerBuilder extends Object
  • 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 the ParticleSpawner being built.
      particle - The ParticleOptions to 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 the ParticleSpawner being built.
      particle - The ParticleOptions to 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

      public ParticleSpawnerBuilder offset(double x, double y, double z)
      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

      public ParticleSpawnerBuilder speed(double minX, double maxX, double y, double minZ, double maxZ)
      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

      public ParticleSpawnerBuilder speed(double x, double y, double z)
      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

      public ParticleSpawnerBuilder gravity(float gravity)
      Parameters:
      gravity - The gravity of the particles.
      Returns:
      This builder, for chaining.
    • scale

      public ParticleSpawnerBuilder scale(float scale)
      Parameters:
      scale - The scale of the particles.
      Returns:
      This builder, for chaining.
    • color

      public ParticleSpawnerBuilder color(int color)
      Parameters:
      color - The color of the particles.
      Returns:
      This builder, for chaining.
    • alpha

      public ParticleSpawnerBuilder alpha(float alpha)
      Parameters:
      alpha - The alpha of the particles.
      Returns:
      This builder, for chaining.
    • controller

      public ParticleSpawnerBuilder controller(ParticleController controller)
      Parameters:
      controller - The ParticleController to add.
      Returns:
      This builder, for chaining.
    • addCondition

      public ParticleSpawnerBuilder addCondition(net.neoforged.neoforge.common.conditions.ICondition condition)
      Parameters:
      condition - The ICondition to add.
      Returns:
      This builder, for chaining.
    • getConditions

      public List<net.neoforged.neoforge.common.conditions.ICondition> getConditions()
      Returns:
      All ICondition in the builder.
    • build

      public ParticleSpawner build()
      Returns:
      The built ParticleSpawner.