Class WorldParticles
java.lang.Object
net.ixdarklord.coolcatcanvas.api.client.vfx.WorldParticles
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidburst(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 voidclear()static intcount()How many particles are alive now.static voidline(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 voidspawn(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 voidspawn(ParticleSpec spec, net.minecraft.world.phys.Vec3 position, net.minecraft.world.phys.Vec3 velocity)
-
Field Details
-
MAX
public static final int MAX- See Also:
-
-
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 startspeed- 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()
-