aboutsummaryrefslogtreecommitdiff
path: root/azalea-block/src/lib.rs
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2025-12-12 00:56:02 -0600
committerGitHub <noreply@github.com>2025-12-12 00:56:02 -0600
commitf9c25665c203d6377ace62f1e95381d037d8fd9e (patch)
tree8b4131d20fe661d3cc1175ec27f801fe61df41ea /azalea-block/src/lib.rs
parent82ad975242292d5875780b4398b62637674bf50a (diff)
downloadazalea-drasl-f9c25665c203d6377ace62f1e95381d037d8fd9e.tar.xz
Refactor azalea-registry (#294)
* move registries in azalea-registry into separate modules * rename Item and Block to ItemKind and BlockKind * remove 'extra' registries from azalea-registry * hide deprecated items from docs * use DamageKindKey instead of Identifier when parsing registries * store tag entries as a Vec instead of a HashSet * sort tag values by protocol id * update changelog
Diffstat (limited to 'azalea-block/src/lib.rs')
-rw-r--r--azalea-block/src/lib.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/azalea-block/src/lib.rs b/azalea-block/src/lib.rs
index 2cab022e..ad78102c 100644
--- a/azalea-block/src/lib.rs
+++ b/azalea-block/src/lib.rs
@@ -9,6 +9,7 @@ mod range;
use core::fmt::Debug;
use std::{any::Any, collections::HashMap};
+use azalea_registry::builtin::BlockKind;
pub use behavior::BlockBehavior;
// re-exported for convenience
pub use block_state::BlockState;
@@ -21,16 +22,16 @@ pub trait BlockTrait: Debug + Any {
///
/// For example, `stone` or `grass_block`.
fn id(&self) -> &'static str;
- /// Convert the block to a block state.
+ /// Convert the block struct to a [`BlockState`].
///
/// This is a lossless conversion, as [`BlockState`] also contains state
/// data.
fn as_block_state(&self) -> BlockState;
- /// Convert the block to an [`azalea_registry::Block`].
+ /// Convert the block struct to a [`BlockKind`].
///
- /// This is a lossy conversion, as [`azalea_registry::Block`] doesn't
- /// contain any state data.
- fn as_registry_block(&self) -> azalea_registry::Block;
+ /// This is a lossy conversion, as [`BlockKind`] doesn't contain any state
+ /// data.
+ fn as_registry_block(&self) -> BlockKind;
/// Returns a map of property names on this block to their values as
/// strings.