From 39f4d68e1ff1f0fa0d45663335d83299d5d37790 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 5 Dec 2024 06:30:47 +0000 Subject: fix container_set_content, player_position, and recipe_book_remove packets --- azalea-core/src/math.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'azalea-core/src/math.rs') diff --git a/azalea-core/src/math.rs b/azalea-core/src/math.rs index 7c0ac7b4..62215749 100644 --- a/azalea-core/src/math.rs +++ b/azalea-core/src/math.rs @@ -68,6 +68,15 @@ pub fn fract(x: f64) -> f64 { x - floor } +// these are copied from the java standard library, we don't calculate the +// consts ourself to make sure it's the same as java +pub fn to_radians(degrees: f64) -> f64 { + degrees * 0.017453292519943295 +} +pub fn to_degrees(radians: f64) -> f64 { + radians * 57.29577951308232 +} + #[cfg(test)] mod tests { use super::*; -- cgit v1.2.3