From f12589ab809ece7dfd34c58b2ddc67dd5801ccb3 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 26 Jun 2025 15:24:41 +0930 Subject: fix invalid look directions on teleport --- azalea-entity/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'azalea-entity/src/lib.rs') diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index b8644546..340b6f25 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -226,8 +226,10 @@ pub struct LookDirection { } impl LookDirection { + /// Create a new look direction, while clamping and wrapping the rotations + /// to the allowed values. pub fn new(y_rot: f32, x_rot: f32) -> Self { - Self { y_rot, x_rot } + apply_clamp_look_direction(Self { y_rot, x_rot }) } } -- cgit v1.2.3