Майнкрафт сервер на rust
- Rust 99.6%
- Shell 0.4%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
All clientbound play packet IDs and structures updated. LoginPlay moved from handler.rs to clientbound.rs. ChunkData: heightmaps array, sections, light masks. SpawnEntity: velocity before angles, head_pitch. PlayerInfoUpdate: bitflag actions, new entry fields. PlayerPosition: dx/dy/dz + u32 relatives flags. Serverbound play IDs fixed (chat 0x08, command 0x06, etc.). MovementFlags bitfield instead of bool on_ground. Race condition fix: skip non-Play players in tick. SetGamemode replaced with GameStateChange. 8 unit tests for play packet encoders. |
||
| benches | ||
| config | ||
| core | ||
| net | ||
| plugin-runtime | ||
| plugin-sdk | ||
| protocol | ||
| scripts | ||
| server | ||
| world | ||
| .gitignore | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| PLANS.md | ||
| README.md | ||
| todos.json | ||
MIRST — Minecraft Rust Server
Vanilla-compatible Minecraft 1.21.x server written in Rust. Focus on performance, safety, and WASM plugin isolation.
Features
- ✅ Full protocol stack (handshake → status → login → play)
- ✅ Online/offline mode, encryption (AES/CFB8), compression
- ✅ Anvil region I/O, NBT, chunk generation
- ✅ 20 TPS game loop, player movement, keepalive
- ✅ Entity system: passive mobs (cow, sheep, pig, chicken) and hostiles (zombie, skeleton)
- ✅ Block interactions, inventory, vanilla commands
- ✅ Tab list with latency, per-player entity visibility
- ✅ WASM plugin runtime (wasmtime) with memory/CPU sandbox
- ✅ Server.properties (all vanilla options) + mirst.toml
- ✅ Criterion benchmarks, flamegraph profiling
Build & Run
cargo build --release
./target/release/mirst
Default port 25565. Configure via server.properties and mirst.toml.
Plugins
Place .wasm + *.toml manifest files in plugins/:
[plugin]
name = "my-plugin"
version = "1.0.0"
entry = "my-plugin.wasm"
hooks = ["on_chat", "on_tick"]
memory_max_mb = 30
Benchmarks
cargo bench
Profiling
./scripts/flamegraph.sh
Architecture
| Layer | Crate |
|---|---|
| Plugin | plugin-runtime/ |
| Game | server/ |
| World | world/ |
| Protocol | protocol/ |
| Network | net/ |
| Config | config/ |
| Core | core/ |