package net.minecraft.world.item; import java.util.List; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.tags.TagKey; import net.minecraft.world.level.block.entity.BannerPattern; public class BannerPatternItem extends Item { private final TagKey bannerPattern; public BannerPatternItem(TagKey bannerPattern, Item.Properties properties) { super(properties); this.bannerPattern = bannerPattern; } public TagKey getBannerPattern() { return this.bannerPattern; } @Override public void appendHoverText(ItemStack stack, Item.TooltipContext context, List tooltipComponents, TooltipFlag tooltipFlag) { tooltipComponents.add(this.getDisplayName().withStyle(ChatFormatting.GRAY)); } public MutableComponent getDisplayName() { return Component.translatable(this.getDescriptionId() + ".desc"); } }