aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src/direction.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-11-12 04:26:02 +0330
committermat <git@matdoes.dev>2025-11-11 18:56:14 -0600
commita4312599f7c04709a92b7be238dcf577bafbb14f (patch)
treebef58dca34239bac54649ab1e0db2597de10212c /azalea-core/src/direction.rs
parentac2b425615dd6cd8562c290e33b06e553559802d (diff)
downloadazalea-drasl-a4312599f7c04709a92b7be238dcf577bafbb14f.tar.xz
cleanup
- remove deprecated code - add `[lints] workspace=true` to every Cargo.toml, to make modifying clippy lints easier for later - remove some unnecessary #[allow]s - use Vec3i in some parts of the collision code
Diffstat (limited to 'azalea-core/src/direction.rs')
-rw-r--r--azalea-core/src/direction.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/azalea-core/src/direction.rs b/azalea-core/src/direction.rs
index c794c79a..fbd7f98b 100644
--- a/azalea-core/src/direction.rs
+++ b/azalea-core/src/direction.rs
@@ -1,6 +1,6 @@
use azalea_buf::AzBuf;
-use crate::position::{BlockPos, Vec3};
+use crate::position::{BlockPos, Vec3, Vec3i};
#[derive(
Clone, Copy, Debug, AzBuf, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize,
@@ -220,11 +220,11 @@ impl AxisCycle {
Self::Backward => Axis::from_ordinal(i32::rem_euclid(axis as i32 - 1, 3) as u32),
}
}
- pub fn cycle_xyz(self, x: i32, y: i32, z: i32, axis: Axis) -> i32 {
+ pub fn cycle_xyz(self, pos: Vec3i, axis: Axis) -> i32 {
match self {
- Self::None => axis.choose(x, y, z),
- Self::Forward => axis.choose(z, x, y),
- Self::Backward => axis.choose(y, z, x),
+ Self::None => axis.choose(pos.x, pos.y, pos.z),
+ Self::Forward => axis.choose(pos.z, pos.x, pos.y),
+ Self::Backward => axis.choose(pos.y, pos.z, pos.x),
}
}
}