package net.minecraft.advancements.critereon; import com.mojang.serialization.Codec; import net.minecraft.core.Registry; import net.minecraft.core.registries.BuiltInRegistries; public class ItemSubPredicates { public static final ItemSubPredicate.Type DAMAGE = register("damage", ItemDamagePredicate.CODEC); public static final ItemSubPredicate.Type ENCHANTMENTS = register( "enchantments", ItemEnchantmentsPredicate.Enchantments.CODEC ); public static final ItemSubPredicate.Type STORED_ENCHANTMENTS = register( "stored_enchantments", ItemEnchantmentsPredicate.StoredEnchantments.CODEC ); public static final ItemSubPredicate.Type POTIONS = register("potion_contents", ItemPotionsPredicate.CODEC); public static final ItemSubPredicate.Type CUSTOM_DATA = register("custom_data", ItemCustomDataPredicate.CODEC); public static final ItemSubPredicate.Type CONTAINER = register("container", ItemContainerPredicate.CODEC); public static final ItemSubPredicate.Type BUNDLE_CONTENTS = register("bundle_contents", ItemBundlePredicate.CODEC); public static final ItemSubPredicate.Type FIREWORK_EXPLOSION = register( "firework_explosion", ItemFireworkExplosionPredicate.CODEC ); public static final ItemSubPredicate.Type FIREWORKS = register("fireworks", ItemFireworksPredicate.CODEC); public static final ItemSubPredicate.Type WRITABLE_BOOK = register("writable_book_content", ItemWritableBookPredicate.CODEC); public static final ItemSubPredicate.Type WRITTEN_BOOK = register("written_book_content", ItemWrittenBookPredicate.CODEC); public static final ItemSubPredicate.Type ATTRIBUTE_MODIFIERS = register( "attribute_modifiers", ItemAttributeModifiersPredicate.CODEC ); public static final ItemSubPredicate.Type ARMOR_TRIM = register("trim", ItemTrimPredicate.CODEC); public static final ItemSubPredicate.Type JUKEBOX_PLAYABLE = register("jukebox_playable", ItemJukeboxPlayablePredicate.CODEC); private static ItemSubPredicate.Type register(String name, Codec codec) { return Registry.register(BuiltInRegistries.ITEM_SUB_PREDICATE_TYPE, name, new ItemSubPredicate.Type<>(codec)); } public static ItemSubPredicate.Type bootstrap(Registry> registry) { return DAMAGE; } }