#version #minecraft #protocols #minecraft-server #experimental #highly #packet

tetsu

A highly experimental version agnostic implementation of Minecraft's server protocols

0.0.1 May 9, 2021
0.0.1-alpha.0 May 7, 2021

#50 in #highly

MIT license

78KB
2K SLoC

Tetsu

GitHub Workflow Status Crates.io Crates.io

Tetsu is a highly experimental version agnostic implementation of Minecraft's server protocols written in Rust. I'm currently trying to make this work with server versions 1.8.* and 1.16.*.

Plans

The next few immediate goals for Tetsu are:

  • Implementing all Play packets for version 47 of the protocol.
  • Minimizing the dependency list.
  • A more robust way to implement packets.

Note: Some of the packet serialization code was referenced from Stevenarella .


lib.rs:

Interface to Minecraft's server protocol.

Examples

use std::env;
use std::thread;
use std::time;

use tetsu::errors;
use tetsu::server;
use tetsu::user;

let user = user::User::authenticate(
env::var("MOJANG_USER").unwrap(),
env::var("MOJANG_USER_PWD").unwrap(),
);

let mut server = server::Server::new("127.0.0.1", None, None).unwrap();

server.connect_player(user).unwrap();

loop {
match server.read_event() {
Ok(e) => println!("{:?}", e),
Err(e) => match e {
errors::ConnectionError::LockError(_) => {
thread::sleep(time::Duration::from_millis(50));
continue;
}
errors::ConnectionError::Error(e) => panic!("Error while reading event: {:?}", e),
},
}
}

Dependencies

~5.5–8MB
~153K SLoC