package net.minecraft.core.component; import com.mojang.serialization.Codec; import java.util.List; import java.util.function.UnaryOperator; import net.minecraft.core.Holder; import net.minecraft.core.Registry; import net.minecraft.core.component.DataComponentType.Builder; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.ComponentSerialization; import net.minecraft.network.codec.ByteBufCodecs; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.tags.TagKey; import net.minecraft.util.EncoderCache; import net.minecraft.util.ExtraCodecs; import net.minecraft.util.Unit; import net.minecraft.world.LockCode; import net.minecraft.world.entity.animal.CatVariant; import net.minecraft.world.entity.animal.ChickenVariant; import net.minecraft.world.entity.animal.CowVariant; import net.minecraft.world.entity.animal.Fox; import net.minecraft.world.entity.animal.MushroomCow; import net.minecraft.world.entity.animal.Parrot; import net.minecraft.world.entity.animal.PigVariant; import net.minecraft.world.entity.animal.Rabbit; import net.minecraft.world.entity.animal.Salmon; import net.minecraft.world.entity.animal.TropicalFish; import net.minecraft.world.entity.animal.axolotl.Axolotl; import net.minecraft.world.entity.animal.frog.FrogVariant; import net.minecraft.world.entity.animal.horse.Llama; import net.minecraft.world.entity.animal.horse.Variant; import net.minecraft.world.entity.animal.wolf.WolfSoundVariant; import net.minecraft.world.entity.animal.wolf.WolfVariant; import net.minecraft.world.entity.decoration.PaintingVariant; import net.minecraft.world.entity.npc.VillagerType; import net.minecraft.world.food.FoodProperties; import net.minecraft.world.item.AdventureModePredicate; import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.EitherHolder; import net.minecraft.world.item.JukeboxPlayable; import net.minecraft.world.item.Rarity; import net.minecraft.world.item.alchemy.PotionContents; import net.minecraft.world.item.component.Bees; import net.minecraft.world.item.component.BlockItemStateProperties; import net.minecraft.world.item.component.BlocksAttacks; import net.minecraft.world.item.component.BundleContents; import net.minecraft.world.item.component.ChargedProjectiles; import net.minecraft.world.item.component.Consumable; import net.minecraft.world.item.component.CustomData; import net.minecraft.world.item.component.CustomModelData; import net.minecraft.world.item.component.DamageResistant; import net.minecraft.world.item.component.DeathProtection; import net.minecraft.world.item.component.DebugStickState; import net.minecraft.world.item.component.DyedItemColor; import net.minecraft.world.item.component.FireworkExplosion; import net.minecraft.world.item.component.Fireworks; import net.minecraft.world.item.component.InstrumentComponent; import net.minecraft.world.item.component.ItemAttributeModifiers; import net.minecraft.world.item.component.ItemContainerContents; import net.minecraft.world.item.component.ItemLore; import net.minecraft.world.item.component.LodestoneTracker; import net.minecraft.world.item.component.MapDecorations; import net.minecraft.world.item.component.MapItemColor; import net.minecraft.world.item.component.MapPostProcessing; import net.minecraft.world.item.component.OminousBottleAmplifier; import net.minecraft.world.item.component.ProvidesTrimMaterial; import net.minecraft.world.item.component.ResolvableProfile; import net.minecraft.world.item.component.SeededContainerLoot; import net.minecraft.world.item.component.SuspiciousStewEffects; import net.minecraft.world.item.component.Tool; import net.minecraft.world.item.component.TooltipDisplay; import net.minecraft.world.item.component.UseCooldown; import net.minecraft.world.item.component.UseRemainder; import net.minecraft.world.item.component.Weapon; import net.minecraft.world.item.component.WritableBookContent; import net.minecraft.world.item.component.WrittenBookContent; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.enchantment.Enchantable; import net.minecraft.world.item.enchantment.ItemEnchantments; import net.minecraft.world.item.enchantment.Repairable; import net.minecraft.world.item.equipment.Equippable; import net.minecraft.world.item.equipment.trim.ArmorTrim; import net.minecraft.world.level.block.entity.BannerPattern; import net.minecraft.world.level.block.entity.BannerPatternLayers; import net.minecraft.world.level.block.entity.PotDecorations; import net.minecraft.world.level.saveddata.maps.MapId; public class DataComponents { static final EncoderCache ENCODER_CACHE = new EncoderCache(512); public static final DataComponentType CUSTOM_DATA = register("custom_data", builder -> builder.persistent(CustomData.CODEC)); public static final DataComponentType MAX_STACK_SIZE = register( "max_stack_size", builder -> builder.persistent(ExtraCodecs.intRange(1, 99)).networkSynchronized(ByteBufCodecs.VAR_INT) ); public static final DataComponentType MAX_DAMAGE = register( "max_damage", builder -> builder.persistent(ExtraCodecs.POSITIVE_INT).networkSynchronized(ByteBufCodecs.VAR_INT) ); public static final DataComponentType DAMAGE = register( "damage", builder -> builder.persistent(ExtraCodecs.NON_NEGATIVE_INT).networkSynchronized(ByteBufCodecs.VAR_INT) ); public static final DataComponentType UNBREAKABLE = register( "unbreakable", builder -> builder.persistent(Unit.CODEC).networkSynchronized(Unit.STREAM_CODEC) ); public static final DataComponentType CUSTOM_NAME = register( "custom_name", builder -> builder.persistent(ComponentSerialization.CODEC).networkSynchronized(ComponentSerialization.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType ITEM_NAME = register( "item_name", builder -> builder.persistent(ComponentSerialization.CODEC).networkSynchronized(ComponentSerialization.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType ITEM_MODEL = register( "item_model", builder -> builder.persistent(ResourceLocation.CODEC).networkSynchronized(ResourceLocation.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType LORE = register( "lore", builder -> builder.persistent(ItemLore.CODEC).networkSynchronized(ItemLore.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType RARITY = register("rarity", builder -> builder.persistent(Rarity.CODEC).networkSynchronized(Rarity.STREAM_CODEC)); public static final DataComponentType ENCHANTMENTS = register( "enchantments", builder -> builder.persistent(ItemEnchantments.CODEC).networkSynchronized(ItemEnchantments.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType CAN_PLACE_ON = register( "can_place_on", builder -> builder.persistent(AdventureModePredicate.CODEC).networkSynchronized(AdventureModePredicate.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType CAN_BREAK = register( "can_break", builder -> builder.persistent(AdventureModePredicate.CODEC).networkSynchronized(AdventureModePredicate.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType ATTRIBUTE_MODIFIERS = register( "attribute_modifiers", builder -> builder.persistent(ItemAttributeModifiers.CODEC).networkSynchronized(ItemAttributeModifiers.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType CUSTOM_MODEL_DATA = register( "custom_model_data", builder -> builder.persistent(CustomModelData.CODEC).networkSynchronized(CustomModelData.STREAM_CODEC) ); public static final DataComponentType TOOLTIP_DISPLAY = register( "tooltip_display", builder -> builder.persistent(TooltipDisplay.CODEC).networkSynchronized(TooltipDisplay.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType REPAIR_COST = register( "repair_cost", builder -> builder.persistent(ExtraCodecs.NON_NEGATIVE_INT).networkSynchronized(ByteBufCodecs.VAR_INT) ); public static final DataComponentType CREATIVE_SLOT_LOCK = register("creative_slot_lock", builder -> builder.networkSynchronized(Unit.STREAM_CODEC)); public static final DataComponentType ENCHANTMENT_GLINT_OVERRIDE = register( "enchantment_glint_override", builder -> builder.persistent(Codec.BOOL).networkSynchronized(ByteBufCodecs.BOOL) ); public static final DataComponentType INTANGIBLE_PROJECTILE = register("intangible_projectile", builder -> builder.persistent(Unit.CODEC)); public static final DataComponentType FOOD = register( "food", builder -> builder.persistent(FoodProperties.DIRECT_CODEC).networkSynchronized(FoodProperties.DIRECT_STREAM_CODEC).cacheEncoding() ); public static final DataComponentType CONSUMABLE = register( "consumable", builder -> builder.persistent(Consumable.CODEC).networkSynchronized(Consumable.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType USE_REMAINDER = register( "use_remainder", builder -> builder.persistent(UseRemainder.CODEC).networkSynchronized(UseRemainder.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType USE_COOLDOWN = register( "use_cooldown", builder -> builder.persistent(UseCooldown.CODEC).networkSynchronized(UseCooldown.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType DAMAGE_RESISTANT = register( "damage_resistant", builder -> builder.persistent(DamageResistant.CODEC).networkSynchronized(DamageResistant.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType TOOL = register( "tool", builder -> builder.persistent(Tool.CODEC).networkSynchronized(Tool.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType WEAPON = register( "weapon", builder -> builder.persistent(Weapon.CODEC).networkSynchronized(Weapon.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType ENCHANTABLE = register( "enchantable", builder -> builder.persistent(Enchantable.CODEC).networkSynchronized(Enchantable.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType EQUIPPABLE = register( "equippable", builder -> builder.persistent(Equippable.CODEC).networkSynchronized(Equippable.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType REPAIRABLE = register( "repairable", builder -> builder.persistent(Repairable.CODEC).networkSynchronized(Repairable.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType GLIDER = register("glider", builder -> builder.persistent(Unit.CODEC).networkSynchronized(Unit.STREAM_CODEC)); public static final DataComponentType TOOLTIP_STYLE = register( "tooltip_style", builder -> builder.persistent(ResourceLocation.CODEC).networkSynchronized(ResourceLocation.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType DEATH_PROTECTION = register( "death_protection", builder -> builder.persistent(DeathProtection.CODEC).networkSynchronized(DeathProtection.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType BLOCKS_ATTACKS = register( "blocks_attacks", builder -> builder.persistent(BlocksAttacks.CODEC).networkSynchronized(BlocksAttacks.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType STORED_ENCHANTMENTS = register( "stored_enchantments", builder -> builder.persistent(ItemEnchantments.CODEC).networkSynchronized(ItemEnchantments.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType DYED_COLOR = register( "dyed_color", builder -> builder.persistent(DyedItemColor.CODEC).networkSynchronized(DyedItemColor.STREAM_CODEC) ); public static final DataComponentType MAP_COLOR = register( "map_color", builder -> builder.persistent(MapItemColor.CODEC).networkSynchronized(MapItemColor.STREAM_CODEC) ); public static final DataComponentType MAP_ID = register("map_id", builder -> builder.persistent(MapId.CODEC).networkSynchronized(MapId.STREAM_CODEC)); public static final DataComponentType MAP_DECORATIONS = register( "map_decorations", builder -> builder.persistent(MapDecorations.CODEC).cacheEncoding() ); public static final DataComponentType MAP_POST_PROCESSING = register( "map_post_processing", builder -> builder.networkSynchronized(MapPostProcessing.STREAM_CODEC) ); public static final DataComponentType CHARGED_PROJECTILES = register( "charged_projectiles", builder -> builder.persistent(ChargedProjectiles.CODEC).networkSynchronized(ChargedProjectiles.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType BUNDLE_CONTENTS = register( "bundle_contents", builder -> builder.persistent(BundleContents.CODEC).networkSynchronized(BundleContents.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType POTION_CONTENTS = register( "potion_contents", builder -> builder.persistent(PotionContents.CODEC).networkSynchronized(PotionContents.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType POTION_DURATION_SCALE = register( "potion_duration_scale", builder -> builder.persistent(ExtraCodecs.NON_NEGATIVE_FLOAT).networkSynchronized(ByteBufCodecs.FLOAT).cacheEncoding() ); public static final DataComponentType SUSPICIOUS_STEW_EFFECTS = register( "suspicious_stew_effects", builder -> builder.persistent(SuspiciousStewEffects.CODEC).networkSynchronized(SuspiciousStewEffects.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType WRITABLE_BOOK_CONTENT = register( "writable_book_content", builder -> builder.persistent(WritableBookContent.CODEC).networkSynchronized(WritableBookContent.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType WRITTEN_BOOK_CONTENT = register( "written_book_content", builder -> builder.persistent(WrittenBookContent.CODEC).networkSynchronized(WrittenBookContent.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType TRIM = register( "trim", builder -> builder.persistent(ArmorTrim.CODEC).networkSynchronized(ArmorTrim.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType DEBUG_STICK_STATE = register( "debug_stick_state", builder -> builder.persistent(DebugStickState.CODEC).cacheEncoding() ); public static final DataComponentType ENTITY_DATA = register( "entity_data", builder -> builder.persistent(CustomData.CODEC_WITH_ID).networkSynchronized(CustomData.STREAM_CODEC) ); public static final DataComponentType BUCKET_ENTITY_DATA = register( "bucket_entity_data", builder -> builder.persistent(CustomData.CODEC).networkSynchronized(CustomData.STREAM_CODEC) ); public static final DataComponentType BLOCK_ENTITY_DATA = register( "block_entity_data", builder -> builder.persistent(CustomData.CODEC_WITH_ID).networkSynchronized(CustomData.STREAM_CODEC) ); public static final DataComponentType INSTRUMENT = register( "instrument", builder -> builder.persistent(InstrumentComponent.CODEC).networkSynchronized(InstrumentComponent.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType PROVIDES_TRIM_MATERIAL = register( "provides_trim_material", builder -> builder.persistent(ProvidesTrimMaterial.CODEC).networkSynchronized(ProvidesTrimMaterial.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType OMINOUS_BOTTLE_AMPLIFIER = register( "ominous_bottle_amplifier", builder -> builder.persistent(OminousBottleAmplifier.CODEC).networkSynchronized(OminousBottleAmplifier.STREAM_CODEC) ); public static final DataComponentType JUKEBOX_PLAYABLE = register( "jukebox_playable", builder -> builder.persistent(JukeboxPlayable.CODEC).networkSynchronized(JukeboxPlayable.STREAM_CODEC) ); public static final DataComponentType> PROVIDES_BANNER_PATTERNS = register( "provides_banner_patterns", builder -> builder.persistent(TagKey.hashedCodec(Registries.BANNER_PATTERN)) .networkSynchronized(TagKey.streamCodec(Registries.BANNER_PATTERN)) .cacheEncoding() ); public static final DataComponentType>>> RECIPES = register( "recipes", builder -> builder.persistent(Recipe.KEY_CODEC.listOf()).cacheEncoding() ); public static final DataComponentType LODESTONE_TRACKER = register( "lodestone_tracker", builder -> builder.persistent(LodestoneTracker.CODEC).networkSynchronized(LodestoneTracker.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType FIREWORK_EXPLOSION = register( "firework_explosion", builder -> builder.persistent(FireworkExplosion.CODEC).networkSynchronized(FireworkExplosion.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType FIREWORKS = register( "fireworks", builder -> builder.persistent(Fireworks.CODEC).networkSynchronized(Fireworks.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType PROFILE = register( "profile", builder -> builder.persistent(ResolvableProfile.CODEC).networkSynchronized(ResolvableProfile.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType NOTE_BLOCK_SOUND = register( "note_block_sound", builder -> builder.persistent(ResourceLocation.CODEC).networkSynchronized(ResourceLocation.STREAM_CODEC) ); public static final DataComponentType BANNER_PATTERNS = register( "banner_patterns", builder -> builder.persistent(BannerPatternLayers.CODEC).networkSynchronized(BannerPatternLayers.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType BASE_COLOR = register( "base_color", builder -> builder.persistent(DyeColor.CODEC).networkSynchronized(DyeColor.STREAM_CODEC) ); public static final DataComponentType POT_DECORATIONS = register( "pot_decorations", builder -> builder.persistent(PotDecorations.CODEC).networkSynchronized(PotDecorations.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType CONTAINER = register( "container", builder -> builder.persistent(ItemContainerContents.CODEC).networkSynchronized(ItemContainerContents.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType BLOCK_STATE = register( "block_state", builder -> builder.persistent(BlockItemStateProperties.CODEC).networkSynchronized(BlockItemStateProperties.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType BEES = register( "bees", builder -> builder.persistent(Bees.CODEC).networkSynchronized(Bees.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType LOCK = register("lock", builder -> builder.persistent(LockCode.CODEC)); public static final DataComponentType CONTAINER_LOOT = register( "container_loot", builder -> builder.persistent(SeededContainerLoot.CODEC) ); public static final DataComponentType> BREAK_SOUND = register( "break_sound", builder -> builder.persistent(SoundEvent.CODEC).networkSynchronized(SoundEvent.STREAM_CODEC).cacheEncoding() ); public static final DataComponentType> VILLAGER_VARIANT = register( "villager/variant", builder -> builder.persistent(VillagerType.CODEC).networkSynchronized(VillagerType.STREAM_CODEC) ); public static final DataComponentType> WOLF_VARIANT = register( "wolf/variant", builder -> builder.persistent(WolfVariant.CODEC).networkSynchronized(WolfVariant.STREAM_CODEC) ); public static final DataComponentType> WOLF_SOUND_VARIANT = register( "wolf/sound_variant", builder -> builder.persistent(WolfSoundVariant.CODEC).networkSynchronized(WolfSoundVariant.STREAM_CODEC) ); public static final DataComponentType WOLF_COLLAR = register( "wolf/collar", builder -> builder.persistent(DyeColor.CODEC).networkSynchronized(DyeColor.STREAM_CODEC) ); public static final DataComponentType FOX_VARIANT = register( "fox/variant", builder -> builder.persistent(Fox.Variant.CODEC).networkSynchronized(Fox.Variant.STREAM_CODEC) ); public static final DataComponentType SALMON_SIZE = register( "salmon/size", builder -> builder.persistent(Salmon.Variant.CODEC).networkSynchronized(Salmon.Variant.STREAM_CODEC) ); public static final DataComponentType PARROT_VARIANT = register( "parrot/variant", builder -> builder.persistent(Parrot.Variant.CODEC).networkSynchronized(Parrot.Variant.STREAM_CODEC) ); public static final DataComponentType TROPICAL_FISH_PATTERN = register( "tropical_fish/pattern", builder -> builder.persistent(TropicalFish.Pattern.CODEC).networkSynchronized(TropicalFish.Pattern.STREAM_CODEC) ); public static final DataComponentType TROPICAL_FISH_BASE_COLOR = register( "tropical_fish/base_color", builder -> builder.persistent(DyeColor.CODEC).networkSynchronized(DyeColor.STREAM_CODEC) ); public static final DataComponentType TROPICAL_FISH_PATTERN_COLOR = register( "tropical_fish/pattern_color", builder -> builder.persistent(DyeColor.CODEC).networkSynchronized(DyeColor.STREAM_CODEC) ); public static final DataComponentType MOOSHROOM_VARIANT = register( "mooshroom/variant", builder -> builder.persistent(MushroomCow.Variant.CODEC).networkSynchronized(MushroomCow.Variant.STREAM_CODEC) ); public static final DataComponentType RABBIT_VARIANT = register( "rabbit/variant", builder -> builder.persistent(Rabbit.Variant.CODEC).networkSynchronized(Rabbit.Variant.STREAM_CODEC) ); public static final DataComponentType> PIG_VARIANT = register( "pig/variant", builder -> builder.persistent(PigVariant.CODEC).networkSynchronized(PigVariant.STREAM_CODEC) ); public static final DataComponentType> COW_VARIANT = register( "cow/variant", builder -> builder.persistent(CowVariant.CODEC).networkSynchronized(CowVariant.STREAM_CODEC) ); public static final DataComponentType> CHICKEN_VARIANT = register( "chicken/variant", builder -> builder.persistent(EitherHolder.codec(Registries.CHICKEN_VARIANT, ChickenVariant.CODEC)) .networkSynchronized(EitherHolder.streamCodec(Registries.CHICKEN_VARIANT, ChickenVariant.STREAM_CODEC)) ); public static final DataComponentType> FROG_VARIANT = register( "frog/variant", builder -> builder.persistent(FrogVariant.CODEC).networkSynchronized(FrogVariant.STREAM_CODEC) ); public static final DataComponentType HORSE_VARIANT = register( "horse/variant", builder -> builder.persistent(Variant.CODEC).networkSynchronized(Variant.STREAM_CODEC) ); public static final DataComponentType> PAINTING_VARIANT = register( "painting/variant", builder -> builder.persistent(PaintingVariant.CODEC).networkSynchronized(PaintingVariant.STREAM_CODEC) ); public static final DataComponentType LLAMA_VARIANT = register( "llama/variant", builder -> builder.persistent(Llama.Variant.CODEC).networkSynchronized(Llama.Variant.STREAM_CODEC) ); public static final DataComponentType AXOLOTL_VARIANT = register( "axolotl/variant", builder -> builder.persistent(Axolotl.Variant.CODEC).networkSynchronized(Axolotl.Variant.STREAM_CODEC) ); public static final DataComponentType> CAT_VARIANT = register( "cat/variant", builder -> builder.persistent(CatVariant.CODEC).networkSynchronized(CatVariant.STREAM_CODEC) ); public static final DataComponentType CAT_COLLAR = register( "cat/collar", builder -> builder.persistent(DyeColor.CODEC).networkSynchronized(DyeColor.STREAM_CODEC) ); public static final DataComponentType SHEEP_COLOR = register( "sheep/color", builder -> builder.persistent(DyeColor.CODEC).networkSynchronized(DyeColor.STREAM_CODEC) ); public static final DataComponentType SHULKER_COLOR = register( "shulker/color", builder -> builder.persistent(DyeColor.CODEC).networkSynchronized(DyeColor.STREAM_CODEC) ); public static final DataComponentMap COMMON_ITEM_COMPONENTS = DataComponentMap.builder() .set(MAX_STACK_SIZE, 64) .set(LORE, ItemLore.EMPTY) .set(ENCHANTMENTS, ItemEnchantments.EMPTY) .set(REPAIR_COST, 0) .set(ATTRIBUTE_MODIFIERS, ItemAttributeModifiers.EMPTY) .set(RARITY, Rarity.COMMON) .set(BREAK_SOUND, SoundEvents.ITEM_BREAK) .set(TOOLTIP_DISPLAY, TooltipDisplay.DEFAULT) .build(); public static DataComponentType bootstrap(Registry> registry) { return CUSTOM_DATA; } private static DataComponentType register(String name, UnaryOperator> builder) { return Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, name, ((Builder)builder.apply(DataComponentType.builder())).build()); } }