ghast-protocol 0.1.0

Minecraft Java Edition network protocol for the ghast client library: generated per-version packets, framing, compression, encryption, NBT
Documentation
// @generated by ghast-codegen-protocol from PrismarineJS minecraft-data 3.119.0
// (data/pc/1.16.2/protocol.json, Minecraft 1.16.5). Do not edit; run `cargo run -p ghast-codegen-protocol`.
// minecraft-data is MIT licensed, Copyright (c) 2015 PrismarineJS; see ../NOTICE.

//! Clientbound packets of the handshaking state.

#![allow(
    unused_imports,
    unused_variables,
    unused_mut,
    unused_parens,
    unused_braces,
    clippy::all,
    clippy::pedantic,
    non_camel_case_types,
    non_snake_case
)]
use crate::codec::{Decode, DecodeResult, Encode, EncodeResult, McWrite, Reader, decode_exact};
use crate::error::{DecodeError, EncodeError};
use crate::nbt::RawNbt;
use crate::packet::{Direction, PacketSet, RawPacket, State};
#[cfg(feature = "testgen")]
use crate::testgen::{Gen, Generate};
use crate::types::{BlockPos, ByteString, PositionLayout, Uuid};
use crate::v1_16_5::types;
use bytes::{BufMut, Bytes, BytesMut};

/// Packet ids.
pub mod id {}

/// Every Clientbound packet of the Handshaking state.
#[derive(Debug, Clone, PartialEq)]
pub enum ClientboundHandshakingPacket {}

impl PacketSet for ClientboundHandshakingPacket {
    const STATE: State = State::Handshaking;
    const DIRECTION: Direction = Direction::Clientbound;
    fn decode_raw(raw: &RawPacket) -> DecodeResult<Self> {
        match raw.id {
            other => Err(DecodeError::UnknownPacketId(other)),
        }
    }
    fn id(&self) -> i32 {
        match *self {}
    }
    fn name(&self) -> &'static str {
        match *self {}
    }
    fn encode_body(&self, w: &mut BytesMut) -> EncodeResult {
        match *self {}
    }
    fn name_of(id: i32) -> Option<&'static str> {
        match id {
            _ => None,
        }
    }
}

impl ClientboundHandshakingPacket {
    /// All packet ids of this set, ascending.
    pub const IDS: &'static [i32] = &[];
    /// Generates a random packet with the given id (test support).
    #[cfg(feature = "testgen")]
    pub fn generate_by_id(id: i32, g: &mut Gen) -> Option<Self> {
        match id {
            _ => None,
        }
    }
}