diff options
Diffstat (limited to 'azalea-world/src')
| -rwxr-xr-x | azalea-world/src/chunk_storage.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index 4ea54628..94ffb362 100755 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -7,7 +7,7 @@ use std::{ sync::{Arc, Weak}, }; -use azalea_block::{BlockState, BlockStateIntegerRepr}; +use azalea_block::{BlockState, BlockStateIntegerRepr, FluidState}; use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; use azalea_core::position::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos}; use nohash_hasher::IntMap; @@ -302,6 +302,11 @@ impl ChunkStorage { chunk.get(&ChunkBlockPos::from(pos), self.min_y) } + pub fn get_fluid_state(&self, pos: &BlockPos) -> Option<FluidState> { + let block_state = self.get_block_state(pos)?; + Some(FluidState::from(block_state)) + } + pub fn set_block_state(&self, pos: &BlockPos, state: BlockState) -> Option<BlockState> { if pos.y < self.min_y || pos.y >= (self.min_y + self.height as i32) { return None; |
