valence/crates/valence_block
Ben 81044440dd
Use a struct to store block collision shapes (#334)
## Description

Created a new CollisionShape struct for blocks (was previously an [f64;
6]).

## Test Plan

Explain the steps necessary to test your changes. If you used a
playground, include the code in the details below.

Steps:
1. Run the following code

<details>

<summary>Playground</summary>

```rust
use valence_block;

fn main() {
    let shapes = valence_block::BlockState::STONE.collision_shapes();
    println!("{:?}", shapes.collect::<Vec<_>>());
    // [CollisionShape { min_x: 0.0, min_y: 0.0, min_z: 0.0, max_x: 1.0, max_y: 1.0, max_z: 1.0 }]
    let shapes = valence_block::BlockState::OAK_STAIRS.collision_shapes();
    println!("{:?}", shapes.collect::<Vec<_>>());
    // [CollisionShape { min_x: 0.0, min_y: 0.0, min_z: 0.0, max_x: 1.0, max_y: 0.5, max_z: 1.0 }, CollisionShape { min_x: 0.0, min_y: 0.5, min_z: 0.0, max_x: 1.0, max_y: 1.0, max_z: 0.5 }]
}
```

</details>
2023-05-22 01:29:59 -07:00
..
src Reorganize Project (#321) 2023-04-21 14:43:59 -07:00
build.rs Use a struct to store block collision shapes (#334) 2023-05-22 01:29:59 -07:00
Cargo.toml Use a struct to store block collision shapes (#334) 2023-05-22 01:29:59 -07:00
README.md Reorganize Project (#321) 2023-04-21 14:43:59 -07:00

valence_block

Everything related to Minecraft blocks. Primarily concerned with the [BlockState] type.