Skip to main content

steel_core/behavior/items/
tipped_arrow.rs

1use std::borrow::Cow;
2
3use steel_macros::item_behavior;
4use steel_registry::item_stack::ItemStack;
5use text_components::TextComponent;
6
7use crate::behavior::ItemBehavior;
8
9use super::dynamic_name::potion_name;
10
11/// Tipped-arrow behavior providing Vanilla's potion-content-dependent name.
12// TODO: Add TippedArrowItem's poison default instance when Steel has
13// item-specific default-stack factories.
14// TODO: Implement inherited ArrowItem projectile and dispenser behavior once
15// ProjectileItem dispatch exists.
16#[item_behavior]
17pub struct TippedArrowItem;
18
19impl ItemBehavior for TippedArrowItem {
20    fn get_name<'a>(&self, stack: &'a ItemStack) -> Cow<'a, TextComponent> {
21        potion_name(stack)
22    }
23}