RegistryValidator .java

net.minecraft.resources.RegistryValidator (interface, 25 lines): members: NON_EMPTY, nonEmpty, none, NONE, validate. ann: @FunctionalInterface.

net.minecraft.resourcesinterface25 linescommon695 B

API Surface (0)

No public/protected methods detected (fields or constants only).

Fields & Constants (2)

NONE
NON_EMPTY

String literals (1)

"Registry must be non-empty: "

Code Graph: Dependencies (2)

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

Full Source

RegistryValidator.java25 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.resources;
2
3
import java.util.Map;
4
import net.minecraft.core.Registry;
5
6
@FunctionalInterface
7
public interface RegistryValidator<T> {
8
	RegistryValidator<?> NONE = (var0, var1) -> {};
9
	RegistryValidator<?> NON_EMPTY = (registry, loadingErrors) -> {
10
		if (registry.size() == 0) {
11
			loadingErrors.put(registry.key(), new IllegalStateException("Registry must be non-empty: " + registry.key().identifier()));
12
		}
13
	};
14
15
	static <T> RegistryValidator<T> none() {
16
		return (RegistryValidator<T>)NONE;
17
	}
18
19
	static <T> RegistryValidator<T> nonEmpty() {
20
		return (RegistryValidator<T>)NON_EMPTY;
21
	}
22
23
	void validate(Registry<T> registry, Map<ResourceKey<?>, Exception> loadingErrors);
24
}
25

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