From 000e676b57d864a3abb4042a60d913ffab9e163c Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Mon, 12 Oct 2026 17:06:36 +0200 Subject: [PATCH] Compare the warden's animations and emissive layers with vanilla The entity model harness now sets the warden's render state (tendril and heart animation, the roar, sniff, emerge, dig, attack and sonic boom animation states) and bakes its four emissive layers (tendrils, heart, bioluminescent skin, pulsating spots) over WardenModel: 430 cases match. Co-Authored-By: Claude Opus 5.5 --- .../examples/entity_anim_fixture.rs | 22 +++++++++++++++++++ crates/horizon-client/src/mobs/warden.rs | 16 +++++++------- tools/test_entity_model_parity.py | 8 +++++++ 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/crates/horizon-client/examples/entity_anim_fixture.rs b/crates/horizon-client/examples/entity_anim_fixture.rs index 4864a680f..4b1957d23 100644 --- a/crates/horizon-client/examples/entity_anim_fixture.rs +++ b/crates/horizon-client/examples/entity_anim_fixture.rs @@ -173,6 +173,23 @@ fn entity_state(mob: &mut Mob, species: Species, case: &Value) { mob.anim.states[i].started = case[k].as_f64().map(|v| v as f32); } } + Species::Warden => { + use horizon_client::mobs::warden; + mob.anim.v[warden::TENDRIL] = num("tendrilAnimation") * 10.0; + mob.anim.vo[warden::TENDRIL] = num("tendrilAnimation") * 10.0; + mob.anim.v[warden::HEART] = num("heartAnimation") * 10.0; + mob.anim.vo[warden::HEART] = num("heartAnimation") * 10.0; + for (i, k) in [ + (warden::ROAR, "roarAnimationState"), + (warden::SNIFF, "sniffAnimationState"), + (warden::EMERGE, "emergeAnimationState"), + (warden::DIGGING, "diggingAnimationState"), + (warden::ATTACK, "attackAnimationState"), + (warden::SONIC_BOOM, "sonicBoomAnimationState"), + ] { + mob.anim.states[i].started = case[k].as_f64().map(|v| v as f32); + } + } Species::Witch if flag("isHoldingItem") => { mob.extra.main_hand = Some("minecraft:potion".into()); } @@ -222,6 +239,11 @@ fn main() -> horizon_client::Result<()> { || d.model == base || d.model.trim_end_matches("#main") == base.trim_end_matches("#main") || norm(d.model) == base + // The warden's emissive layers are its model over other parts. + || (["#tendrils", "#heart", "#bioluminescent", "#pulsating_spots"] + .iter() + .any(|s| layer.ends_with(s)) + && d.model == format!("{}#main", layer.split('#').next().unwrap_or_default())) }) else { out.push_str(&format!("{}\n", json!({"skip": "no species"}))); continue; diff --git a/crates/horizon-client/src/mobs/warden.rs b/crates/horizon-client/src/mobs/warden.rs index f92e02f7a..11394a011 100644 --- a/crates/horizon-client/src/mobs/warden.rs +++ b/crates/horizon-client/src/mobs/warden.rs @@ -39,15 +39,15 @@ pub const DARKNESS_DURATION: i32 = 260; pub const DARKNESS_REAPPLY: i32 = 200; // AnimState keyframe slots. -const ROAR: usize = 0; -const SNIFF: usize = 1; -const EMERGE: usize = 2; -const DIGGING: usize = 3; -const ATTACK: usize = 4; -const SONIC_BOOM: usize = 5; +pub const ROAR: usize = 0; +pub const SNIFF: usize = 1; +pub const EMERGE: usize = 2; +pub const DIGGING: usize = 3; +pub const ATTACK: usize = 4; +pub const SONIC_BOOM: usize = 5; // AnimState values: tendril and heart animation (ticks, 10 at the start). -const TENDRIL: usize = 0; -const HEART: usize = 1; +pub const TENDRIL: usize = 0; +pub const HEART: usize = 1; #[derive(Clone, Copy, Debug, PartialEq, Eq, Default)] pub enum Pose { diff --git a/tools/test_entity_model_parity.py b/tools/test_entity_model_parity.py index 9f5d1090a..277ea628e 100644 --- a/tools/test_entity_model_parity.py +++ b/tools/test_entity_model_parity.py @@ -54,6 +54,9 @@ EXTRAS = [ ('minecraft:skeleton_horse_baby#main', 'BabyHorseModel'), ('minecraft:zombie_horse_baby#main', 'BabyHorseModel'), ('minecraft:cave_spider#main', 'SpiderModel'), ('minecraft:stray#main', 'SkeletonModel'), + # The warden's emissive layers: its model over each layer's own parts. + ('minecraft:warden#tendrils', 'WardenModel'), ('minecraft:warden#heart', 'WardenModel'), + ('minecraft:warden#bioluminescent', 'WardenModel'), ('minecraft:warden#pulsating_spots', 'WardenModel'), ] # Layers a renderer reuses for another entity under a different constant. SKIP_LAYERS = re.compile(r'(banner|bell|book|skull|head|chest|shulker_box|boat|cushion|conduit|leash|arrow|trident|' @@ -189,6 +192,11 @@ SPECIES = { {'tongueAnimationState': 3}, {'swimIdleAnimationState': 2, 'isSwimming': T}], 'rabbit': [{'hopAnimationState': 2}, {'idleHeadTiltAnimationState': 1}], 'fox': FOX, + 'warden': [{'tendrilAnimation': 0.7}, {'tendrilAnimation': 1.0, 'heartAnimation': 0.4}, {'heartAnimation': 1.0}] + + [{state: start} for state in ('roarAnimationState', 'sniffAnimationState', 'emergeAnimationState', + 'diggingAnimationState', 'attackAnimationState', 'sonicBoomAnimationState') + for start in (50, 20, 100)] + + [{'attackAnimationState': 50, 'tendrilAnimation': 0.3, 'roarAnimationState': 40}], }