aboutsummaryrefslogtreecommitdiff
path: root/azalea-block/README.md
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-06-02 19:23:59 -0330
committermat <git@matdoes.dev>2025-06-03 06:11:26 +0700
commit7517a207db658c98d5b97b3b3f44df6725c025a2 (patch)
tree5daabe20be53705acd1fee93134421dc23b4d6c6 /azalea-block/README.md
parentabf995a70245028f9cc860ee231dc671f14adfcc (diff)
downloadazalea-drasl-7517a207db658c98d5b97b3b3f44df6725c025a2.tar.xz
rename the Block trait to BlockTrait to disambiguate with azalea_registry::Block
Diffstat (limited to 'azalea-block/README.md')
-rw-r--r--azalea-block/README.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/azalea-block/README.md b/azalea-block/README.md
index ae3b8c5f..8eca79ee 100644
--- a/azalea-block/README.md
+++ b/azalea-block/README.md
@@ -23,20 +23,20 @@ let block_state: BlockState = azalea_block::blocks::CobblestoneWall {
let block_state: BlockState = azalea_registry::Block::Jukebox.into();
```
-## Block trait
+## BlockTrait
-The [`Block`] trait represents a type of a block. With the the [`Block`] trait, you can get some extra things like the string block ID and some information about the block's behavior. Also, the structs that implement the trait contain the block attributes as fields so it's more convenient to get them. Note that this is often used as `Box<dyn Block>`.
-If for some reason you don't want the `Block` trait, set default-features to false.
+The [`BlockTrait`] trait represents a type of a block. With [`BlockTrait`], you can get some extra things like the string block ID and some information about the block's behavior. Also, the structs that implement the trait contain the block attributes as fields so it's more convenient to get them. Note that this is often used as `Box<dyn BlockTrait>`.
+If for some reason you don't want `BlockTrait`, set `default-features = false`.
```
-# use azalea_block::{Block, BlockState};
+# use azalea_block::{BlockTrait, BlockState};
# let block_state = BlockState::from(azalea_registry::Block::Jukebox);
-let block = Box::<dyn Block>::from(block_state);
+let block = Box::<dyn BlockTrait>::from(block_state);
```
```
-# use azalea_block::{Block, BlockState};
+# use azalea_block::{BlockTrait, BlockState};
# let block_state: BlockState = azalea_registry::Block::Jukebox.into();
-if let Some(jukebox) = Box::<dyn Block>::from(block_state).downcast_ref::<azalea_block::blocks::Jukebox>() {
+if let Some(jukebox) = Box::<dyn BlockTrait>::from(block_state).downcast_ref::<azalea_block::blocks::Jukebox>() {
// ...
}
```