From c10153260af1fef7937fc3f5a64abf3cad9bc8e8 Mon Sep 17 00:00:00 2001 From: blackfur <64478051+theblackfurguy@users.noreply.github.com> Date: Thu, 11 Feb 2021 18:01:01 +0100 Subject: [PATCH] Added setting() function --- src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 23fb3f0..f7337e6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,6 +27,7 @@ mod tests { mc.set_block(position1,18,1); mc.set_blocks(position1,position2,18,1); println!("{}",mc.get_height(position1)); + mc.setting("world_immutable", false); } } @@ -95,6 +96,10 @@ impl Minecraft { fn restore_checkpoint(&mut self) { self.conn.send("world.checkpoint.restore"); } + + pub fn setting(&mut self, setting:&str, status:bool) { + self.conn.send(&format!("world.setting({},{})",setting,if status == true {1} else {0})); + } } pub fn create(adress:&str) -> Minecraft {