20 lines
701 B
Java
20 lines
701 B
Java
package net.minecraft.world.item;
|
|
|
|
import java.util.List;
|
|
import net.minecraft.core.component.DataComponents;
|
|
import net.minecraft.network.chat.Component;
|
|
import net.minecraft.world.item.component.FireworkExplosion;
|
|
|
|
public class FireworkStarItem extends Item {
|
|
public FireworkStarItem(Item.Properties properties) {
|
|
super(properties);
|
|
}
|
|
|
|
@Override
|
|
public void appendHoverText(ItemStack stack, Item.TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
|
|
FireworkExplosion fireworkExplosion = stack.get(DataComponents.FIREWORK_EXPLOSION);
|
|
if (fireworkExplosion != null) {
|
|
fireworkExplosion.addToTooltip(context, tooltipComponents::add, tooltipFlag);
|
|
}
|
|
}
|
|
}
|