pub trait WorldView {
// Required methods
fn is_column_loaded(&self, chunk_x: i32, chunk_z: i32) -> bool;
fn raw_block(&self, x: i32, y: i32, z: i32) -> Option<u32>;
fn loaded_columns(&self) -> usize;
fn entities(&self) -> Option<&Entities>;
fn block_query(&self, x: i32, y: i32, z: i32) -> Option<BlockQuery>;
// Provided method
fn column(&self, chunk_x: i32, chunk_z: i32) -> Option<&Column> { ... }
}Expand description
Block access for behaviours, independent of the protocol version.
Required Methods§
Sourcefn is_column_loaded(&self, chunk_x: i32, chunk_z: i32) -> bool
fn is_column_loaded(&self, chunk_x: i32, chunk_z: i32) -> bool
Whether the chunk column is loaded (sent by the server and not unloaded).
Sourcefn raw_block(&self, x: i32, y: i32, z: i32) -> Option<u32>
fn raw_block(&self, x: i32, y: i32, z: i32) -> Option<u32>
The block state at a position as the version’s raw id: the 1.8 id << 4 | meta or the
1.16 global palette id (decode it with ghast-data). None when the column is not
loaded — never treat that as air.
Sourcefn loaded_columns(&self) -> usize
fn loaded_columns(&self) -> usize
Number of loaded columns.
Sourcefn entities(&self) -> Option<&Entities>
fn entities(&self) -> Option<&Entities>
The tracked entities (None unless the behaviour asked for crate::Interests::ENTITIES).
Sourcefn block_query(&self, x: i32, y: i32, z: i32) -> Option<BlockQuery>
fn block_query(&self, x: i32, y: i32, z: i32) -> Option<BlockQuery>
Dig / place facts of a block (hardness, tool group, ray box); None when the column
is not loaded.
Provided Methods§
Sourcefn column(&self, chunk_x: i32, chunk_z: i32) -> Option<&Column>
fn column(&self, chunk_x: i32, chunk_z: i32) -> Option<&Column>
The whole loaded column (sections, light / biomes when kept, see
crate::Client::world_config) for bulk reads without a call per block. Block states
are the version’s raw ids, as in WorldView::raw_block. None when not loaded.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".