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 LootContextParamSetprivate final ProblemReporterprivate final Optional<HolderGetter.Provider> private final Set<ResourceKey<?>> -
Constructor Summary
ConstructorsModifierConstructorDescriptionValidationContext(ProblemReporter reporter, LootContextParamSet params) privateValidationContext(ProblemReporter reporter, LootContextParamSet params, Optional<HolderGetter.Provider> resolver, Set<ResourceKey<?>> visitedElements) ValidationContext(ProblemReporter reporter, LootContextParamSet params, HolderGetter.Provider resolver) -
Method Summary
Modifier and TypeMethodDescriptionbooleanenterElement(String name, ResourceKey<?> key) Create a new ValidationContext withchildNamebeing added to the context.booleanhasVisitedElement(ResourceKey<?> key) reporter()voidreportProblem(String problem) Report a problem to this ValidationContext.resolver()setParams(LootContextParamSet params) Create a new ValidationContext with the given LootContextParamSet.voidvalidateUser(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 withchildNamebeing 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
-