ValidationContextSource .java

net.minecraft.world.level.storage.loot.ValidationContextSource (class, 31 lines): members: lootData, entityContext, reporter, context. imports: Nullable.

net.minecraft.world.level.storage.lootclass31 linescommon983 B

API Surface (2)

ValidationContext context(final ContextKeySet params)
ValidationContext entityContext()

Fields & Constants (3)

reporter
lootData
entityContext

Code Graph: Dependencies (5)

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

Full Source

ValidationContextSource.java31 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level.storage.loot;
2
3
import net.minecraft.core.HolderGetter;
4
import net.minecraft.util.ProblemReporter;
5
import net.minecraft.util.context.ContextKeySet;
6
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
7
import org.jspecify.annotations.Nullable;
8
9
public class ValidationContextSource {
10
	private final ProblemReporter reporter;
11
	private final HolderGetter.Provider lootData;
12
	private @Nullable ValidationContext entityContext;
13
14
	public ValidationContextSource(final ProblemReporter reporter, final HolderGetter.Provider lootData) {
15
		this.reporter = reporter;
16
		this.lootData = lootData;
17
	}
18
19
	public ValidationContext context(final ContextKeySet params) {
20
		return new ValidationContext(this.reporter, params, this.lootData);
21
	}
22
23
	public ValidationContext entityContext() {
24
		if (this.entityContext == null) {
25
			this.entityContext = this.context(LootContextParamSets.ADVANCEMENT_ENTITY);
26
		}
27
28
		return this.entityContext;
29
	}
30
}
31

Decompiled Minecraft 26.3 source of ValidationContextSource (net/minecraft/world/level/storage/loot/ValidationContextSource.java) with Mojang official mappings, stored verbatim on the site.