From 4940a2442391aa75d0c83f1a177e6a293e92605a Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Tue, 27 Oct 2026 06:30:20 +0100 Subject: [PATCH] Send the fox's type and flags at indices 18 and 19 Fox extends Animal, and AgeableMob has two entries in 26.3 (DATA_BABY_ID 16, AGE_LOCKED 17): DATA_TYPE_ID is 18 and DATA_FLAGS_ID 19. An int at 17 is the wrong type for AGE_LOCKED's boolean on a vanilla client. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/lan.rs | 10 +++++----- crates/horizon-client/src/game/remote_mob_data.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/horizon-client/src/game/lan.rs b/crates/horizon-client/src/game/lan.rs index 16e2b822d..971052b3d 100644 --- a/crates/horizon-client/src/game/lan.rs +++ b/crates/horizon-client/src/game/lan.rs @@ -244,17 +244,17 @@ fn mob_meta( } defaults.push((18, serializer::BYTE, Value::Byte(0))); } - // Fox.DATA_TYPE_ID and DATA_FLAGS_ID (sleeping 32, ...). + // Fox.DATA_TYPE_ID and DATA_FLAGS_ID (after AgeableMob's two; sleeping 32, ...). "minecraft:fox" => { if e.variant != 0 { - meta.push((17, serializer::INT, Value::Int(i32::from(e.variant)))); + meta.push((18, serializer::INT, Value::Int(i32::from(e.variant)))); } - defaults.push((17, serializer::INT, Value::Int(0))); + defaults.push((18, serializer::INT, Value::Int(0))); let flags = (e.ints[0] & 0xff) as u8 as i8; if flags != 0 { - meta.push((18, serializer::BYTE, Value::Byte(flags))); + meta.push((19, serializer::BYTE, Value::Byte(flags))); } - defaults.push((18, serializer::BYTE, Value::Byte(0))); + defaults.push((19, serializer::BYTE, Value::Byte(0))); } "minecraft:cat" | "minecraft:wolf" => { // TamableAnimal.DATA_FLAGS_ID: sitting 1, tame 4. diff --git a/crates/horizon-client/src/game/remote_mob_data.rs b/crates/horizon-client/src/game/remote_mob_data.rs index 50afac107..98c716c1e 100644 --- a/crates/horizon-client/src/game/remote_mob_data.rs +++ b/crates/horizon-client/src/game/remote_mob_data.rs @@ -62,10 +62,10 @@ fn apply(m: &mut Mob, values: &[(u8, i32, Value)], builtin: &Builtin, local_enti // Bat.DATA_ID_FLAGS: resting in bit 0. (Species::Bat, 16, Value::Byte(flags)) => bat::set_resting(m, flags & 1 != 0), // Fox.DATA_TYPE_ID and DATA_FLAGS_ID. - (Species::Fox, 17, Value::Int(variant)) => { + (Species::Fox, 18, Value::Int(variant)) => { m.extra.variant = (*variant).clamp(0, 1) as u8 } - (Species::Fox, 18, Value::Byte(flags)) => m.extra.ints[0] = i32::from(*flags as u8), + (Species::Fox, 19, Value::Byte(flags)) => m.extra.ints[0] = i32::from(*flags as u8), // Sheep.DATA_WOOL_ID: the colour in the low nibble, 16 sheared. (Species::Sheep, 18, Value::Byte(wool)) => { m.extra.color = (*wool & 15) as u8;