diff options
| author | mat <git@matdoes.dev> | 2025-06-02 19:23:59 -0330 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-03 06:11:26 +0700 |
| commit | 7517a207db658c98d5b97b3b3f44df6725c025a2 (patch) | |
| tree | 5daabe20be53705acd1fee93134421dc23b4d6c6 /azalea-block/src/lib.rs | |
| parent | abf995a70245028f9cc860ee231dc671f14adfcc (diff) | |
| download | azalea-drasl-7517a207db658c98d5b97b3b3f44df6725c025a2.tar.xz | |
rename the Block trait to BlockTrait to disambiguate with azalea_registry::Block
Diffstat (limited to 'azalea-block/src/lib.rs')
| -rw-r--r-- | azalea-block/src/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/azalea-block/src/lib.rs b/azalea-block/src/lib.rs index fdffe372..4f929cd3 100644 --- a/azalea-block/src/lib.rs +++ b/azalea-block/src/lib.rs @@ -15,7 +15,7 @@ pub use block_state::BlockState; pub use generated::{blocks, properties}; pub use range::BlockStates; -pub trait Block: Debug + Any { +pub trait BlockTrait: Debug + Any { fn behavior(&self) -> BlockBehavior; /// Get the Minecraft ID for this block. For example `stone` or /// `grass_block`. @@ -27,8 +27,8 @@ pub trait Block: Debug + Any { /// `azalea_registry::Block` doesn't contain any state data. fn as_registry_block(&self) -> azalea_registry::Block; } -impl dyn Block { - pub fn downcast_ref<T: Block>(&self) -> Option<&T> { +impl dyn BlockTrait { + pub fn downcast_ref<T: BlockTrait>(&self) -> Option<&T> { (self as &dyn Any).downcast_ref::<T>() } } |
