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.Providerprivate final RegistryAccessFields inherited from interface ICondition.IContext
EMPTY, TAGS_INVALID -
Constructor Summary
ConstructorsConstructorDescriptionConditionContext(List<Registry.PendingTags<?>> pendingTags, RegistryAccess registryAccess, HolderGetter.Provider registries, FeatureFlagSet enabledFeatures) ConditionContext(List<Registry.PendingTags<?>> pendingTags, RegistryAccess registryAccess, FeatureFlagSet enabledFeatures) Deprecated, for removal: This API element is subject to removal in a future version.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.Provides access to the loaded registries if this context is used for a datapack reload.
-
Field Details
-
pendingContents
-
enabledFeatures
-
registryAccess
-
registries
-
-
Constructor Details
-
ConditionContext
@Deprecated(forRemoval=true, since="26.2") public ConditionContext(List<Registry.PendingTags<?>> pendingTags, RegistryAccess registryAccess, FeatureFlagSet enabledFeatures) Deprecated, for removal: This API element is subject to removal in a future version. -
ConditionContext
public ConditionContext(List<Registry.PendingTags<?>> pendingTags, RegistryOps.RegistryInfoLookup context, FeatureFlagSet enabledFeatures) -
ConditionContext
public ConditionContext(List<Registry.PendingTags<?>> pendingTags, RegistryAccess registryAccess, 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
-
registryAccess
Description copied from interface:ICondition.IContextProvides access to the loaded registries if this context is used for a datapack reload.- Specified by:
registryAccessin interfaceICondition.IContext- Returns:
- The
RegistryAccesscontext for the currently active reload.
-
enabledFeatures
- Specified by:
enabledFeaturesin interfaceICondition.IContext
-
ConditionContext(List, RegistryAccess, HolderGetter.Provider, FeatureFlagSet)instead