fix(entity): use 0.8x width for suffocation box to match vanilla (#2930)

This commit is contained in:
QiuHu
2026-08-29 13:39:32 +08:00
committed by GitHub
parent d439d5e22e
commit 0f0d3b63d6

View File

@@ -1592,7 +1592,14 @@ impl Entity {
let max = aabb.max_block_pos();
let eye_height = self.get_eye_height();
let eye_width = f64::from(self.width()) * 0.8;
let mut eye_level_box = aabb;
let shrink_x = (aabb.max.x - aabb.min.x - eye_width) / 2.0;
let shrink_z = (aabb.max.z - aabb.min.z - eye_width) / 2.0;
eye_level_box.min.x += shrink_x;
eye_level_box.max.x -= shrink_x;
eye_level_box.min.z += shrink_z;
eye_level_box.max.z -= shrink_z;
eye_level_box.min.y += eye_height;
eye_level_box.max.y = eye_level_box.min.y;