diff options
| author | mat <git@matdoes.dev> | 2025-10-12 23:01:54 +0300 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-10-12 23:01:54 +0300 |
| commit | ee2575794e91b9457a74a95daf1dcc707058cd58 (patch) | |
| tree | df725850ef18ded5ce3f6552e17095d0f704ae84 /azalea-core | |
| parent | 1a1402954b07cd77615d0afc026c73b008787f51 (diff) | |
| download | azalea-drasl-ee2575794e91b9457a74a95daf1dcc707058cd58.tar.xz | |
upgrade deps and clean up lots of doc comments
Diffstat (limited to 'azalea-core')
| -rw-r--r-- | azalea-core/src/game_type.rs | 2 | ||||
| -rw-r--r-- | azalea-core/src/position.rs | 23 | ||||
| -rw-r--r-- | azalea-core/src/registry_holder.rs | 5 |
3 files changed, 18 insertions, 12 deletions
diff --git a/azalea-core/src/game_type.rs b/azalea-core/src/game_type.rs index 0b249246..db1d6bc5 100644 --- a/azalea-core/src/game_type.rs +++ b/azalea-core/src/game_type.rs @@ -24,7 +24,7 @@ impl GameMode { } } - /// Get the id of the game type, but return -1 if the game type is invalid. + /// Get the ID of the game mode, but return -1 if the game type is invalid. pub fn to_optional_id<T: Into<Option<GameMode>>>(game_type: T) -> i8 { match game_type.into() { Some(game_type) => game_type.to_id() as i8, diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index 9aebd80b..7feb24d2 100644 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -484,8 +484,9 @@ pub struct Vec3i { pub z: i32, } -/// Chunk coordinates are used to represent where a chunk is in the world. You -/// can convert the x and z to block coordinates by multiplying them by 16. +/// Chunk coordinates are used to represent where a chunk is in the world. +/// +/// You can convert the x and z to block coordinates by multiplying them by 16. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct ChunkPos { pub x: i32, @@ -556,8 +557,8 @@ impl Hash for ChunkPos { u64::from(*self).hash(state); } } -/// nohash_hasher lets us have IntMap<ChunkPos, _> which is significantly faster -/// than a normal HashMap +/// `nohash_hasher` lets us have IntMap<ChunkPos, _> which is significantly +/// faster than a normal HashMap impl nohash_hasher::IsEnabled for ChunkPos {} /// The coordinates of a chunk section in the world. @@ -612,8 +613,9 @@ impl From<ChunkBlockPos> for u64 { } impl nohash_hasher::IsEnabled for ChunkBlockPos {} -/// The coordinates of a block inside a chunk section. Each coordinate should be -/// in the range 0..=15. +/// The coordinates of a block inside of a chunk section. +/// +/// Each coordinate should be in the range 0..=15. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct ChunkSectionBlockPos { pub x: u8, @@ -622,8 +624,9 @@ pub struct ChunkSectionBlockPos { } vec3_impl!(ChunkSectionBlockPos, u8); -/// The coordinates of a chunk inside a chunk section. Each coordinate should be -/// in the range 0..=3. +/// The coordinates of a biome inside of a chunk section. +/// +/// Each coordinate should be in the range 0..=3. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct ChunkSectionBiomePos { pub x: u8, @@ -648,7 +651,9 @@ impl From<ChunkBiomePos> for ChunkSectionBiomePos { } vec3_impl!(ChunkSectionBiomePos, u8); -/// The coordinates of a biome inside a chunk. Biomes are 4x4 blocks. +/// The coordinates of a biome inside a chunk. +/// +/// Biomes are 4x4 blocks. #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub struct ChunkBiomePos { pub x: u8, diff --git a/azalea-core/src/registry_holder.rs b/azalea-core/src/registry_holder.rs index f5657dc6..7c5bfede 100644 --- a/azalea-core/src/registry_holder.rs +++ b/azalea-core/src/registry_holder.rs @@ -45,8 +45,9 @@ impl RegistryHolder { } } - /// Get the dimension type registry, or `None` if it doesn't exist. You - /// should do some type of error handling if this returns `None`. + /// Get the dimension type registry, or `None` if it doesn't exist. + /// + /// You should do some type of error handling if this returns `None`. pub fn dimension_type(&self) -> Option<RegistryType<DimensionTypeElement>> { let name = ResourceLocation::new("minecraft:dimension_type"); match self.get(&name) { |
