aboutsummaryrefslogtreecommitdiff
path: root/azalea-world
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2024-12-27 10:33:31 +0000
committermat <git@matdoes.dev>2024-12-27 12:35:18 +0000
commit04036b6e4afe1e3eb59cd861a871e17ea5680f5f (patch)
tree20eedbc21e093fc5e33bc2666ad5b07746b319c8 /azalea-world
parent6ccd44e28d29a33abb32a0d0bed466dce8d61676 (diff)
downloadazalea-drasl-04036b6e4afe1e3eb59cd861a871e17ea5680f5f.tar.xz
implement BlockState::outline_shape
Diffstat (limited to 'azalea-world')
-rwxr-xr-xazalea-world/src/chunk_storage.rs7
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;