BlockMarker .java

net.minecraft.client.particle.BlockMarker (class): members: layer, getQuadSize, getLayer, Provider. imports: BlockParticleOption, ClientLevel, Minecraft.

net.minecraft.client.particleclass50 linesclientextends SingleQuadParticle1.4 KB

API Surface (3)

SingleQuadParticle.Layer getLayer()
float getQuadSize(final float a)
Particle createParticle(final BlockParticleOption option, 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)

layer

Full Source

BlockMarker.java50 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.Minecraft;
6
import net.minecraft.client.multiplayer.ClientLevel;
7
import net.minecraft.core.particles.BlockParticleOption;
8
import net.minecraft.util.RandomSource;
9
import net.minecraft.world.level.block.state.BlockState;
10
11
@Environment(EnvType.CLIENT)
12
public class BlockMarker extends SingleQuadParticle {
13
	private final SingleQuadParticle.Layer layer;
14
15
	private BlockMarker(final ClientLevel level, final double x, final double y, final double z, final BlockState state) {
16
		super(level, x, y, z, Minecraft.getInstance().getModelManager().getBlockStateModelSet().getParticleMaterial(state).sprite());
17
		this.gravity = 0.0F;
18
		this.lifetime = 80;
19
		this.hasPhysics = false;
20
		this.layer = SingleQuadParticle.Layer.bySprite(this.sprite);
21
	}
22
23
	@Override
24
	public SingleQuadParticle.Layer getLayer() {
25
		return this.layer;
26
	}
27
28
	@Override
29
	public float getQuadSize(final float a) {
30
		return 0.5F;
31
	}
32
33
	@Environment(EnvType.CLIENT)
34
	public static class Provider implements ParticleProvider<BlockParticleOption> {
35
		public Particle createParticle(
36
			final BlockParticleOption option,
37
			final ClientLevel level,
38
			final double x,
39
			final double y,
40
			final double z,
41
			final double xAux,
42
			final double yAux,
43
			final double zAux,
44
			final RandomSource random
45
		) {
46
			return new BlockMarker(level, x, y, z, option.getState());
47
		}
48
	}
49
}
50

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