pub struct Region<'a> {
pub filename: String,
/* private fields */
}Expand description
Low level storage of region file contents.
Fields§
§filename: StringThe name of the file that the region was derived from.
Implementations§
Source§impl<'a> Region<'a>
impl<'a> Region<'a>
Sourcepub fn chunk_data(&self, chunk_x: u32, chunk_z: u32) -> Option<Box<Blob>>
pub fn chunk_data(&self, chunk_x: u32, chunk_z: u32) -> Option<Box<Blob>>
Returns a Blob of all the data for a particular chunk.
§Arguments
chunk_x- The x coordinate of the particular chunkchunk_z- The z coordinate of the particular chunk
Sourcepub fn get_chunk(&self, chunk_x: u32, chunk_z: u32) -> Option<Chunk>
pub fn get_chunk(&self, chunk_x: u32, chunk_z: u32) -> Option<Chunk>
Returns a Chunk contained within the Region. A region file contains 32x32 chunks.
§Arguments
chunk_x- The x coordinate of the particular chunkchunk_z- The z coordinate of the particular chunk
§Examples
use simple_anvil::region::Region;
let region = Region::from_file("r.0.0.mca".into());
let chunk = region.get_chunk(11, 2).unwrap();Sourcepub fn get_block(&self, x: i32, y: i32, z: i32) -> Option<Block>
pub fn get_block(&self, x: i32, y: i32, z: i32) -> Option<Block>
Returns a Block contained within the Region. None is returned if the Chunk the Block would exist in is not fully generated.
§Arguments
x- The x coordinate of the blocky- The x coordinate of the blockz- The x coordinate of the block
§Examples
use simple_anvil::region::Region;
let region = Region::from_file("r.0.0.mca".into());
println!("{}", region.get_block(20, 56, 45).unwrap().id);Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Region<'a>
impl<'a> !RefUnwindSafe for Region<'a>
impl<'a> Send for Region<'a>
impl<'a> !Sync for Region<'a>
impl<'a> Unpin for Region<'a>
impl<'a> UnwindSafe for Region<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more