steel_core/behavior/items/
tipped_arrow.rs1use std::borrow::Cow;
2
3use steel_macros::item_behavior;
4use steel_registry::data_components::PotionContents;
5use steel_registry::item_stack::ItemStack;
6use steel_registry::items::ItemRef;
7use steel_registry::vanilla_potions;
8use text_components::TextComponent;
9
10use crate::behavior::ItemBehavior;
11
12use super::dynamic_name::potion_name;
13
14#[item_behavior]
19pub struct TippedArrowItem;
20
21impl ItemBehavior for TippedArrowItem {
22 fn get_name<'a>(&self, stack: &'a ItemStack) -> Cow<'a, TextComponent> {
23 potion_name(stack)
24 }
25
26 fn get_default_instance(&self, item: ItemRef) -> ItemStack {
27 PotionContents::create_item_stack(item, &vanilla_potions::POISON)
28 }
29}