From 04036b6e4afe1e3eb59cd861a871e17ea5680f5f Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 27 Dec 2024 10:33:31 +0000 Subject: implement BlockState::outline_shape --- azalea-world/src/chunk_storage.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'azalea-world') 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 { + let block_state = self.get_block_state(pos)?; + Some(FluidState::from(block_state)) + } + pub fn set_block_state(&self, pos: &BlockPos, state: BlockState) -> Option { if pos.y < self.min_y || pos.y >= (self.min_y + self.height as i32) { return None; -- cgit v1.2.3