diff --git a/src/lib.rs b/src/lib.rs index 3071e5a..3b017eb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,6 +25,7 @@ mod tests { println!("{:?}",mc.get_block_with_data(position1)); mc.set_block(position1,18,1); mc.set_blocks(position1,position2,18,1); + println!("{}",mc.get_height(position1)); } } @@ -81,6 +82,10 @@ impl Minecraft { pub fn set_blocks(&mut self, pos1:Vec3, pos2:Vec3, blocktype:u8, blockdata:u8) { self.conn.send(&format!("world.setBlocks({},{},{},{},{},{},{},{})", pos1.x,pos1.y,pos1.z,pos2.x,pos2.y,pos2.z,blocktype,blockdata)); } + + pub fn get_height(&mut self, pos:Vec3) -> u8 { + self.conn.send_receive(&format!("world.getHeight({},{})", pos.x,pos.z)).parse::().unwrap() + } } pub fn create(adress:&str) -> Minecraft {