High level interface to Minecraft's server protocols.
Tetsu
is a highly experimental crate that tries to make Minecraft's server protocols easier to use. I'm currently trying to make this work with server versions 1.8.*
and 1.16.*
. The next goal is to implement all Play
packets for version 47 of the protocol before v0.1.0
.
Tetsu
relies on OpenSSL for some cryptographic functions. So, to be able to build this on windows, OpenSSL must be installed first. See installation instructions here.
use std::env;
use tetsu::errors;
use tetsu::mojang;
use tetsu::client;
fn main() {
let user = mojang::User::authenticate(
env::var("MOJANG_USER").unwrap(),
env::var("MOJANG_USER_PWD").unwrap(),
);
let mut client = client::Client::new("127.0.0.1", None, None).unwrap();
client.connect_user(user).unwrap();
loop {
match client.read_event() {
Ok(e) => println!("{:?}", e),
_ => {}
}
}
}