Class ValidationContext
java.lang.Object
net.minecraft.world.level.storage.loot.ValidationContext
Context for validating loot tables. Loot tables are validated recursively by checking that all functions, conditions, etc. (implementing
LootContextUser
) are valid according to their LootTable's LootContextParamSet
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LootContextParamSet
private final ProblemReporter
private final Optional
<HolderGetter.Provider> private final Set
<ResourceKey<?>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionValidationContext
(ProblemReporter reporter, LootContextParamSet params) private
ValidationContext
(ProblemReporter reporter, LootContextParamSet params, Optional<HolderGetter.Provider> resolver, Set<ResourceKey<?>> visitedElements) ValidationContext
(ProblemReporter reporter, LootContextParamSet params, HolderGetter.Provider resolver) -
Method Summary
Modifier and TypeMethodDescriptionboolean
enterElement
(String name, ResourceKey<?> key) Create a new ValidationContext withchildName
being added to the context.boolean
hasVisitedElement
(ResourceKey<?> key) reporter()
void
reportProblem
(String problem) Report a problem to this ValidationContext.resolver()
setParams
(LootContextParamSet params) Create a new ValidationContext with the given LootContextParamSet.void
validateUser
(LootContextUser lootContextUser) Validate the given LootContextUser.
-
Field Details
-
reporter
-
params
-
resolver
-
visitedElements
-
-
Constructor Details
-
ValidationContext
public ValidationContext(ProblemReporter reporter, LootContextParamSet params, HolderGetter.Provider resolver) -
ValidationContext
-
ValidationContext
private ValidationContext(ProblemReporter reporter, LootContextParamSet params, Optional<HolderGetter.Provider> resolver, Set<ResourceKey<?>> visitedElements)
-
-
Method Details
-
forChild
Create a new ValidationContext withchildName
being added to the context. -
enterElement
-
hasVisitedElement
-
reportProblem
Report a problem to this ValidationContext. -
validateUser
Validate the given LootContextUser. -
resolver
-
allowsReferences
public boolean allowsReferences() -
setParams
Create a new ValidationContext with the given LootContextParamSet. -
reporter
-