Class ConditionContext
java.lang.Object
net.neoforged.neoforge.common.conditions.ConditionContext
- All Implemented Interfaces:
ICondition.IContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FeatureFlagSetprivate final HolderGetter.ProviderFields inherited from interface ICondition.IContext
EMPTY, TAGS_INVALID -
Constructor Summary
ConstructorsConstructorDescriptionConditionContext(List<Registry.PendingTags<?>> pendingTags, HolderGetter.Provider registries, FeatureFlagSet enabledFeatures) ConditionContext(List<Registry.PendingTags<?>> pendingTags, RegistryOps.RegistryInfoLookup context, FeatureFlagSet enabledFeatures) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()<T> Collection<Holder<T>> Returns the contents of the requested tag as loaded from data packs, or an empty collection if the tag is not loaded.<T> booleanisTagLoaded(TagKey<T> key) Returnstrueif the requested tag is available.Provides the context registries with partially bound tags for the currently active reload if this context is used for a datapack reload.
-
Field Details
-
pendingContents
-
enabledFeatures
-
registries
-
-
Constructor Details
-
ConditionContext
public ConditionContext(List<Registry.PendingTags<?>> pendingTags, RegistryOps.RegistryInfoLookup context, FeatureFlagSet enabledFeatures) -
ConditionContext
public ConditionContext(List<Registry.PendingTags<?>> pendingTags, HolderGetter.Provider registries, FeatureFlagSet enabledFeatures)
-
-
Method Details
-
clear
public void clear() -
isTagLoaded
Description copied from interface:ICondition.IContextReturnstrueif the requested tag is available. This method does not require that the loaded tag have any elements, only that it be present at all.- Specified by:
isTagLoadedin interfaceICondition.IContext
-
getTag
Description copied from interface:ICondition.IContextReturns the contents of the requested tag as loaded from data packs, or an empty collection if the tag is not loaded. The returned holders are safe to inspect even though the tag has not yet been bound to its registry (i.e.Registry.PendingTags.apply()has not yet run).- Specified by:
getTagin interfaceICondition.IContext
-
registries
Description copied from interface:ICondition.IContextProvides the context registries with partially bound tags for the currently active reload if this context is used for a datapack reload.- Specified by:
registriesin interfaceICondition.IContext- Returns:
- the context registries of the active reload
-
enabledFeatures
- Specified by:
enabledFeaturesin interfaceICondition.IContext
-