aboutsummaryrefslogtreecommitdiff
path: root/azalea-core/src
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-02-24 06:02:11 -0600
committermat <git@matdoes.dev>2024-02-24 06:02:11 -0600
commit4eeda83ba4bdb5e20c765a46e43227f4f9b39b69 (patch)
tree479d06d13870c17abfda96d704b21cc2eb85488b /azalea-core/src
parent64fceff1cc65ee1dd1c72f08004e40179be9f9a4 (diff)
downloadazalea-drasl-4eeda83ba4bdb5e20c765a46e43227f4f9b39b69.tar.xz
add some more convenience functions
Diffstat (limited to 'azalea-core/src')
-rwxr-xr-xazalea-core/src/position.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs
index e9864035..369607c5 100755
--- a/azalea-core/src/position.rs
+++ b/azalea-core/src/position.rs
@@ -186,6 +186,25 @@ macro_rules! vec3_impl {
}
}
}
+
+ impl From<($type, $type, $type)> for $name {
+ #[inline]
+ fn from(pos: ($type, $type, $type)) -> Self {
+ Self::new(pos.0, pos.1, pos.2)
+ }
+ }
+ impl From<&($type, $type, $type)> for $name {
+ #[inline]
+ fn from(pos: &($type, $type, $type)) -> Self {
+ Self::new(pos.0, pos.1, pos.2)
+ }
+ }
+ impl From<$name> for ($type, $type, $type) {
+ #[inline]
+ fn from(pos: $name) -> Self {
+ (pos.x, pos.y, pos.z)
+ }
+ }
};
}