Class ConditionContext
java.lang.Object
net.neoforged.neoforge.common.conditions.ConditionContext
- All Implemented Interfaces:
ICondition.IContext
-
Field Summary
FieldsFields inherited from interface ICondition.IContext
EMPTY, TAGS_INVALID -
Constructor Summary
ConstructorsConstructorDescriptionConditionContext(List<Registry.PendingTags<?>> pendingTags, RegistryAccess registryAccess, 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 access to the loaded registries if this context is used for a datapack reload.
-
Field Details
-
pendingContents
-
enabledFeatures
-
registryAccess
-
-
Constructor Details
-
ConditionContext
public ConditionContext(List<Registry.PendingTags<?>> pendingTags, RegistryAccess registryAccess, 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
-
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
-