use super::{BlockState, View, World, void_air};
fn border(w: &World) -> ghast_physics::WorldBorder {
w.collision_border.collision_border()
}
impl ghast_physics::BlockView for World {
type State = BlockState;
#[inline(always)]
fn block(&self, x: i32, y: i32, z: i32) -> BlockState {
self.block_state(x, y, z).unwrap_or_else(void_air)
}
#[inline]
fn is_chunk_loaded(&self, chunk_x: i32, chunk_z: i32) -> bool {
self.columns.contains(chunk_x, chunk_z)
}
fn world_border(&self) -> ghast_physics::WorldBorder {
border(self)
}
}
impl ghast_physics::BlockView for View<'_> {
type State = BlockState;
#[inline(always)]
fn block(&self, x: i32, y: i32, z: i32) -> BlockState {
self.block_state(x, y, z).unwrap_or_else(void_air)
}
#[inline]
fn is_chunk_loaded(&self, chunk_x: i32, chunk_z: i32) -> bool {
self.is_column_loaded(chunk_x, chunk_z)
}
fn world_border(&self) -> ghast_physics::WorldBorder {
border(self.world)
}
}