ChunkSectionLayer .java

net.minecraft.client.renderer.chunk.ChunkSectionLayer (enum): members: SOLID, CUTOUT, TRANSLUCENT, multiDrawPipeline, byTransparency, vertexFormat, label.

net.minecraft.client.renderer.chunkenum59 linesclient1.8 KB

API Surface (6)

ChunkSectionLayer byTransparency(final Transparency transparency)
RenderPipeline pipeline(final boolean multiDraw)
int bufferSize()
String label()
boolean translucent()
VertexFormat vertexFormat()

Fields & Constants (5)

pipeline
multiDrawPipeline
bufferSize
translucent
label

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ChunkSectionLayer.java59 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.renderer.chunk;
2
3
import com.mojang.blaze3d.platform.Transparency;
4
import com.mojang.renderpearl.api.pipeline.RenderPipeline;
5
import com.mojang.renderpearl.api.vertex.VertexFormat;
6
import java.util.Locale;
7
import net.fabricmc.api.EnvType;
8
import net.fabricmc.api.Environment;
9
import net.minecraft.client.renderer.RenderPipelines;
10
11
@Environment(EnvType.CLIENT)
12
public enum ChunkSectionLayer {
13
	SOLID(RenderPipelines.SOLID_TERRAIN, RenderPipelines.SOLID_TERRAIN_MULTIDRAW, 4194304, false),
14
	CUTOUT(RenderPipelines.CUTOUT_TERRAIN, RenderPipelines.CUTOUT_TERRAIN_MULTIDRAW, 4194304, false),
15
	TRANSLUCENT(RenderPipelines.TRANSLUCENT_TERRAIN, RenderPipelines.TRANSLUCENT_TERRAIN_MULTIDRAW, 786432, true);
16
17
	private final RenderPipeline pipeline;
18
	private final RenderPipeline multiDrawPipeline;
19
	private final int bufferSize;
20
	private final boolean translucent;
21
	private final String label;
22
23
	ChunkSectionLayer(final RenderPipeline pipeline, final RenderPipeline multiDrawPipeline, final int bufferSize, final boolean translucent) {
24
		this.pipeline = pipeline;
25
		this.multiDrawPipeline = multiDrawPipeline;
26
		this.bufferSize = bufferSize;
27
		this.translucent = translucent;
28
		this.label = this.toString().toLowerCase(Locale.ROOT);
29
	}
30
31
	public static ChunkSectionLayer byTransparency(final Transparency transparency) {
32
		if (transparency.hasTranslucent()) {
33
			return TRANSLUCENT;
34
		} else {
35
			return transparency.hasTransparent() ? CUTOUT : SOLID;
36
		}
37
	}
38
39
	public RenderPipeline pipeline(final boolean multiDraw) {
40
		return multiDraw ? this.multiDrawPipeline : this.pipeline;
41
	}
42
43
	public int bufferSize() {
44
		return this.bufferSize;
45
	}
46
47
	public String label() {
48
		return this.label;
49
	}
50
51
	public boolean translucent() {
52
		return this.translucent;
53
	}
54
55
	public VertexFormat vertexFormat() {
56
		return this.pipeline.getVertexFormatBinding(0);
57
	}
58
}
59

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