# Deepslate Protocol
Minecraft protocol primitives for the Deepslate proxy.
This crate provides zero-copy packet encoding/decoding, VarInt utilities, and type definitions for the Minecraft Java Edition protocol. It is intentionally I/O-free and async-free, operating only on byte slices and buffers.
## Modules
| `codec` | Packet framing codec (length-prefixed frames, compression) |
| `packet` | Packet type definitions for each protocol state |
| `types` | Protocol data types (chat, identifiers, NBT wrappers, etc.) |
| `varint` | VarInt and VarLong encoding/decoding |
| `version` | Minecraft version constants |
## Protocol States
The `State` enum represents the five phases of a Minecraft connection:
- `Handshake` — initial packet that determines whether the client wants status or login
- `Status` — server list ping
- `Login` — authentication and encryption
- `Config` — configuration phase (1.20.2+)
- `Play` — gameplay packets
## Usage
This crate is used internally by the `deepslate` proxy crate. It can also be used independently if you need to work with the Minecraft protocol at a low level without any async runtime or I/O dependencies.
```toml
[dependencies]
deepslate-protocol = "0.3"
```
## Licence
Deepslate Protocol is licensed under either of
- Apache License, Version 2.0, ([LICENSE-APACHE](../../LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](../../LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.