pub(crate) use ghast_data::v26_2 as data;
pub(crate) use ghast_entity::v26_2 as entity;
pub(crate) use ghast_physics::modern::V26_2 as Rules;
pub(crate) use ghast_physics::modern::piston::v26_2 as pistons;
pub(crate) use ghast_physics::modern::{collides_26_1 as collides, push_kind_26_1 as push_kind};
pub(crate) use ghast_physics::pick::v26_2 as pick;
pub(crate) use ghast_protocol::v26_2 as proto;
pub(crate) use ghast_world::v26_2 as world;
use crate::version::GameVersion;
pub(crate) const GAME: GameVersion = GameVersion::V26_2;
pub(crate) const TEAM_LAYOUT: super::teams::TeamLayout = super::teams::TeamLayout::AffixesFirst;
pub(crate) mod meta {
pub(crate) const SHARED_FLAGS: u8 = 0;
pub(crate) const LIVING_FLAGS: u8 = 8;
pub(crate) const ATTACHED_TO_TARGET: u8 = 9;
pub(crate) const PLAYER_MAIN_HAND: u8 = 15;
pub(crate) const BABY: u8 = 16;
pub(crate) const MOUNT_FLAGS: u8 = 18;
}
pub(crate) mod effects {
pub(crate) const JUMP_BOOST: i8 = 8;
pub(crate) const BLINDNESS: i8 = 15;
pub(crate) const LEVITATION: i8 = 25;
pub(crate) const SLOW_FALLING: i8 = 28;
pub(crate) const CONDUIT_POWER: i8 = 29;
pub(crate) const DOLPHINS_GRACE: i8 = 30;
pub(crate) const WEAVING: i8 = 37;
}
pub(crate) mod inv {
use ghast_inventory::Stack;
use ghast_inventory::modern as m;
pub(crate) use m::Equip;
const V: ghast_inventory::Version = ghast_inventory::Version::V26_2;
#[inline]
pub(crate) fn item_name(id: i32) -> Option<&'static str> {
m::item_name(V, id)
}
#[inline]
pub(crate) fn item_use(s: &Stack) -> Option<m::ItemUse> {
m::item_use(V, s)
}
#[inline]
pub(crate) fn next_damage_will_break(s: &Stack) -> bool {
m::next_damage_will_break(V, s)
}
#[inline]
pub(crate) fn can_glide_using(s: &Stack, slot: Equip) -> bool {
m::can_glide_using(V, s, slot)
}
}
#[allow(clippy::duplicate_mod)]
#[path = "modern.rs"]
mod imp;
pub(crate) use imp::{ModernSim as Sim262, dig_progress, held_item_facts};
pub(crate) fn exact_dig(m: crate::hands::ModernDig) -> crate::hands::ExactDig {
crate::hands::ExactDig::V26_2(m)
}
pub(crate) fn inv_trident_strength(
inv: &mut ghast_inventory::Inventory,
s: &ghast_inventory::Stack,
) -> Option<f32> {
inv.trident_spin_attack_strength_modern(s)
}
#[cfg(test)]
mod tests {
#[test]
fn entity_ids_by_name() {
let (h, l, n, f) = super::imp::entity_ids_for_test();
assert!(
h.iter().chain(&l).chain(&n).all(|&i| i >= 0),
"{h:?} {l:?} {n:?}"
);
let id = |s: &str| i32::from(super::data::entity_by_name(s).unwrap().id);
assert_eq!(
(h[0], l[0], n[0], f),
(
id("horse"),
id("llama"),
id("nautilus"),
id("firework_rocket")
)
);
}
}