TotemParticle .java

net.minecraft.client.particle.TotemParticle (class, 52 lines): members: za, Provider. imports: SimpleParticleType, ClientLevel, RandomSource.

net.minecraft.client.particleclass52 linesclientextends SimpleAnimatedParticle1.6 KB

API Surface (1)

Particle createParticle(final SimpleParticleType options, final ClientLevel level, final double x, final double y, final double z, final double xAux, final double yAux, final double zAux, final RandomSource random)

Fields & Constants (1)

za

Full Source

TotemParticle.java52 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.particle;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
import net.minecraft.client.multiplayer.ClientLevel;
6
import net.minecraft.core.particles.SimpleParticleType;
7
import net.minecraft.util.RandomSource;
8
9
@Environment(EnvType.CLIENT)
10
public class TotemParticle extends SimpleAnimatedParticle {
11
	private TotemParticle(
12
		final ClientLevel level, final double x, final double y, final double z, final double xa, final double ya, final double za, final SpriteSet sprites
13
	) {
14
		super(level, x, y, z, sprites, 1.25F);
15
		this.friction = 0.6F;
16
		this.xd = xa;
17
		this.yd = ya;
18
		this.zd = za;
19
		this.quadSize *= 0.75F;
20
		this.lifetime = 60 + this.random.nextInt(12);
21
		this.setSpriteFromAge(sprites);
22
		if (this.random.nextInt(4) == 0) {
23
			this.setColor(0.6F + this.random.nextFloat() * 0.2F, 0.6F + this.random.nextFloat() * 0.3F, this.random.nextFloat() * 0.2F);
24
		} else {
25
			this.setColor(0.1F + this.random.nextFloat() * 0.2F, 0.4F + this.random.nextFloat() * 0.3F, this.random.nextFloat() * 0.2F);
26
		}
27
	}
28
29
	@Environment(EnvType.CLIENT)
30
	public static class Provider implements ParticleProvider<SimpleParticleType> {
31
		private final SpriteSet sprites;
32
33
		public Provider(final SpriteSet sprites) {
34
			this.sprites = sprites;
35
		}
36
37
		public Particle createParticle(
38
			final SimpleParticleType options,
39
			final ClientLevel level,
40
			final double x,
41
			final double y,
42
			final double z,
43
			final double xAux,
44
			final double yAux,
45
			final double zAux,
46
			final RandomSource random
47
		) {
48
			return new TotemParticle(level, x, y, z, xAux, yAux, zAux, this.sprites);
49
		}
50
	}
51
}
52

Decompiled Minecraft 26.3 source of TotemParticle (net/minecraft/client/particle/TotemParticle.java) with Mojang official mappings, stored verbatim on the site.