diff options
| author | mat <git@matdoes.dev> | 2023-10-01 15:19:13 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-10-01 15:19:13 -0500 |
| commit | befa33a87950b6d0f3364cb4fe603f6d84bf4b8f (patch) | |
| tree | b46f2b76d4f7c66aef05759d33de68d88904c45b /azalea-core | |
| parent | 33e823d6fab990efaa735c05e4b0c42636003b76 (diff) | |
| download | azalea-drasl-befa33a87950b6d0f3364cb4fe603f6d84bf4b8f.tar.xz | |
organize azalea_core and re-export it from azalea
Diffstat (limited to 'azalea-core')
| -rwxr-xr-x | azalea-core/src/aabb.rs | 9 | ||||
| -rwxr-xr-x | azalea-core/src/block_hit_result.rs | 5 | ||||
| -rwxr-xr-x | azalea-core/src/cursor3d.rs | 2 | ||||
| -rwxr-xr-x | azalea-core/src/delta.rs | 2 | ||||
| -rwxr-xr-x | azalea-core/src/direction.rs | 2 | ||||
| -rwxr-xr-x | azalea-core/src/lib.rs | 43 | ||||
| -rw-r--r-- | azalea-core/src/math.rs | 2 | ||||
| -rwxr-xr-x | azalea-core/src/particle.rs | 2 | ||||
| -rwxr-xr-x | azalea-core/src/position.rs | 8 |
9 files changed, 34 insertions, 41 deletions
diff --git a/azalea-core/src/aabb.rs b/azalea-core/src/aabb.rs index 7ad4a657..61b015cb 100755 --- a/azalea-core/src/aabb.rs +++ b/azalea-core/src/aabb.rs @@ -1,6 +1,9 @@ -use crate::{Axis, BlockHitResult, BlockPos, Direction, Vec3}; - -pub const EPSILON: f64 = 1.0E-7; +use crate::{ + block_hit_result::BlockHitResult, + direction::{Axis, Direction}, + math::EPSILON, + position::{BlockPos, Vec3}, +}; /// A rectangular prism with a starting and ending point. #[derive(Copy, Clone, Debug, PartialEq, Default)] diff --git a/azalea-core/src/block_hit_result.rs b/azalea-core/src/block_hit_result.rs index 3b4f7257..20cc723b 100755 --- a/azalea-core/src/block_hit_result.rs +++ b/azalea-core/src/block_hit_result.rs @@ -1,4 +1,7 @@ -use crate::{BlockPos, Direction, Vec3}; +use crate::{ + direction::Direction, + position::{BlockPos, Vec3}, +}; #[derive(Debug, Clone, Copy, PartialEq)] pub struct BlockHitResult { diff --git a/azalea-core/src/cursor3d.rs b/azalea-core/src/cursor3d.rs index 180301e3..0594a80a 100755 --- a/azalea-core/src/cursor3d.rs +++ b/azalea-core/src/cursor3d.rs @@ -1,4 +1,4 @@ -use crate::BlockPos; +use crate::position::BlockPos; pub struct Cursor3d { index: usize, diff --git a/azalea-core/src/delta.rs b/azalea-core/src/delta.rs index 05bf662a..646bcc95 100755 --- a/azalea-core/src/delta.rs +++ b/azalea-core/src/delta.rs @@ -1,4 +1,4 @@ -use crate::Vec3; +use crate::position::Vec3; pub use azalea_buf::McBuf; pub trait PositionDeltaTrait { diff --git a/azalea-core/src/direction.rs b/azalea-core/src/direction.rs index d3a0e4a9..32e1a23a 100755 --- a/azalea-core/src/direction.rs +++ b/azalea-core/src/direction.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; -use crate::Vec3; +use crate::position::Vec3; #[derive(Clone, Copy, Debug, McBuf, Default, Eq, PartialEq)] pub enum Direction { diff --git a/azalea-core/src/lib.rs b/azalea-core/src/lib.rs index 6554d71d..2595471d 100755 --- a/azalea-core/src/lib.rs +++ b/azalea-core/src/lib.rs @@ -5,37 +5,16 @@ #![allow(incomplete_features)] #![feature(generic_const_exprs)] -mod difficulty; -pub use difficulty::*; - -mod resource_location; -pub use resource_location::*; - -mod game_type; -pub use game_type::*; - -mod position; -pub use position::*; - -mod direction; -pub use direction::*; - -mod delta; -pub use delta::*; - -pub mod particle; - -mod cursor3d; -pub use cursor3d::*; - -mod bitset; -pub use bitset::*; - -mod aabb; -pub use aabb::*; - -mod block_hit_result; -pub use block_hit_result::*; - +pub mod aabb; +pub mod bitset; +pub mod block_hit_result; +pub mod cursor3d; +pub mod delta; +pub mod difficulty; +pub mod direction; +pub mod game_type; pub mod math; +pub mod particle; +pub mod position; +pub mod resource_location; pub mod tier; diff --git a/azalea-core/src/math.rs b/azalea-core/src/math.rs index 01695a0a..83e6020e 100644 --- a/azalea-core/src/math.rs +++ b/azalea-core/src/math.rs @@ -1,5 +1,7 @@ use std::{f64::consts::PI, sync::LazyLock}; +pub const EPSILON: f64 = 1.0E-7; + pub static SIN: LazyLock<[f32; 65536]> = LazyLock::new(|| { let mut sin = [0.0; 65536]; for (i, item) in sin.iter_mut().enumerate() { diff --git a/azalea-core/src/particle.rs b/azalea-core/src/particle.rs index 60128f3f..8e48255f 100755 --- a/azalea-core/src/particle.rs +++ b/azalea-core/src/particle.rs @@ -1,4 +1,4 @@ -use crate::BlockPos; +use crate::position::BlockPos; use azalea_buf::McBuf; use azalea_inventory::ItemSlot; diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index f8072fa4..09b10563 100755 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -1,10 +1,16 @@ -use crate::ResourceLocation; +//! Representations of positions of various things in Minecraft. +//! +//! The most common ones are [`Vec3`] and [`BlockPos`], which are usually used +//! for entity positions and block positions, respectively. + use azalea_buf::{BufReadError, McBuf, McBufReadable, McBufWritable}; use std::{ io::{Cursor, Write}, ops::{Add, AddAssign, Mul, Rem, Sub}, }; +use crate::resource_location::ResourceLocation; + macro_rules! vec3_impl { ($name:ident, $type:ty) => { impl $name { |
