diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2026-01-13 10:51:30 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-13 10:51:30 -0600 |
| commit | d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (patch) | |
| tree | ea04702f96ad170fb1d90e5ed2dc875ae8166495 /azalea-world/src/find_blocks.rs | |
| parent | efb36d5fc0fe56a98f5795c53dfa109887cd5aae (diff) | |
| download | azalea-drasl-d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff.tar.xz | |
Rename Instance to World (#304)
Diffstat (limited to 'azalea-world/src/find_blocks.rs')
| -rw-r--r-- | azalea-world/src/find_blocks.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/azalea-world/src/find_blocks.rs b/azalea-world/src/find_blocks.rs index bd4ec09a..f8f1fd91 100644 --- a/azalea-world/src/find_blocks.rs +++ b/azalea-world/src/find_blocks.rs @@ -1,9 +1,9 @@ use azalea_block::{BlockState, BlockStates}; use azalea_core::position::{BlockPos, ChunkPos}; -use crate::{Chunk, ChunkStorage, Instance, iterators::ChunkIterator, palette::Palette}; +use crate::{Chunk, ChunkStorage, World, iterators::ChunkIterator, palette::Palette}; -impl Instance { +impl World { /// Find the coordinates of a block in the world. /// /// Note that this is sorted by `x+y+z` and not `x^2+y^2+z^2` for @@ -206,8 +206,8 @@ impl Iterator for FindBlocks<'_> { /// An optimized function for finding the block positions in a chunk that match /// the given block states. /// -/// This is used internally by [`Instance::find_block`] and -/// [`Instance::find_blocks`]. +/// This is used internally by [`World::find_block`] and +/// [`World::find_blocks`]. pub fn find_blocks_in_chunk( block_states: &BlockStates, chunk_pos: ChunkPos, @@ -257,9 +257,9 @@ mod tests { #[test] fn find_block() { - let mut instance = Instance::default(); + let mut world = World::default(); - let chunk_storage = &mut instance.chunks; + let chunk_storage = &mut world.chunks; let mut partial_chunk_storage = PartialChunkStorage::default(); // block at (17, 0, 0) and (0, 18, 0) @@ -278,15 +278,15 @@ mod tests { chunk_storage.set_block_state(BlockPos { x: 17, y: 0, z: 0 }, BlockKind::Stone.into()); chunk_storage.set_block_state(BlockPos { x: 0, y: 18, z: 0 }, BlockKind::Stone.into()); - let pos = instance.find_block(BlockPos { x: 0, y: 0, z: 0 }, &BlockKind::Stone.into()); + let pos = world.find_block(BlockPos { x: 0, y: 0, z: 0 }, &BlockKind::Stone.into()); assert_eq!(pos, Some(BlockPos { x: 17, y: 0, z: 0 })); } #[test] fn find_block_next_to_chunk_border() { - let mut instance = Instance::default(); + let mut world = World::default(); - let chunk_storage = &mut instance.chunks; + let chunk_storage = &mut world.chunks; let mut partial_chunk_storage = PartialChunkStorage::default(); // block at (-1, 0, 0) and (15, 0, 0) @@ -305,7 +305,7 @@ mod tests { chunk_storage.set_block_state(BlockPos { x: -1, y: 0, z: 0 }, BlockKind::Stone.into()); chunk_storage.set_block_state(BlockPos { x: 15, y: 0, z: 0 }, BlockKind::Stone.into()); - let pos = instance.find_block(BlockPos { x: 0, y: 0, z: 0 }, &BlockKind::Stone.into()); + let pos = world.find_block(BlockPos { x: 0, y: 0, z: 0 }, &BlockKind::Stone.into()); assert_eq!(pos, Some(BlockPos { x: -1, y: 0, z: 0 })); } } |
