QuadParticleGroup .java

net.minecraft.client.particle.QuadParticleGroup (class, 42 lines): members: particleTypeRenderState, particleType, extractRenderState. strings: "Particle".

net.minecraft.client.particleclass42 linesclientextends ParticleGroup<SingleQuadParticle>1.6 KB

API Surface (1)

ParticleGroupRenderState extractRenderState(final Frustum frustum, final Camera camera, final float partialTickTime)

Fields & Constants (2)

particleType
particleTypeRenderState

String literals (4)

"Rendering Particle"
"Particle being rendered"
"Particle"
"Particle Type"

Full Source

QuadParticleGroup.java42 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.CrashReport;
6
import net.minecraft.CrashReportCategory;
7
import net.minecraft.ReportedException;
8
import net.minecraft.client.Camera;
9
import net.minecraft.client.renderer.culling.Frustum;
10
import net.minecraft.client.renderer.state.level.ParticleGroupRenderState;
11
import net.minecraft.client.renderer.state.level.QuadParticleRenderState;
12
13
@Environment(EnvType.CLIENT)
14
public class QuadParticleGroup extends ParticleGroup<SingleQuadParticle> {
15
	private final ParticleRenderType particleType;
16
	private final QuadParticleRenderState particleTypeRenderState = new QuadParticleRenderState();
17
18
	public QuadParticleGroup(final ParticleEngine engine, final ParticleRenderType particleType) {
19
		super(engine);
20
		this.particleType = particleType;
21
	}
22
23
	@Override
24
	public ParticleGroupRenderState extractRenderState(final Frustum frustum, final Camera camera, final float partialTickTime) {
25
		for (SingleQuadParticle particle : this.particles) {
26
			if (frustum.pointInFrustum(particle.x, particle.y, particle.z)) {
27
				try {
28
					particle.extract(this.particleTypeRenderState, camera, partialTickTime);
29
				} catch (Throwable throwable) {
30
					CrashReport report = CrashReport.forThrowable(throwable, "Rendering Particle");
31
					CrashReportCategory category = report.addCategory("Particle being rendered");
32
					category.setDetail("Particle", particle::toString);
33
					category.setDetail("Particle Type", this.particleType::toString);
34
					throw new ReportedException(report);
35
				}
36
			}
37
		}
38
39
		return this.particleTypeRenderState;
40
	}
41
}
42

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