use bytes::Bytes;
use crate::stack::Stack;
use crate::tables::Mv;
use crate::window::WindowKind;
pub use crate::item26::{
Equip, Food, HashRegistries, ItemDefaults, ItemUse, UNKNOWN_HASH, UseAnimation,
enchantment_specs,
};
pub use crate::tables::g261::{
ATTRIBUTES, COMPONENT_NAMES, ITEM_COUNT, MENUS, POTIONS, SOUND_EVENTS, VILLAGER_TYPES,
component,
};
const M: Mv = Mv::V26_1;
#[must_use]
pub fn item_name(id: i32) -> Option<&'static str> {
crate::item26::item_name(M, id)
}
#[must_use]
pub fn defaults(id: i32) -> Option<&'static ItemDefaults> {
crate::item26::defaults(M, id)
}
#[must_use]
pub fn item_id(name: &str) -> Option<i32> {
crate::item26::item_id(M, name)
}
#[must_use]
pub fn component_id(name: &str) -> Option<i32> {
crate::item26::component_id(M, name)
}
#[must_use]
pub fn window_kind(menu: i32) -> Option<WindowKind> {
crate::item26::window_kind(M, menu)
}
#[must_use]
pub fn glider(s: &Stack) -> Option<Equip> {
crate::item26::glider(M, s)
}
#[must_use]
pub fn next_damage_will_break(s: &Stack) -> bool {
crate::item26::next_damage_will_break(M, s)
}
#[must_use]
pub fn can_glide_using(s: &Stack, slot: Equip) -> bool {
crate::item26::can_glide_using(M, s, slot)
}
#[must_use]
pub fn item_use(s: &Stack) -> Option<ItemUse> {
crate::item26::item_use(M, s)
}
#[must_use]
pub fn component_hash(ty: i32, value: &Bytes, regs: &HashRegistries) -> Option<i32> {
crate::item26::component_hash(ty, value, M, regs)
}
#[must_use]
pub fn hash_covers(ty: i32) -> bool {
crate::item26::hash_covers(M, ty)
}
#[must_use]
pub fn hashed_slot(
s: Option<&Stack>,
reg: &HashRegistries,
) -> (Option<ghast_protocol::defs::p775::types::HashedSlot>, bool) {
let (h, exact) = crate::item26::hashed(M, s, reg);
(h.map(crate::packets::hashed_775), exact)
}