diff options
| author | Ubuntu <github@matdoes.dev> | 2023-02-10 01:56:45 +0000 |
|---|---|---|
| committer | Ubuntu <github@matdoes.dev> | 2023-02-10 01:56:45 +0000 |
| commit | 9d4f738d4e66adf0796e163d1c9368aaba906bba (patch) | |
| tree | ae7b3c7fca0ff054eb67c1311955e9321a37e559 /azalea-physics/src/lib.rs | |
| parent | 48b2a37aa09f0302b40d0678cdde2703f919ed18 (diff) | |
| download | azalea-drasl-9d4f738d4e66adf0796e163d1c9368aaba906bba.tar.xz | |
make blockstate good
Diffstat (limited to 'azalea-physics/src/lib.rs')
| -rw-r--r-- | azalea-physics/src/lib.rs | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index 35841d77..a8eddeaa 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -75,7 +75,7 @@ fn travel( let block_state_below = world .chunks .get_block_state(&block_pos_below) - .unwrap_or(BlockState::Air); + .unwrap_or(BlockState::AIR); let block_below: Box<dyn Block> = block_state_below.into(); let block_friction = block_below.behavior().friction; @@ -412,7 +412,7 @@ mod tests { .id(); let block_state = partial_world.chunks.set_block_state( &BlockPos { x: 0, y: 69, z: 0 }, - BlockState::Stone, + azalea_registry::Block::Stone.into(), &mut world_lock.write().chunks, ); assert!( @@ -469,7 +469,11 @@ mod tests { .id(); let block_state = partial_world.chunks.set_block_state( &BlockPos { x: 0, y: 69, z: 0 }, - BlockState::StoneSlab_BottomFalse, + azalea_block::StoneSlabBlock { + kind: azalea_block::Type::Bottom, + waterlogged: false, + } + .into(), &mut world_lock.write().chunks, ); assert!( @@ -518,7 +522,11 @@ mod tests { .id(); let block_state = world_lock.write().chunks.set_block_state( &BlockPos { x: 0, y: 69, z: 0 }, - BlockState::StoneSlab_TopFalse, + azalea_block::StoneSlabBlock { + kind: azalea_block::Type::Top, + waterlogged: false, + } + .into(), ); assert!( block_state.is_some(), @@ -566,7 +574,15 @@ mod tests { .id(); let block_state = world_lock.write().chunks.set_block_state( &BlockPos { x: 0, y: 69, z: 0 }, - BlockState::CobblestoneWall_LowLowLowFalseFalseLow, + azalea_block::CobblestoneWallBlock { + east: azalea_block::EastWall::Low, + north: azalea_block::NorthWall::Low, + south: azalea_block::SouthWall::Low, + west: azalea_block::WestWall::Low, + up: false, + waterlogged: false, + } + .into(), ); assert!( block_state.is_some(), |
