30 lines
975 B
Java
30 lines
975 B
Java
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> bannerPattern;
|
|
|
|
public BannerPatternItem(TagKey<BannerPattern> bannerPattern, Item.Properties properties) {
|
|
super(properties);
|
|
this.bannerPattern = bannerPattern;
|
|
}
|
|
|
|
public TagKey<BannerPattern> getBannerPattern() {
|
|
return this.bannerPattern;
|
|
}
|
|
|
|
@Override
|
|
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
|
tooltipComponents.add(this.getDisplayName().withStyle(ChatFormatting.GRAY));
|
|
}
|
|
|
|
public MutableComponent getDisplayName() {
|
|
return Component.translatable(this.getDescriptionId() + ".desc");
|
|
}
|
|
}
|