diff --git a/crates/horizon-client/src/game/copper_golems.rs b/crates/horizon-client/src/game/copper_golems.rs index 3cdc3b745..e1acaebaf 100644 --- a/crates/horizon-client/src/game/copper_golems.rs +++ b/crates/horizon-client/src/game/copper_golems.rs @@ -705,7 +705,7 @@ impl Game<'_> { } false } - pub(super) fn golem_shearable(&self, index: usize) -> bool { + fn golem_shearable(&self, index: usize) -> bool { self.mobs[index].extra.legs.as_deref().is_some_and(|a| { self.res .items diff --git a/crates/horizon-client/src/game/dispenser.rs b/crates/horizon-client/src/game/dispenser.rs index a7f829912..5b4819ef0 100644 --- a/crates/horizon-client/src/game/dispenser.rs +++ b/crates/horizon-client/src/game/dispenser.rs @@ -217,19 +217,11 @@ pub(super) fn body_in_head(s: Species) -> bool { || matches!(s, Species::Wolf | Species::HappyGhast | Species::SulfurCube) || horizon_client::mobs::nautilus::is_nautilus(s) } -/// Mobs whose saddle slot Horizon keeps in `extra.legs` (the copper -/// golem's antenna, `EQUIPMENT_SLOT_ANTENNA`). -fn saddle_in_legs(s: Species) -> bool { - s == Species::CopperGolem -} /// What a mob holds in a slot. pub(super) fn mob_slot_item(m: &Mob, slot: Slot) -> Option> { let x = &m.extra; let body = body_in_head(m.species()); - let antenna = saddle_in_legs(m.species()); match slot { - Slot::Saddle if antenna => x.legs.clone(), - Slot::Legs if antenna => None, Slot::MainHand => x.main_hand.clone(), Slot::OffHand => x.off_hand.clone(), Slot::Feet => x.feet.clone(), @@ -301,10 +293,8 @@ fn equip_sound(m: &Mob, slot: Slot, default: Option) -> Option { } pub(super) fn mob_set_slot(m: &mut Mob, slot: Slot, stack: ItemStack) { let item: Arc = stack.item.clone(); - let antenna = saddle_in_legs(m.species()); let x = &mut m.extra; match slot { - Slot::Saddle if antenna => x.legs = Some(item), Slot::MainHand => x.main_hand = Some(item), Slot::OffHand => x.off_hand = Some(item), Slot::Feet => x.feet = Some(item), @@ -1680,14 +1670,6 @@ impl Game<'_> { let at = m.position; let sound_at = Some([at.x, at.y, at.z]); match m.species() { - Species::CopperGolem if self.golem_shearable(i) => { - // CopperGolem.shear: the antenna (the saddle slot) drops 1.5 up. - self.audio - .play("minecraft:entity.copper_golem.shear", sound_at, 1.0, 1.0); - if let Some(antenna) = self.mobs[i].extra.legs.take() { - self.spawn_at_location(at, 1.5, ItemStack::new(&antenna, 1)); - } - } Species::SulfurCube if sulfur_cube::has_body(m) => { // SulfurCube.shear: the swallowed block comes out at the // passenger attachment, and nothing is swallowed for 5 s. @@ -1803,15 +1785,15 @@ impl Game<'_> { Target::Mob(i) => { let m = &self.mobs[i]; let b = m.bounds(); - (Holder::Mob(m.id), (b.min + b.max) * 0.5, Some(i)) + (Holder::Mob(m.id), b.center(), Some(i)) } Target::Player => { let Some(v) = self.player_view() else { return false }; - (Holder::Player, (v.bounds.min + v.bounds.max) * 0.5, None) + (Holder::Player, v.bounds.center(), None) } Target::Stand(_) => return false, }; - let area = Aabb::new(centre - Vec3::new(16.0, 16.0, 16.0), centre + Vec3::new(16.0, 16.0, 16.0)); + let area = Aabb::new(centre, centre).inflate(Vec3::new(16.0, 16.0, 16.0)); let mut leashed: Vec<(u32, usize)> = self .mobs .iter() @@ -1825,7 +1807,7 @@ impl Game<'_> { return false; } // Leashable.dropLeash: a lead item at the leashed entity's feet. - let mut drop = |game: &mut Self, j: usize| { + let drop = |game: &mut Self, j: usize| { if game.mobs[j].extra.leash.take().is_some() { let at = game.mobs[j].position; game.spawn_at_location(at, 0.0, ItemStack::new("minecraft:lead", 1)); diff --git a/crates/horizon-client/src/game/leads.rs b/crates/horizon-client/src/game/leads.rs index 69bebac5b..77ccc9a97 100644 --- a/crates/horizon-client/src/game/leads.rs +++ b/crates/horizon-client/src/game/leads.rs @@ -8,7 +8,6 @@ use horizon_client::{ mesher::Vertex, mobs::leash::{self, Holder, Pending}, }; -use horizon_core::random::RandomSource; use horizon_world::nbt::Tag; /// `Vec3.yRot(angle)`. diff --git a/tools/test_dispenser_parity.py b/tools/test_dispenser_parity.py index c6e130697..59c434eaf 100644 --- a/tools/test_dispenser_parity.py +++ b/tools/test_dispenser_parity.py @@ -251,7 +251,7 @@ def main(): str(resources), str(work / 'cases.jsonl'), str(work / 'native.txt')]) run(['cargo', 'build', '-q', '--release', '-p', 'horizon-client', '--bin', 'horizon-client'], cwd=lab.ROOT, env={**os.environ, 'CARGO_BUILD_JOBS': os.environ.get('CARGO_BUILD_JOBS', '3')}) - run([str(lab.ROOT / 'target/release/horizon-client'), '--resources', str(resources)], cwd=work, + run([str(lab.cargo_target() / 'release/horizon-client'), '--resources', str(resources)], cwd=work, env={**os.environ, 'HORIZON_DISPENSE_FIXTURE': f'{work / "cases.jsonl"},{work / "rust.txt"}', 'HORIZON_NO_AUDIO': '1'}) # Loot table names (D) are vanilla's bookkeeping; the drops themselves are compared. ignore = tuple(prefix + ' ' for prefix in args.ignore.split(',') if prefix) + ('D ',)