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 pReporter, LootContextParamSet pParams) private
ValidationContext
(ProblemReporter pReporter, LootContextParamSet pParams, Optional<HolderGetter.Provider> pResolver, Set<ResourceKey<?>> pVisitedElements) ValidationContext
(ProblemReporter pReporter, LootContextParamSet pParams, HolderGetter.Provider pResolver) -
Method Summary
Modifier and TypeMethodDescriptionboolean
enterElement
(String pName, ResourceKey<?> pKey) Create a new ValidationContext withchildName
being added to the context.boolean
hasVisitedElement
(ResourceKey<?> pKey) reporter()
void
reportProblem
(String pProblem) Report a problem to this ValidationContext.resolver()
setParams
(LootContextParamSet pParams) Create a new ValidationContext with the given LootContextParamSet.void
validateUser
(LootContextUser pLootContextUser) Validate the given LootContextUser.
-
Field Details
-
reporter
-
params
-
resolver
-
visitedElements
-
-
Constructor Details
-
ValidationContext
public ValidationContext(ProblemReporter pReporter, LootContextParamSet pParams, HolderGetter.Provider pResolver) -
ValidationContext
-
ValidationContext
private ValidationContext(ProblemReporter pReporter, LootContextParamSet pParams, Optional<HolderGetter.Provider> pResolver, Set<ResourceKey<?>> pVisitedElements)
-
-
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
-