ShaderType .java

com.mojang.renderpearl.api.pipeline.ShaderType (enum, 41 lines): members: VERTEX, FRAGMENT, idConverter, byLocation, extension, TYPES, getName, name.

com.mojang.renderpearl.api.pipelineenum41 linesclient958 B

API Surface (2)

String getName()
FileToIdConverter idConverter()

Fields & Constants (3)

TYPES
name
extension

String literals (5)

"vertex"
".vsh"
"fragment"
".fsh"
"shaders"

Code Graph: Dependencies (2)

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

Full Source

ShaderType.java41 lines · Minecraft 26.3 · verbatim
1
package com.mojang.renderpearl.api.pipeline;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
import net.minecraft.resources.FileToIdConverter;
6
import net.minecraft.resources.Identifier;
7
import org.jspecify.annotations.Nullable;
8
9
@Environment(EnvType.CLIENT)
10
public enum ShaderType {
11
	VERTEX("vertex", ".vsh"),
12
	FRAGMENT("fragment", ".fsh");
13
14
	private static final ShaderType[] TYPES = values();
15
	private final String name;
16
	private final String extension;
17
18
	ShaderType(final String name, final String extension) {
19
		this.name = name;
20
		this.extension = extension;
21
	}
22
23
	public static @Nullable ShaderType byLocation(final Identifier location) {
24
		for (ShaderType type : TYPES) {
25
			if (location.getPath().endsWith(type.extension)) {
26
				return type;
27
			}
28
		}
29
30
		return null;
31
	}
32
33
	public String getName() {
34
		return this.name;
35
	}
36
37
	public FileToIdConverter idConverter() {
38
		return new FileToIdConverter("shaders", this.extension);
39
	}
40
}
41

Decompiled Minecraft 26.3 source of ShaderType (com/mojang/renderpearl/api/pipeline/ShaderType.java) with Mojang official mappings, stored verbatim on the site.