1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 23:44:38 +00:00
azalea/azalea-block
Charles Johnson 48b2a37aa0
derive Debug for BlockState (#64)
* derive `Debug` for `BlockState`

* change default Debug for BlockState

---------

Co-authored-by: Ubuntu <github@matdoes.dev>
2023-02-09 11:18:56 -06:00
..
azalea-block-macros derive Debug for BlockState (#64) 2023-02-09 11:18:56 -06:00
src derive Debug for BlockState (#64) 2023-02-09 11:18:56 -06:00
Cargo.toml derive Debug for BlockState (#64) 2023-02-09 11:18:56 -06:00
README.md derive Debug for BlockState (#64) 2023-02-09 11:18:56 -06:00

Azalea Block

Representation of Minecraft block states.

There's two main things here, the BlockState enum and the Block trait. BlockState is a simple enum with every possible block state as variant, and Block is a heavier trait which lets you access information about a block more easily.

Every block is a struct that implements Block. You can freely convert between BlockState and Block with .into().

If you don't want the Block trait, set default-features to false.

Also, by default the Debug implementation for BlockState only logs the name of the block and not the name of the enum variant. If you want that, enable the full-debug feature (though it's not recommended).