Class DefaultResourceConditions
java.lang.Object
net.fabricmc.fabric.api.resource.conditions.v1.DefaultResourceConditions
Contains
ConditionJsonProviders for resource conditions provided by fabric itself.-
Method Summary
Modifier and TypeMethodDescriptionstatic ConditionJsonProviderallModsLoaded(String... modIds) Creates a condition that returns true if all the passed mod ids correspond to a loaded mod.static ConditionJsonProviderand(ConditionJsonProvider... values) Creates a condition that returns true if all of its child conditions are true.static ConditionJsonProvideranyModLoaded(String... modIds) Creates a condition that returns true if at least one of the passed mod ids corresponds to a loaded mod.static ConditionJsonProviderblockTagsPopulated(TagKey<Block>... tags) Deprecated.static ConditionJsonProviderfeaturesEnabled(FeatureFlag... features) Creates a condition that returns true if all the passed features are enabled.static ConditionJsonProviderfluidTagsPopulated(TagKey<Fluid>... tags) Deprecated.(package private) static voidinit()static ConditionJsonProvideritemTagsPopulated(TagKey<Item>... tags) Deprecated.static ConditionJsonProvidernot(ConditionJsonProvider value) Creates a NOT condition that returns true if its child condition is false, and false if its child is true.static ConditionJsonProvideror(ConditionJsonProvider... values) Creates a condition that returns true if any of its child conditions are true.static <T> ConditionJsonProvidertagsPopulated(TagKey<T>... tags) Creates a condition that returns true if each of the passed tags exists and has at least one element.
-
Method Details
-
not
Creates a NOT condition that returns true if its child condition is false, and false if its child is true. -
and
Creates a condition that returns true if all of its child conditions are true. -
or
Creates a condition that returns true if any of its child conditions are true. -
allModsLoaded
Creates a condition that returns true if all the passed mod ids correspond to a loaded mod. -
anyModLoaded
Creates a condition that returns true if at least one of the passed mod ids corresponds to a loaded mod. -
blockTagsPopulated
@SafeVarargs @Deprecated public static ConditionJsonProvider blockTagsPopulated(TagKey<Block>... tags) Deprecated.Create a condition that returns true if each of the passed block tags exists and has at least one element. -
fluidTagsPopulated
@SafeVarargs @Deprecated public static ConditionJsonProvider fluidTagsPopulated(TagKey<Fluid>... tags) Deprecated.Create a condition that returns true if each of the passed fluid tags exists and has at least one element. -
itemTagsPopulated
@SafeVarargs @Deprecated public static ConditionJsonProvider itemTagsPopulated(TagKey<Item>... tags) Deprecated.Create a condition that returns true if each of the passed item tags exists and has at least one element. -
tagsPopulated
Creates a condition that returns true if each of the passed tags exists and has at least one element. This works for any registries, and the registry ID of the tags is serialized to JSON as well as the tags. -
featuresEnabled
Creates a condition that returns true if all the passed features are enabled.- Parameters:
features- the features to check for
-
init
static void init()
-
tagsPopulated(net.minecraft.registry.tag.TagKey<T>...)instead.