Class WorldParticles

java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.vfx.WorldParticles

public final class WorldParticles extends Object
Spawns effect particles (ParticleSpec) in the world the client is in. Call from the client thread: a client tick, a packet handler, or a VfxEffect.

 WorldParticles.spawn(EMBER, x, y, z, 0.0, 0.05, 0.0);
 WorldParticles.burst(EMBER, pos, 24, 0.2, 0.12);     // 24 of them, flying apart
 
Particles are dropped when the client leaves the world. At most MAX live at once; past that, new ones are not spawned.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    burst(ParticleSpec spec, net.minecraft.world.phys.Vec3 position, int count, double spread, double speed)
    Several particles around a point, each flying off in its own direction.
    static void
     
    static int
    How many particles are alive now.
    static void
    line(ParticleSpec spec, net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to, int count, double jitter)
    Particles strung along a line, each drifting a little: a beam's dust, a bolt's wake.
    static void
    spawn(ParticleSpec spec, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
    One particle at a position, moving by a velocity in blocks a tick.
    static void
    spawn(ParticleSpec spec, net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 velocity)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • spawn

      public static void spawn(ParticleSpec spec, double x, double y, double z, double velocityX, double velocityY, double velocityZ)
      One particle at a position, moving by a velocity in blocks a tick.
    • spawn

      public static void spawn(ParticleSpec spec, net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 velocity)
    • burst

      public static void burst(ParticleSpec spec, net.minecraft.world.phys.Vec3 position, int count, double spread, double speed)
      Several particles around a point, each flying off in its own direction.
      Parameters:
      spread - how far from the point, in blocks, they may start
      speed - the most they move, in blocks a tick; each gets a random share of it
    • line

      public static void line(ParticleSpec spec, net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to, int count, double jitter)
      Particles strung along a line, each drifting a little: a beam's dust, a bolt's wake.
      Parameters:
      jitter - the most each moves, in blocks a tick, in a random direction
    • count

      public static int count()
      How many particles are alive now.
    • clear

      public static void clear()