#![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::{AnonNbt, RawNbt};
use crate::packet::{Direction, PacketSet, RawPacket, State};
#[cfg(feature = "testgen")]
use crate::testgen::{Gen, Generate};
use crate::types::{BlockPos, ByteString, Holder, HolderSet, LpVec3, PositionLayout, Uuid};
use bytes::{BufMut, Bytes, BytesMut};
pub mod id {
pub const TELEPORT_CONFIRM: i32 = 0x00;
pub const ATTACK: i32 = 0x01;
pub const QUERY_BLOCK_NBT: i32 = 0x02;
pub const SELECT_BUNDLE_ITEM: i32 = 0x03;
pub const SET_DIFFICULTY: i32 = 0x04;
pub const CHANGE_GAMEMODE: i32 = 0x05;
pub const MESSAGE_ACKNOWLEDGEMENT: i32 = 0x06;
pub const CHAT_COMMAND: i32 = 0x07;
pub const CHAT_COMMAND_SIGNED: i32 = 0x08;
pub const CHAT_MESSAGE: i32 = 0x09;
pub const CHAT_SESSION_UPDATE: i32 = 0x0a;
pub const CHUNK_BATCH_RECEIVED: i32 = 0x0b;
pub const CLIENT_COMMAND: i32 = 0x0c;
pub const TICK_END: i32 = 0x0d;
pub const SETTINGS: i32 = 0x0e;
pub const TAB_COMPLETE: i32 = 0x0f;
pub const CONFIGURATION_ACKNOWLEDGED: i32 = 0x10;
pub const ENCHANT_ITEM: i32 = 0x11;
pub const WINDOW_CLICK: i32 = 0x12;
pub const CLOSE_WINDOW: i32 = 0x13;
pub const SET_SLOT_STATE: i32 = 0x14;
pub const COOKIE_RESPONSE: i32 = 0x15;
pub const CUSTOM_PAYLOAD: i32 = 0x16;
pub const DEBUG_SUBSCRIPTION_REQUEST: i32 = 0x17;
pub const EDIT_BOOK: i32 = 0x18;
pub const QUERY_ENTITY_NBT: i32 = 0x19;
pub const USE_ENTITY: i32 = 0x1a;
pub const GENERATE_STRUCTURE: i32 = 0x1b;
pub const KEEP_ALIVE: i32 = 0x1c;
pub const LOCK_DIFFICULTY: i32 = 0x1d;
pub const POSITION: i32 = 0x1e;
pub const POSITION_LOOK: i32 = 0x1f;
pub const LOOK: i32 = 0x20;
pub const FLYING: i32 = 0x21;
pub const VEHICLE_MOVE: i32 = 0x22;
pub const STEER_BOAT: i32 = 0x23;
pub const PICK_ITEM_FROM_BLOCK: i32 = 0x24;
pub const PICK_ITEM_FROM_ENTITY: i32 = 0x25;
pub const PING_REQUEST: i32 = 0x26;
pub const CRAFT_RECIPE_REQUEST: i32 = 0x27;
pub const ABILITIES: i32 = 0x28;
pub const BLOCK_DIG: i32 = 0x29;
pub const ENTITY_ACTION: i32 = 0x2a;
pub const PLAYER_INPUT: i32 = 0x2b;
pub const PLAYER_LOADED: i32 = 0x2c;
pub const PONG: i32 = 0x2d;
pub const RECIPE_BOOK: i32 = 0x2e;
pub const DISPLAYED_RECIPE: i32 = 0x2f;
pub const NAME_ITEM: i32 = 0x30;
pub const RESOURCE_PACK_RECEIVE: i32 = 0x31;
pub const ADVANCEMENT_TAB: i32 = 0x32;
pub const SELECT_TRADE: i32 = 0x33;
pub const SET_BEACON_EFFECT: i32 = 0x34;
pub const HELD_ITEM_SLOT: i32 = 0x35;
pub const UPDATE_COMMAND_BLOCK: i32 = 0x36;
pub const UPDATE_COMMAND_BLOCK_MINECART: i32 = 0x37;
pub const SET_CREATIVE_SLOT: i32 = 0x38;
pub const SET_GAME_RULE: i32 = 0x39;
pub const UPDATE_JIGSAW_BLOCK: i32 = 0x3a;
pub const UPDATE_STRUCTURE_BLOCK: i32 = 0x3b;
pub const SET_TEST_BLOCK: i32 = 0x3c;
pub const UPDATE_SIGN: i32 = 0x3d;
pub const SPECTATE_ENTITY: i32 = 0x3e;
pub const ARM_ANIMATION: i32 = 0x3f;
pub const SPECTATE: i32 = 0x40;
pub const TEST_INSTANCE_BLOCK_ACTION: i32 = 0x41;
pub const BLOCK_PLACE: i32 = 0x42;
pub const USE_ITEM: i32 = 0x43;
pub const CUSTOM_CLICK_ACTION: i32 = 0x44;
}
pub use crate::defs::p775::play::serverbound::ArmAnimationHand;
pub use crate::defs::p775::play::serverbound::BlockPlaceHand;
pub use crate::defs::p775::play::serverbound::ChangeGamemodeMode;
pub use crate::defs::p775::play::serverbound::ChatCommandSignedArgumentSignatures;
pub use crate::defs::p775::play::serverbound::ClientCommandActionId;
pub use crate::defs::p775::play::serverbound::EntityActionActionId;
pub use crate::defs::p775::play::serverbound::MovementFlags;
pub use crate::defs::p775::play::serverbound::PlayerInputInputs;
pub use crate::defs::p775::play::serverbound::SetDifficultyNewDifficulty;
pub use crate::defs::p775::play::serverbound::SettingsParticleStatus;
pub use crate::defs::p775::play::serverbound::TestInstanceBlockActionData;
pub use crate::defs::p775::play::serverbound::UpdateStructureBlockFlags;
pub use crate::defs::p775::play::serverbound::UseEntityHand;
pub use crate::defs::p775::play::serverbound::UseItemHand;
pub use crate::defs::p775::play::serverbound::WindowClickChangedSlots;
pub type TeleportConfirm = crate::defs::p340::play::serverbound::TeleportConfirm<775>;
impl crate::packet::Packet for TeleportConfirm {
const ID: i32 = id::TELEPORT_CONFIRM;
const NAME: &'static str = "teleport_confirm";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<TeleportConfirm> for ServerboundPlayPacket {
fn from(p: TeleportConfirm) -> Self {
Self::TeleportConfirm(p)
}
}
pub type Attack = crate::defs::p775::play::serverbound::Attack<775>;
impl crate::packet::Packet for Attack {
const ID: i32 = id::ATTACK;
const NAME: &'static str = "attack";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Attack> for ServerboundPlayPacket {
fn from(p: Attack) -> Self {
Self::Attack(p)
}
}
pub type QueryBlockNbt = crate::defs::p754::play::serverbound::QueryBlockNbt<775>;
impl crate::packet::Packet for QueryBlockNbt {
const ID: i32 = id::QUERY_BLOCK_NBT;
const NAME: &'static str = "query_block_nbt";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<QueryBlockNbt> for ServerboundPlayPacket {
fn from(p: QueryBlockNbt) -> Self {
Self::QueryBlockNbt(p)
}
}
pub type SelectBundleItem = crate::defs::p775::play::serverbound::SelectBundleItem<775>;
impl crate::packet::Packet for SelectBundleItem {
const ID: i32 = id::SELECT_BUNDLE_ITEM;
const NAME: &'static str = "select_bundle_item";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SelectBundleItem> for ServerboundPlayPacket {
fn from(p: SelectBundleItem) -> Self {
Self::SelectBundleItem(p)
}
}
pub type SetDifficulty = crate::defs::p775::play::serverbound::SetDifficulty<775>;
impl crate::packet::Packet for SetDifficulty {
const ID: i32 = id::SET_DIFFICULTY;
const NAME: &'static str = "set_difficulty";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SetDifficulty> for ServerboundPlayPacket {
fn from(p: SetDifficulty) -> Self {
Self::SetDifficulty(p)
}
}
pub type ChangeGamemode = crate::defs::p775::play::serverbound::ChangeGamemode<775>;
impl crate::packet::Packet for ChangeGamemode {
const ID: i32 = id::CHANGE_GAMEMODE;
const NAME: &'static str = "change_gamemode";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ChangeGamemode> for ServerboundPlayPacket {
fn from(p: ChangeGamemode) -> Self {
Self::ChangeGamemode(p)
}
}
pub type MessageAcknowledgement = crate::defs::p775::play::serverbound::MessageAcknowledgement<775>;
impl crate::packet::Packet for MessageAcknowledgement {
const ID: i32 = id::MESSAGE_ACKNOWLEDGEMENT;
const NAME: &'static str = "message_acknowledgement";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<MessageAcknowledgement> for ServerboundPlayPacket {
fn from(p: MessageAcknowledgement) -> Self {
Self::MessageAcknowledgement(p)
}
}
pub type ChatCommand = crate::defs::p775::play::serverbound::ChatCommand<775>;
impl crate::packet::Packet for ChatCommand {
const ID: i32 = id::CHAT_COMMAND;
const NAME: &'static str = "chat_command";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ChatCommand> for ServerboundPlayPacket {
fn from(p: ChatCommand) -> Self {
Self::ChatCommand(p)
}
}
pub type ChatCommandSigned = crate::defs::p775::play::serverbound::ChatCommandSigned<775>;
impl crate::packet::Packet for ChatCommandSigned {
const ID: i32 = id::CHAT_COMMAND_SIGNED;
const NAME: &'static str = "chat_command_signed";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ChatCommandSigned> for ServerboundPlayPacket {
fn from(p: ChatCommandSigned) -> Self {
Self::ChatCommandSigned(p)
}
}
pub type ChatMessage = crate::defs::p775::play::serverbound::ChatMessage<775>;
impl crate::packet::Packet for ChatMessage {
const ID: i32 = id::CHAT_MESSAGE;
const NAME: &'static str = "chat_message";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ChatMessage> for ServerboundPlayPacket {
fn from(p: ChatMessage) -> Self {
Self::ChatMessage(p)
}
}
pub type ChatSessionUpdate = crate::defs::p775::play::serverbound::ChatSessionUpdate<775>;
impl crate::packet::Packet for ChatSessionUpdate {
const ID: i32 = id::CHAT_SESSION_UPDATE;
const NAME: &'static str = "chat_session_update";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ChatSessionUpdate> for ServerboundPlayPacket {
fn from(p: ChatSessionUpdate) -> Self {
Self::ChatSessionUpdate(p)
}
}
pub type ChunkBatchReceived = crate::defs::p775::play::serverbound::ChunkBatchReceived<775>;
impl crate::packet::Packet for ChunkBatchReceived {
const ID: i32 = id::CHUNK_BATCH_RECEIVED;
const NAME: &'static str = "chunk_batch_received";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ChunkBatchReceived> for ServerboundPlayPacket {
fn from(p: ChunkBatchReceived) -> Self {
Self::ChunkBatchReceived(p)
}
}
pub type ClientCommand = crate::defs::p775::play::serverbound::ClientCommand<775>;
impl crate::packet::Packet for ClientCommand {
const ID: i32 = id::CLIENT_COMMAND;
const NAME: &'static str = "client_command";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ClientCommand> for ServerboundPlayPacket {
fn from(p: ClientCommand) -> Self {
Self::ClientCommand(p)
}
}
pub type TickEnd = crate::defs::p775::play::serverbound::TickEnd<775>;
impl crate::packet::Packet for TickEnd {
const ID: i32 = id::TICK_END;
const NAME: &'static str = "tick_end";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<TickEnd> for ServerboundPlayPacket {
fn from(p: TickEnd) -> Self {
Self::TickEnd(p)
}
}
pub type Settings = crate::defs::p775::play::serverbound::Settings<775>;
impl crate::packet::Packet for Settings {
const ID: i32 = id::SETTINGS;
const NAME: &'static str = "settings";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Settings> for ServerboundPlayPacket {
fn from(p: Settings) -> Self {
Self::Settings(p)
}
}
pub type TabComplete = crate::defs::p754::play::serverbound::TabComplete<775>;
impl crate::packet::Packet for TabComplete {
const ID: i32 = id::TAB_COMPLETE;
const NAME: &'static str = "tab_complete";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<TabComplete> for ServerboundPlayPacket {
fn from(p: TabComplete) -> Self {
Self::TabComplete(p)
}
}
pub type ConfigurationAcknowledged =
crate::defs::p775::play::serverbound::ConfigurationAcknowledged<775>;
impl crate::packet::Packet for ConfigurationAcknowledged {
const ID: i32 = id::CONFIGURATION_ACKNOWLEDGED;
const NAME: &'static str = "configuration_acknowledged";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ConfigurationAcknowledged> for ServerboundPlayPacket {
fn from(p: ConfigurationAcknowledged) -> Self {
Self::ConfigurationAcknowledged(p)
}
}
pub type EnchantItem = crate::defs::p775::play::serverbound::EnchantItem<775>;
impl crate::packet::Packet for EnchantItem {
const ID: i32 = id::ENCHANT_ITEM;
const NAME: &'static str = "enchant_item";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<EnchantItem> for ServerboundPlayPacket {
fn from(p: EnchantItem) -> Self {
Self::EnchantItem(p)
}
}
pub type WindowClick = crate::defs::p775::play::serverbound::WindowClick<775>;
impl crate::packet::Packet for WindowClick {
const ID: i32 = id::WINDOW_CLICK;
const NAME: &'static str = "window_click";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<WindowClick> for ServerboundPlayPacket {
fn from(p: WindowClick) -> Self {
Self::WindowClick(p)
}
}
pub type CloseWindow = crate::defs::p775::play::serverbound::CloseWindow<775>;
impl crate::packet::Packet for CloseWindow {
const ID: i32 = id::CLOSE_WINDOW;
const NAME: &'static str = "close_window";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<CloseWindow> for ServerboundPlayPacket {
fn from(p: CloseWindow) -> Self {
Self::CloseWindow(p)
}
}
pub type SetSlotState = crate::defs::p775::play::serverbound::SetSlotState<775>;
impl crate::packet::Packet for SetSlotState {
const ID: i32 = id::SET_SLOT_STATE;
const NAME: &'static str = "set_slot_state";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SetSlotState> for ServerboundPlayPacket {
fn from(p: SetSlotState) -> Self {
Self::SetSlotState(p)
}
}
pub type CookieResponse = crate::defs::p775::play::serverbound::CookieResponse<775>;
impl crate::packet::Packet for CookieResponse {
const ID: i32 = id::COOKIE_RESPONSE;
const NAME: &'static str = "cookie_response";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<CookieResponse> for ServerboundPlayPacket {
fn from(p: CookieResponse) -> Self {
Self::CookieResponse(p)
}
}
pub type CustomPayload = crate::defs::p47::play::serverbound::CustomPayload<775>;
impl crate::packet::Packet for CustomPayload {
const ID: i32 = id::CUSTOM_PAYLOAD;
const NAME: &'static str = "custom_payload";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<CustomPayload> for ServerboundPlayPacket {
fn from(p: CustomPayload) -> Self {
Self::CustomPayload(p)
}
}
pub type DebugSubscriptionRequest =
crate::defs::p775::play::serverbound::DebugSubscriptionRequest<775>;
impl crate::packet::Packet for DebugSubscriptionRequest {
const ID: i32 = id::DEBUG_SUBSCRIPTION_REQUEST;
const NAME: &'static str = "debug_subscription_request";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<DebugSubscriptionRequest> for ServerboundPlayPacket {
fn from(p: DebugSubscriptionRequest) -> Self {
Self::DebugSubscriptionRequest(p)
}
}
pub type EditBook = crate::defs::p775::play::serverbound::EditBook<775>;
impl crate::packet::Packet for EditBook {
const ID: i32 = id::EDIT_BOOK;
const NAME: &'static str = "edit_book";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<EditBook> for ServerboundPlayPacket {
fn from(p: EditBook) -> Self {
Self::EditBook(p)
}
}
pub type QueryEntityNbt = crate::defs::p754::play::serverbound::QueryEntityNbt<775>;
impl crate::packet::Packet for QueryEntityNbt {
const ID: i32 = id::QUERY_ENTITY_NBT;
const NAME: &'static str = "query_entity_nbt";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<QueryEntityNbt> for ServerboundPlayPacket {
fn from(p: QueryEntityNbt) -> Self {
Self::QueryEntityNbt(p)
}
}
pub type UseEntity = crate::defs::p775::play::serverbound::UseEntity<775>;
impl crate::packet::Packet for UseEntity {
const ID: i32 = id::USE_ENTITY;
const NAME: &'static str = "use_entity";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<UseEntity> for ServerboundPlayPacket {
fn from(p: UseEntity) -> Self {
Self::UseEntity(p)
}
}
pub type GenerateStructure = crate::defs::p754::play::serverbound::GenerateStructure<775>;
impl crate::packet::Packet for GenerateStructure {
const ID: i32 = id::GENERATE_STRUCTURE;
const NAME: &'static str = "generate_structure";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<GenerateStructure> for ServerboundPlayPacket {
fn from(p: GenerateStructure) -> Self {
Self::GenerateStructure(p)
}
}
pub type KeepAlive = crate::defs::p340::play::serverbound::KeepAlive<775>;
impl crate::packet::Packet for KeepAlive {
const ID: i32 = id::KEEP_ALIVE;
const NAME: &'static str = "keep_alive";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<KeepAlive> for ServerboundPlayPacket {
fn from(p: KeepAlive) -> Self {
Self::KeepAlive(p)
}
}
pub type LockDifficulty = crate::defs::p754::play::serverbound::LockDifficulty<775>;
impl crate::packet::Packet for LockDifficulty {
const ID: i32 = id::LOCK_DIFFICULTY;
const NAME: &'static str = "lock_difficulty";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<LockDifficulty> for ServerboundPlayPacket {
fn from(p: LockDifficulty) -> Self {
Self::LockDifficulty(p)
}
}
pub type Position = crate::defs::p775::play::serverbound::Position<775>;
impl crate::packet::Packet for Position {
const ID: i32 = id::POSITION;
const NAME: &'static str = "position";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Position> for ServerboundPlayPacket {
fn from(p: Position) -> Self {
Self::Position(p)
}
}
pub type PositionLook = crate::defs::p775::play::serverbound::PositionLook<775>;
impl crate::packet::Packet for PositionLook {
const ID: i32 = id::POSITION_LOOK;
const NAME: &'static str = "position_look";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<PositionLook> for ServerboundPlayPacket {
fn from(p: PositionLook) -> Self {
Self::PositionLook(p)
}
}
pub type Look = crate::defs::p775::play::serverbound::Look<775>;
impl crate::packet::Packet for Look {
const ID: i32 = id::LOOK;
const NAME: &'static str = "look";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Look> for ServerboundPlayPacket {
fn from(p: Look) -> Self {
Self::Look(p)
}
}
pub type Flying = crate::defs::p775::play::serverbound::Flying<775>;
impl crate::packet::Packet for Flying {
const ID: i32 = id::FLYING;
const NAME: &'static str = "flying";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Flying> for ServerboundPlayPacket {
fn from(p: Flying) -> Self {
Self::Flying(p)
}
}
pub type VehicleMove = crate::defs::p775::play::serverbound::VehicleMove<775>;
impl crate::packet::Packet for VehicleMove {
const ID: i32 = id::VEHICLE_MOVE;
const NAME: &'static str = "vehicle_move";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<VehicleMove> for ServerboundPlayPacket {
fn from(p: VehicleMove) -> Self {
Self::VehicleMove(p)
}
}
pub type SteerBoat = crate::defs::p340::play::serverbound::SteerBoat<775>;
impl crate::packet::Packet for SteerBoat {
const ID: i32 = id::STEER_BOAT;
const NAME: &'static str = "steer_boat";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SteerBoat> for ServerboundPlayPacket {
fn from(p: SteerBoat) -> Self {
Self::SteerBoat(p)
}
}
pub type PickItemFromBlock = crate::defs::p775::play::serverbound::PickItemFromBlock<775>;
impl crate::packet::Packet for PickItemFromBlock {
const ID: i32 = id::PICK_ITEM_FROM_BLOCK;
const NAME: &'static str = "pick_item_from_block";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<PickItemFromBlock> for ServerboundPlayPacket {
fn from(p: PickItemFromBlock) -> Self {
Self::PickItemFromBlock(p)
}
}
pub type PickItemFromEntity = crate::defs::p775::play::serverbound::PickItemFromEntity<775>;
impl crate::packet::Packet for PickItemFromEntity {
const ID: i32 = id::PICK_ITEM_FROM_ENTITY;
const NAME: &'static str = "pick_item_from_entity";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<PickItemFromEntity> for ServerboundPlayPacket {
fn from(p: PickItemFromEntity) -> Self {
Self::PickItemFromEntity(p)
}
}
pub type PingRequest = crate::defs::p775::play::serverbound::PingRequest<775>;
impl crate::packet::Packet for PingRequest {
const ID: i32 = id::PING_REQUEST;
const NAME: &'static str = "ping_request";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<PingRequest> for ServerboundPlayPacket {
fn from(p: PingRequest) -> Self {
Self::PingRequest(p)
}
}
pub type CraftRecipeRequest = crate::defs::p775::play::serverbound::CraftRecipeRequest<775>;
impl crate::packet::Packet for CraftRecipeRequest {
const ID: i32 = id::CRAFT_RECIPE_REQUEST;
const NAME: &'static str = "craft_recipe_request";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<CraftRecipeRequest> for ServerboundPlayPacket {
fn from(p: CraftRecipeRequest) -> Self {
Self::CraftRecipeRequest(p)
}
}
pub type Abilities = crate::defs::p754::play::serverbound::Abilities<775>;
impl crate::packet::Packet for Abilities {
const ID: i32 = id::ABILITIES;
const NAME: &'static str = "abilities";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Abilities> for ServerboundPlayPacket {
fn from(p: Abilities) -> Self {
Self::Abilities(p)
}
}
pub type BlockDig = crate::defs::p775::play::serverbound::BlockDig<775>;
impl crate::packet::Packet for BlockDig {
const ID: i32 = id::BLOCK_DIG;
const NAME: &'static str = "block_dig";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<BlockDig> for ServerboundPlayPacket {
fn from(p: BlockDig) -> Self {
Self::BlockDig(p)
}
}
pub type EntityAction = crate::defs::p775::play::serverbound::EntityAction<775>;
impl crate::packet::Packet for EntityAction {
const ID: i32 = id::ENTITY_ACTION;
const NAME: &'static str = "entity_action";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<EntityAction> for ServerboundPlayPacket {
fn from(p: EntityAction) -> Self {
Self::EntityAction(p)
}
}
pub type PlayerInput = crate::defs::p775::play::serverbound::PlayerInput<775>;
impl crate::packet::Packet for PlayerInput {
const ID: i32 = id::PLAYER_INPUT;
const NAME: &'static str = "player_input";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<PlayerInput> for ServerboundPlayPacket {
fn from(p: PlayerInput) -> Self {
Self::PlayerInput(p)
}
}
pub type PlayerLoaded = crate::defs::p775::play::serverbound::PlayerLoaded<775>;
impl crate::packet::Packet for PlayerLoaded {
const ID: i32 = id::PLAYER_LOADED;
const NAME: &'static str = "player_loaded";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<PlayerLoaded> for ServerboundPlayPacket {
fn from(p: PlayerLoaded) -> Self {
Self::PlayerLoaded(p)
}
}
pub type Pong = crate::defs::p775::play::serverbound::Pong<775>;
impl crate::packet::Packet for Pong {
const ID: i32 = id::PONG;
const NAME: &'static str = "pong";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Pong> for ServerboundPlayPacket {
fn from(p: Pong) -> Self {
Self::Pong(p)
}
}
pub type RecipeBook = crate::defs::p754::play::serverbound::RecipeBook<775>;
impl crate::packet::Packet for RecipeBook {
const ID: i32 = id::RECIPE_BOOK;
const NAME: &'static str = "recipe_book";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<RecipeBook> for ServerboundPlayPacket {
fn from(p: RecipeBook) -> Self {
Self::RecipeBook(p)
}
}
pub type DisplayedRecipe = crate::defs::p775::play::serverbound::DisplayedRecipe<775>;
impl crate::packet::Packet for DisplayedRecipe {
const ID: i32 = id::DISPLAYED_RECIPE;
const NAME: &'static str = "displayed_recipe";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<DisplayedRecipe> for ServerboundPlayPacket {
fn from(p: DisplayedRecipe) -> Self {
Self::DisplayedRecipe(p)
}
}
pub type NameItem = crate::defs::p754::play::serverbound::NameItem<775>;
impl crate::packet::Packet for NameItem {
const ID: i32 = id::NAME_ITEM;
const NAME: &'static str = "name_item";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<NameItem> for ServerboundPlayPacket {
fn from(p: NameItem) -> Self {
Self::NameItem(p)
}
}
pub type ResourcePackReceive = crate::defs::p775::play::serverbound::ResourcePackReceive<775>;
impl crate::packet::Packet for ResourcePackReceive {
const ID: i32 = id::RESOURCE_PACK_RECEIVE;
const NAME: &'static str = "resource_pack_receive";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ResourcePackReceive> for ServerboundPlayPacket {
fn from(p: ResourcePackReceive) -> Self {
Self::ResourcePackReceive(p)
}
}
pub type AdvancementTab = crate::defs::p340::play::serverbound::AdvancementTab<775>;
impl crate::packet::Packet for AdvancementTab {
const ID: i32 = id::ADVANCEMENT_TAB;
const NAME: &'static str = "advancement_tab";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<AdvancementTab> for ServerboundPlayPacket {
fn from(p: AdvancementTab) -> Self {
Self::AdvancementTab(p)
}
}
pub type SelectTrade = crate::defs::p754::play::serverbound::SelectTrade<775>;
impl crate::packet::Packet for SelectTrade {
const ID: i32 = id::SELECT_TRADE;
const NAME: &'static str = "select_trade";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SelectTrade> for ServerboundPlayPacket {
fn from(p: SelectTrade) -> Self {
Self::SelectTrade(p)
}
}
pub type SetBeaconEffect = crate::defs::p775::play::serverbound::SetBeaconEffect<775>;
impl crate::packet::Packet for SetBeaconEffect {
const ID: i32 = id::SET_BEACON_EFFECT;
const NAME: &'static str = "set_beacon_effect";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SetBeaconEffect> for ServerboundPlayPacket {
fn from(p: SetBeaconEffect) -> Self {
Self::SetBeaconEffect(p)
}
}
pub type HeldItemSlot = crate::defs::p47::play::serverbound::HeldItemSlot<775>;
impl crate::packet::Packet for HeldItemSlot {
const ID: i32 = id::HELD_ITEM_SLOT;
const NAME: &'static str = "held_item_slot";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<HeldItemSlot> for ServerboundPlayPacket {
fn from(p: HeldItemSlot) -> Self {
Self::HeldItemSlot(p)
}
}
pub type UpdateCommandBlock = crate::defs::p754::play::serverbound::UpdateCommandBlock<775>;
impl crate::packet::Packet for UpdateCommandBlock {
const ID: i32 = id::UPDATE_COMMAND_BLOCK;
const NAME: &'static str = "update_command_block";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<UpdateCommandBlock> for ServerboundPlayPacket {
fn from(p: UpdateCommandBlock) -> Self {
Self::UpdateCommandBlock(p)
}
}
pub type UpdateCommandBlockMinecart =
crate::defs::p754::play::serverbound::UpdateCommandBlockMinecart<775>;
impl crate::packet::Packet for UpdateCommandBlockMinecart {
const ID: i32 = id::UPDATE_COMMAND_BLOCK_MINECART;
const NAME: &'static str = "update_command_block_minecart";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<UpdateCommandBlockMinecart> for ServerboundPlayPacket {
fn from(p: UpdateCommandBlockMinecart) -> Self {
Self::UpdateCommandBlockMinecart(p)
}
}
pub type SetCreativeSlot = crate::defs::p775::play::serverbound::SetCreativeSlot<775>;
impl crate::packet::Packet for SetCreativeSlot {
const ID: i32 = id::SET_CREATIVE_SLOT;
const NAME: &'static str = "set_creative_slot";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SetCreativeSlot> for ServerboundPlayPacket {
fn from(p: SetCreativeSlot) -> Self {
Self::SetCreativeSlot(p)
}
}
pub type SetGameRule = crate::defs::p775::play::serverbound::SetGameRule<775>;
impl crate::packet::Packet for SetGameRule {
const ID: i32 = id::SET_GAME_RULE;
const NAME: &'static str = "set_game_rule";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SetGameRule> for ServerboundPlayPacket {
fn from(p: SetGameRule) -> Self {
Self::SetGameRule(p)
}
}
pub type UpdateJigsawBlock = crate::defs::p775::play::serverbound::UpdateJigsawBlock<775>;
impl crate::packet::Packet for UpdateJigsawBlock {
const ID: i32 = id::UPDATE_JIGSAW_BLOCK;
const NAME: &'static str = "update_jigsaw_block";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<UpdateJigsawBlock> for ServerboundPlayPacket {
fn from(p: UpdateJigsawBlock) -> Self {
Self::UpdateJigsawBlock(p)
}
}
pub type UpdateStructureBlock = crate::defs::p775::play::serverbound::UpdateStructureBlock<775>;
impl crate::packet::Packet for UpdateStructureBlock {
const ID: i32 = id::UPDATE_STRUCTURE_BLOCK;
const NAME: &'static str = "update_structure_block";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<UpdateStructureBlock> for ServerboundPlayPacket {
fn from(p: UpdateStructureBlock) -> Self {
Self::UpdateStructureBlock(p)
}
}
pub type SetTestBlock = crate::defs::p775::play::serverbound::SetTestBlock<775>;
impl crate::packet::Packet for SetTestBlock {
const ID: i32 = id::SET_TEST_BLOCK;
const NAME: &'static str = "set_test_block";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SetTestBlock> for ServerboundPlayPacket {
fn from(p: SetTestBlock) -> Self {
Self::SetTestBlock(p)
}
}
pub type UpdateSign = crate::defs::p775::play::serverbound::UpdateSign<775>;
impl crate::packet::Packet for UpdateSign {
const ID: i32 = id::UPDATE_SIGN;
const NAME: &'static str = "update_sign";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<UpdateSign> for ServerboundPlayPacket {
fn from(p: UpdateSign) -> Self {
Self::UpdateSign(p)
}
}
pub type SpectateEntity = crate::defs::p775::play::serverbound::SpectateEntity<775>;
impl crate::packet::Packet for SpectateEntity {
const ID: i32 = id::SPECTATE_ENTITY;
const NAME: &'static str = "spectate_entity";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SpectateEntity> for ServerboundPlayPacket {
fn from(p: SpectateEntity) -> Self {
Self::SpectateEntity(p)
}
}
pub type ArmAnimation = crate::defs::p775::play::serverbound::ArmAnimation<775>;
impl crate::packet::Packet for ArmAnimation {
const ID: i32 = id::ARM_ANIMATION;
const NAME: &'static str = "arm_animation";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<ArmAnimation> for ServerboundPlayPacket {
fn from(p: ArmAnimation) -> Self {
Self::ArmAnimation(p)
}
}
pub type Spectate = crate::defs::p47::play::serverbound::Spectate<775>;
impl crate::packet::Packet for Spectate {
const ID: i32 = id::SPECTATE;
const NAME: &'static str = "spectate";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Spectate> for ServerboundPlayPacket {
fn from(p: Spectate) -> Self {
Self::Spectate(p)
}
}
pub type TestInstanceBlockAction =
crate::defs::p775::play::serverbound::TestInstanceBlockAction<775>;
impl crate::packet::Packet for TestInstanceBlockAction {
const ID: i32 = id::TEST_INSTANCE_BLOCK_ACTION;
const NAME: &'static str = "test_instance_block_action";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<TestInstanceBlockAction> for ServerboundPlayPacket {
fn from(p: TestInstanceBlockAction) -> Self {
Self::TestInstanceBlockAction(p)
}
}
pub type BlockPlace = crate::defs::p775::play::serverbound::BlockPlace<775>;
impl crate::packet::Packet for BlockPlace {
const ID: i32 = id::BLOCK_PLACE;
const NAME: &'static str = "block_place";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<BlockPlace> for ServerboundPlayPacket {
fn from(p: BlockPlace) -> Self {
Self::BlockPlace(p)
}
}
pub type UseItem = crate::defs::p775::play::serverbound::UseItem<775>;
impl crate::packet::Packet for UseItem {
const ID: i32 = id::USE_ITEM;
const NAME: &'static str = "use_item";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<UseItem> for ServerboundPlayPacket {
fn from(p: UseItem) -> Self {
Self::UseItem(p)
}
}
pub type CustomClickAction = crate::defs::p775::play::serverbound::CustomClickAction<775>;
impl crate::packet::Packet for CustomClickAction {
const ID: i32 = id::CUSTOM_CLICK_ACTION;
const NAME: &'static str = "custom_click_action";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<CustomClickAction> for ServerboundPlayPacket {
fn from(p: CustomClickAction) -> Self {
Self::CustomClickAction(p)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum ServerboundPlayPacket {
TeleportConfirm(TeleportConfirm),
Attack(Attack),
QueryBlockNbt(QueryBlockNbt),
SelectBundleItem(SelectBundleItem),
SetDifficulty(SetDifficulty),
ChangeGamemode(ChangeGamemode),
MessageAcknowledgement(MessageAcknowledgement),
ChatCommand(ChatCommand),
ChatCommandSigned(ChatCommandSigned),
ChatMessage(ChatMessage),
ChatSessionUpdate(ChatSessionUpdate),
ChunkBatchReceived(ChunkBatchReceived),
ClientCommand(ClientCommand),
TickEnd(TickEnd),
Settings(Settings),
TabComplete(TabComplete),
ConfigurationAcknowledged(ConfigurationAcknowledged),
EnchantItem(EnchantItem),
WindowClick(WindowClick),
CloseWindow(CloseWindow),
SetSlotState(SetSlotState),
CookieResponse(CookieResponse),
CustomPayload(CustomPayload),
DebugSubscriptionRequest(DebugSubscriptionRequest),
EditBook(EditBook),
QueryEntityNbt(QueryEntityNbt),
UseEntity(UseEntity),
GenerateStructure(GenerateStructure),
KeepAlive(KeepAlive),
LockDifficulty(LockDifficulty),
Position(Position),
PositionLook(PositionLook),
Look(Look),
Flying(Flying),
VehicleMove(VehicleMove),
SteerBoat(SteerBoat),
PickItemFromBlock(PickItemFromBlock),
PickItemFromEntity(PickItemFromEntity),
PingRequest(PingRequest),
CraftRecipeRequest(CraftRecipeRequest),
Abilities(Abilities),
BlockDig(BlockDig),
EntityAction(EntityAction),
PlayerInput(PlayerInput),
PlayerLoaded(PlayerLoaded),
Pong(Pong),
RecipeBook(RecipeBook),
DisplayedRecipe(DisplayedRecipe),
NameItem(NameItem),
ResourcePackReceive(ResourcePackReceive),
AdvancementTab(AdvancementTab),
SelectTrade(SelectTrade),
SetBeaconEffect(SetBeaconEffect),
HeldItemSlot(HeldItemSlot),
UpdateCommandBlock(UpdateCommandBlock),
UpdateCommandBlockMinecart(UpdateCommandBlockMinecart),
SetCreativeSlot(SetCreativeSlot),
SetGameRule(SetGameRule),
UpdateJigsawBlock(UpdateJigsawBlock),
UpdateStructureBlock(UpdateStructureBlock),
SetTestBlock(SetTestBlock),
UpdateSign(UpdateSign),
SpectateEntity(SpectateEntity),
ArmAnimation(ArmAnimation),
Spectate(Spectate),
TestInstanceBlockAction(TestInstanceBlockAction),
BlockPlace(BlockPlace),
UseItem(UseItem),
CustomClickAction(CustomClickAction),
}
impl PacketSet for ServerboundPlayPacket {
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
fn decode_raw(raw: &RawPacket) -> DecodeResult<Self> {
match raw.id {
id::TELEPORT_CONFIRM => decode_exact(&raw.body).map(Self::TeleportConfirm),
id::ATTACK => decode_exact(&raw.body).map(Self::Attack),
id::QUERY_BLOCK_NBT => decode_exact(&raw.body).map(Self::QueryBlockNbt),
id::SELECT_BUNDLE_ITEM => decode_exact(&raw.body).map(Self::SelectBundleItem),
id::SET_DIFFICULTY => decode_exact(&raw.body).map(Self::SetDifficulty),
id::CHANGE_GAMEMODE => decode_exact(&raw.body).map(Self::ChangeGamemode),
id::MESSAGE_ACKNOWLEDGEMENT => {
decode_exact(&raw.body).map(Self::MessageAcknowledgement)
}
id::CHAT_COMMAND => decode_exact(&raw.body).map(Self::ChatCommand),
id::CHAT_COMMAND_SIGNED => decode_exact(&raw.body).map(Self::ChatCommandSigned),
id::CHAT_MESSAGE => decode_exact(&raw.body).map(Self::ChatMessage),
id::CHAT_SESSION_UPDATE => decode_exact(&raw.body).map(Self::ChatSessionUpdate),
id::CHUNK_BATCH_RECEIVED => decode_exact(&raw.body).map(Self::ChunkBatchReceived),
id::CLIENT_COMMAND => decode_exact(&raw.body).map(Self::ClientCommand),
id::TICK_END => decode_exact(&raw.body).map(Self::TickEnd),
id::SETTINGS => decode_exact(&raw.body).map(Self::Settings),
id::TAB_COMPLETE => decode_exact(&raw.body).map(Self::TabComplete),
id::CONFIGURATION_ACKNOWLEDGED => {
decode_exact(&raw.body).map(Self::ConfigurationAcknowledged)
}
id::ENCHANT_ITEM => decode_exact(&raw.body).map(Self::EnchantItem),
id::WINDOW_CLICK => decode_exact(&raw.body).map(Self::WindowClick),
id::CLOSE_WINDOW => decode_exact(&raw.body).map(Self::CloseWindow),
id::SET_SLOT_STATE => decode_exact(&raw.body).map(Self::SetSlotState),
id::COOKIE_RESPONSE => decode_exact(&raw.body).map(Self::CookieResponse),
id::CUSTOM_PAYLOAD => decode_exact(&raw.body).map(Self::CustomPayload),
id::DEBUG_SUBSCRIPTION_REQUEST => {
decode_exact(&raw.body).map(Self::DebugSubscriptionRequest)
}
id::EDIT_BOOK => decode_exact(&raw.body).map(Self::EditBook),
id::QUERY_ENTITY_NBT => decode_exact(&raw.body).map(Self::QueryEntityNbt),
id::USE_ENTITY => decode_exact(&raw.body).map(Self::UseEntity),
id::GENERATE_STRUCTURE => decode_exact(&raw.body).map(Self::GenerateStructure),
id::KEEP_ALIVE => decode_exact(&raw.body).map(Self::KeepAlive),
id::LOCK_DIFFICULTY => decode_exact(&raw.body).map(Self::LockDifficulty),
id::POSITION => decode_exact(&raw.body).map(Self::Position),
id::POSITION_LOOK => decode_exact(&raw.body).map(Self::PositionLook),
id::LOOK => decode_exact(&raw.body).map(Self::Look),
id::FLYING => decode_exact(&raw.body).map(Self::Flying),
id::VEHICLE_MOVE => decode_exact(&raw.body).map(Self::VehicleMove),
id::STEER_BOAT => decode_exact(&raw.body).map(Self::SteerBoat),
id::PICK_ITEM_FROM_BLOCK => decode_exact(&raw.body).map(Self::PickItemFromBlock),
id::PICK_ITEM_FROM_ENTITY => decode_exact(&raw.body).map(Self::PickItemFromEntity),
id::PING_REQUEST => decode_exact(&raw.body).map(Self::PingRequest),
id::CRAFT_RECIPE_REQUEST => decode_exact(&raw.body).map(Self::CraftRecipeRequest),
id::ABILITIES => decode_exact(&raw.body).map(Self::Abilities),
id::BLOCK_DIG => decode_exact(&raw.body).map(Self::BlockDig),
id::ENTITY_ACTION => decode_exact(&raw.body).map(Self::EntityAction),
id::PLAYER_INPUT => decode_exact(&raw.body).map(Self::PlayerInput),
id::PLAYER_LOADED => decode_exact(&raw.body).map(Self::PlayerLoaded),
id::PONG => decode_exact(&raw.body).map(Self::Pong),
id::RECIPE_BOOK => decode_exact(&raw.body).map(Self::RecipeBook),
id::DISPLAYED_RECIPE => decode_exact(&raw.body).map(Self::DisplayedRecipe),
id::NAME_ITEM => decode_exact(&raw.body).map(Self::NameItem),
id::RESOURCE_PACK_RECEIVE => decode_exact(&raw.body).map(Self::ResourcePackReceive),
id::ADVANCEMENT_TAB => decode_exact(&raw.body).map(Self::AdvancementTab),
id::SELECT_TRADE => decode_exact(&raw.body).map(Self::SelectTrade),
id::SET_BEACON_EFFECT => decode_exact(&raw.body).map(Self::SetBeaconEffect),
id::HELD_ITEM_SLOT => decode_exact(&raw.body).map(Self::HeldItemSlot),
id::UPDATE_COMMAND_BLOCK => decode_exact(&raw.body).map(Self::UpdateCommandBlock),
id::UPDATE_COMMAND_BLOCK_MINECART => {
decode_exact(&raw.body).map(Self::UpdateCommandBlockMinecart)
}
id::SET_CREATIVE_SLOT => decode_exact(&raw.body).map(Self::SetCreativeSlot),
id::SET_GAME_RULE => decode_exact(&raw.body).map(Self::SetGameRule),
id::UPDATE_JIGSAW_BLOCK => decode_exact(&raw.body).map(Self::UpdateJigsawBlock),
id::UPDATE_STRUCTURE_BLOCK => decode_exact(&raw.body).map(Self::UpdateStructureBlock),
id::SET_TEST_BLOCK => decode_exact(&raw.body).map(Self::SetTestBlock),
id::UPDATE_SIGN => decode_exact(&raw.body).map(Self::UpdateSign),
id::SPECTATE_ENTITY => decode_exact(&raw.body).map(Self::SpectateEntity),
id::ARM_ANIMATION => decode_exact(&raw.body).map(Self::ArmAnimation),
id::SPECTATE => decode_exact(&raw.body).map(Self::Spectate),
id::TEST_INSTANCE_BLOCK_ACTION => {
decode_exact(&raw.body).map(Self::TestInstanceBlockAction)
}
id::BLOCK_PLACE => decode_exact(&raw.body).map(Self::BlockPlace),
id::USE_ITEM => decode_exact(&raw.body).map(Self::UseItem),
id::CUSTOM_CLICK_ACTION => decode_exact(&raw.body).map(Self::CustomClickAction),
other => Err(DecodeError::UnknownPacketId(other)),
}
}
fn id(&self) -> i32 {
match *self {
Self::TeleportConfirm(_) => id::TELEPORT_CONFIRM,
Self::Attack(_) => id::ATTACK,
Self::QueryBlockNbt(_) => id::QUERY_BLOCK_NBT,
Self::SelectBundleItem(_) => id::SELECT_BUNDLE_ITEM,
Self::SetDifficulty(_) => id::SET_DIFFICULTY,
Self::ChangeGamemode(_) => id::CHANGE_GAMEMODE,
Self::MessageAcknowledgement(_) => id::MESSAGE_ACKNOWLEDGEMENT,
Self::ChatCommand(_) => id::CHAT_COMMAND,
Self::ChatCommandSigned(_) => id::CHAT_COMMAND_SIGNED,
Self::ChatMessage(_) => id::CHAT_MESSAGE,
Self::ChatSessionUpdate(_) => id::CHAT_SESSION_UPDATE,
Self::ChunkBatchReceived(_) => id::CHUNK_BATCH_RECEIVED,
Self::ClientCommand(_) => id::CLIENT_COMMAND,
Self::TickEnd(_) => id::TICK_END,
Self::Settings(_) => id::SETTINGS,
Self::TabComplete(_) => id::TAB_COMPLETE,
Self::ConfigurationAcknowledged(_) => id::CONFIGURATION_ACKNOWLEDGED,
Self::EnchantItem(_) => id::ENCHANT_ITEM,
Self::WindowClick(_) => id::WINDOW_CLICK,
Self::CloseWindow(_) => id::CLOSE_WINDOW,
Self::SetSlotState(_) => id::SET_SLOT_STATE,
Self::CookieResponse(_) => id::COOKIE_RESPONSE,
Self::CustomPayload(_) => id::CUSTOM_PAYLOAD,
Self::DebugSubscriptionRequest(_) => id::DEBUG_SUBSCRIPTION_REQUEST,
Self::EditBook(_) => id::EDIT_BOOK,
Self::QueryEntityNbt(_) => id::QUERY_ENTITY_NBT,
Self::UseEntity(_) => id::USE_ENTITY,
Self::GenerateStructure(_) => id::GENERATE_STRUCTURE,
Self::KeepAlive(_) => id::KEEP_ALIVE,
Self::LockDifficulty(_) => id::LOCK_DIFFICULTY,
Self::Position(_) => id::POSITION,
Self::PositionLook(_) => id::POSITION_LOOK,
Self::Look(_) => id::LOOK,
Self::Flying(_) => id::FLYING,
Self::VehicleMove(_) => id::VEHICLE_MOVE,
Self::SteerBoat(_) => id::STEER_BOAT,
Self::PickItemFromBlock(_) => id::PICK_ITEM_FROM_BLOCK,
Self::PickItemFromEntity(_) => id::PICK_ITEM_FROM_ENTITY,
Self::PingRequest(_) => id::PING_REQUEST,
Self::CraftRecipeRequest(_) => id::CRAFT_RECIPE_REQUEST,
Self::Abilities(_) => id::ABILITIES,
Self::BlockDig(_) => id::BLOCK_DIG,
Self::EntityAction(_) => id::ENTITY_ACTION,
Self::PlayerInput(_) => id::PLAYER_INPUT,
Self::PlayerLoaded(_) => id::PLAYER_LOADED,
Self::Pong(_) => id::PONG,
Self::RecipeBook(_) => id::RECIPE_BOOK,
Self::DisplayedRecipe(_) => id::DISPLAYED_RECIPE,
Self::NameItem(_) => id::NAME_ITEM,
Self::ResourcePackReceive(_) => id::RESOURCE_PACK_RECEIVE,
Self::AdvancementTab(_) => id::ADVANCEMENT_TAB,
Self::SelectTrade(_) => id::SELECT_TRADE,
Self::SetBeaconEffect(_) => id::SET_BEACON_EFFECT,
Self::HeldItemSlot(_) => id::HELD_ITEM_SLOT,
Self::UpdateCommandBlock(_) => id::UPDATE_COMMAND_BLOCK,
Self::UpdateCommandBlockMinecart(_) => id::UPDATE_COMMAND_BLOCK_MINECART,
Self::SetCreativeSlot(_) => id::SET_CREATIVE_SLOT,
Self::SetGameRule(_) => id::SET_GAME_RULE,
Self::UpdateJigsawBlock(_) => id::UPDATE_JIGSAW_BLOCK,
Self::UpdateStructureBlock(_) => id::UPDATE_STRUCTURE_BLOCK,
Self::SetTestBlock(_) => id::SET_TEST_BLOCK,
Self::UpdateSign(_) => id::UPDATE_SIGN,
Self::SpectateEntity(_) => id::SPECTATE_ENTITY,
Self::ArmAnimation(_) => id::ARM_ANIMATION,
Self::Spectate(_) => id::SPECTATE,
Self::TestInstanceBlockAction(_) => id::TEST_INSTANCE_BLOCK_ACTION,
Self::BlockPlace(_) => id::BLOCK_PLACE,
Self::UseItem(_) => id::USE_ITEM,
Self::CustomClickAction(_) => id::CUSTOM_CLICK_ACTION,
}
}
fn name(&self) -> &'static str {
match *self {
Self::TeleportConfirm(_) => "teleport_confirm",
Self::Attack(_) => "attack",
Self::QueryBlockNbt(_) => "query_block_nbt",
Self::SelectBundleItem(_) => "select_bundle_item",
Self::SetDifficulty(_) => "set_difficulty",
Self::ChangeGamemode(_) => "change_gamemode",
Self::MessageAcknowledgement(_) => "message_acknowledgement",
Self::ChatCommand(_) => "chat_command",
Self::ChatCommandSigned(_) => "chat_command_signed",
Self::ChatMessage(_) => "chat_message",
Self::ChatSessionUpdate(_) => "chat_session_update",
Self::ChunkBatchReceived(_) => "chunk_batch_received",
Self::ClientCommand(_) => "client_command",
Self::TickEnd(_) => "tick_end",
Self::Settings(_) => "settings",
Self::TabComplete(_) => "tab_complete",
Self::ConfigurationAcknowledged(_) => "configuration_acknowledged",
Self::EnchantItem(_) => "enchant_item",
Self::WindowClick(_) => "window_click",
Self::CloseWindow(_) => "close_window",
Self::SetSlotState(_) => "set_slot_state",
Self::CookieResponse(_) => "cookie_response",
Self::CustomPayload(_) => "custom_payload",
Self::DebugSubscriptionRequest(_) => "debug_subscription_request",
Self::EditBook(_) => "edit_book",
Self::QueryEntityNbt(_) => "query_entity_nbt",
Self::UseEntity(_) => "use_entity",
Self::GenerateStructure(_) => "generate_structure",
Self::KeepAlive(_) => "keep_alive",
Self::LockDifficulty(_) => "lock_difficulty",
Self::Position(_) => "position",
Self::PositionLook(_) => "position_look",
Self::Look(_) => "look",
Self::Flying(_) => "flying",
Self::VehicleMove(_) => "vehicle_move",
Self::SteerBoat(_) => "steer_boat",
Self::PickItemFromBlock(_) => "pick_item_from_block",
Self::PickItemFromEntity(_) => "pick_item_from_entity",
Self::PingRequest(_) => "ping_request",
Self::CraftRecipeRequest(_) => "craft_recipe_request",
Self::Abilities(_) => "abilities",
Self::BlockDig(_) => "block_dig",
Self::EntityAction(_) => "entity_action",
Self::PlayerInput(_) => "player_input",
Self::PlayerLoaded(_) => "player_loaded",
Self::Pong(_) => "pong",
Self::RecipeBook(_) => "recipe_book",
Self::DisplayedRecipe(_) => "displayed_recipe",
Self::NameItem(_) => "name_item",
Self::ResourcePackReceive(_) => "resource_pack_receive",
Self::AdvancementTab(_) => "advancement_tab",
Self::SelectTrade(_) => "select_trade",
Self::SetBeaconEffect(_) => "set_beacon_effect",
Self::HeldItemSlot(_) => "held_item_slot",
Self::UpdateCommandBlock(_) => "update_command_block",
Self::UpdateCommandBlockMinecart(_) => "update_command_block_minecart",
Self::SetCreativeSlot(_) => "set_creative_slot",
Self::SetGameRule(_) => "set_game_rule",
Self::UpdateJigsawBlock(_) => "update_jigsaw_block",
Self::UpdateStructureBlock(_) => "update_structure_block",
Self::SetTestBlock(_) => "set_test_block",
Self::UpdateSign(_) => "update_sign",
Self::SpectateEntity(_) => "spectate_entity",
Self::ArmAnimation(_) => "arm_animation",
Self::Spectate(_) => "spectate",
Self::TestInstanceBlockAction(_) => "test_instance_block_action",
Self::BlockPlace(_) => "block_place",
Self::UseItem(_) => "use_item",
Self::CustomClickAction(_) => "custom_click_action",
}
}
fn encode_body(&self, w: &mut BytesMut) -> EncodeResult {
match *self {
Self::TeleportConfirm(ref p) => p.encode(w),
Self::Attack(ref p) => p.encode(w),
Self::QueryBlockNbt(ref p) => p.encode(w),
Self::SelectBundleItem(ref p) => p.encode(w),
Self::SetDifficulty(ref p) => p.encode(w),
Self::ChangeGamemode(ref p) => p.encode(w),
Self::MessageAcknowledgement(ref p) => p.encode(w),
Self::ChatCommand(ref p) => p.encode(w),
Self::ChatCommandSigned(ref p) => p.encode(w),
Self::ChatMessage(ref p) => p.encode(w),
Self::ChatSessionUpdate(ref p) => p.encode(w),
Self::ChunkBatchReceived(ref p) => p.encode(w),
Self::ClientCommand(ref p) => p.encode(w),
Self::TickEnd(ref p) => p.encode(w),
Self::Settings(ref p) => p.encode(w),
Self::TabComplete(ref p) => p.encode(w),
Self::ConfigurationAcknowledged(ref p) => p.encode(w),
Self::EnchantItem(ref p) => p.encode(w),
Self::WindowClick(ref p) => p.encode(w),
Self::CloseWindow(ref p) => p.encode(w),
Self::SetSlotState(ref p) => p.encode(w),
Self::CookieResponse(ref p) => p.encode(w),
Self::CustomPayload(ref p) => p.encode(w),
Self::DebugSubscriptionRequest(ref p) => p.encode(w),
Self::EditBook(ref p) => p.encode(w),
Self::QueryEntityNbt(ref p) => p.encode(w),
Self::UseEntity(ref p) => p.encode(w),
Self::GenerateStructure(ref p) => p.encode(w),
Self::KeepAlive(ref p) => p.encode(w),
Self::LockDifficulty(ref p) => p.encode(w),
Self::Position(ref p) => p.encode(w),
Self::PositionLook(ref p) => p.encode(w),
Self::Look(ref p) => p.encode(w),
Self::Flying(ref p) => p.encode(w),
Self::VehicleMove(ref p) => p.encode(w),
Self::SteerBoat(ref p) => p.encode(w),
Self::PickItemFromBlock(ref p) => p.encode(w),
Self::PickItemFromEntity(ref p) => p.encode(w),
Self::PingRequest(ref p) => p.encode(w),
Self::CraftRecipeRequest(ref p) => p.encode(w),
Self::Abilities(ref p) => p.encode(w),
Self::BlockDig(ref p) => p.encode(w),
Self::EntityAction(ref p) => p.encode(w),
Self::PlayerInput(ref p) => p.encode(w),
Self::PlayerLoaded(ref p) => p.encode(w),
Self::Pong(ref p) => p.encode(w),
Self::RecipeBook(ref p) => p.encode(w),
Self::DisplayedRecipe(ref p) => p.encode(w),
Self::NameItem(ref p) => p.encode(w),
Self::ResourcePackReceive(ref p) => p.encode(w),
Self::AdvancementTab(ref p) => p.encode(w),
Self::SelectTrade(ref p) => p.encode(w),
Self::SetBeaconEffect(ref p) => p.encode(w),
Self::HeldItemSlot(ref p) => p.encode(w),
Self::UpdateCommandBlock(ref p) => p.encode(w),
Self::UpdateCommandBlockMinecart(ref p) => p.encode(w),
Self::SetCreativeSlot(ref p) => p.encode(w),
Self::SetGameRule(ref p) => p.encode(w),
Self::UpdateJigsawBlock(ref p) => p.encode(w),
Self::UpdateStructureBlock(ref p) => p.encode(w),
Self::SetTestBlock(ref p) => p.encode(w),
Self::UpdateSign(ref p) => p.encode(w),
Self::SpectateEntity(ref p) => p.encode(w),
Self::ArmAnimation(ref p) => p.encode(w),
Self::Spectate(ref p) => p.encode(w),
Self::TestInstanceBlockAction(ref p) => p.encode(w),
Self::BlockPlace(ref p) => p.encode(w),
Self::UseItem(ref p) => p.encode(w),
Self::CustomClickAction(ref p) => p.encode(w),
}
}
fn name_of(id: i32) -> Option<&'static str> {
match id {
id::TELEPORT_CONFIRM => Some("teleport_confirm"),
id::ATTACK => Some("attack"),
id::QUERY_BLOCK_NBT => Some("query_block_nbt"),
id::SELECT_BUNDLE_ITEM => Some("select_bundle_item"),
id::SET_DIFFICULTY => Some("set_difficulty"),
id::CHANGE_GAMEMODE => Some("change_gamemode"),
id::MESSAGE_ACKNOWLEDGEMENT => Some("message_acknowledgement"),
id::CHAT_COMMAND => Some("chat_command"),
id::CHAT_COMMAND_SIGNED => Some("chat_command_signed"),
id::CHAT_MESSAGE => Some("chat_message"),
id::CHAT_SESSION_UPDATE => Some("chat_session_update"),
id::CHUNK_BATCH_RECEIVED => Some("chunk_batch_received"),
id::CLIENT_COMMAND => Some("client_command"),
id::TICK_END => Some("tick_end"),
id::SETTINGS => Some("settings"),
id::TAB_COMPLETE => Some("tab_complete"),
id::CONFIGURATION_ACKNOWLEDGED => Some("configuration_acknowledged"),
id::ENCHANT_ITEM => Some("enchant_item"),
id::WINDOW_CLICK => Some("window_click"),
id::CLOSE_WINDOW => Some("close_window"),
id::SET_SLOT_STATE => Some("set_slot_state"),
id::COOKIE_RESPONSE => Some("cookie_response"),
id::CUSTOM_PAYLOAD => Some("custom_payload"),
id::DEBUG_SUBSCRIPTION_REQUEST => Some("debug_subscription_request"),
id::EDIT_BOOK => Some("edit_book"),
id::QUERY_ENTITY_NBT => Some("query_entity_nbt"),
id::USE_ENTITY => Some("use_entity"),
id::GENERATE_STRUCTURE => Some("generate_structure"),
id::KEEP_ALIVE => Some("keep_alive"),
id::LOCK_DIFFICULTY => Some("lock_difficulty"),
id::POSITION => Some("position"),
id::POSITION_LOOK => Some("position_look"),
id::LOOK => Some("look"),
id::FLYING => Some("flying"),
id::VEHICLE_MOVE => Some("vehicle_move"),
id::STEER_BOAT => Some("steer_boat"),
id::PICK_ITEM_FROM_BLOCK => Some("pick_item_from_block"),
id::PICK_ITEM_FROM_ENTITY => Some("pick_item_from_entity"),
id::PING_REQUEST => Some("ping_request"),
id::CRAFT_RECIPE_REQUEST => Some("craft_recipe_request"),
id::ABILITIES => Some("abilities"),
id::BLOCK_DIG => Some("block_dig"),
id::ENTITY_ACTION => Some("entity_action"),
id::PLAYER_INPUT => Some("player_input"),
id::PLAYER_LOADED => Some("player_loaded"),
id::PONG => Some("pong"),
id::RECIPE_BOOK => Some("recipe_book"),
id::DISPLAYED_RECIPE => Some("displayed_recipe"),
id::NAME_ITEM => Some("name_item"),
id::RESOURCE_PACK_RECEIVE => Some("resource_pack_receive"),
id::ADVANCEMENT_TAB => Some("advancement_tab"),
id::SELECT_TRADE => Some("select_trade"),
id::SET_BEACON_EFFECT => Some("set_beacon_effect"),
id::HELD_ITEM_SLOT => Some("held_item_slot"),
id::UPDATE_COMMAND_BLOCK => Some("update_command_block"),
id::UPDATE_COMMAND_BLOCK_MINECART => Some("update_command_block_minecart"),
id::SET_CREATIVE_SLOT => Some("set_creative_slot"),
id::SET_GAME_RULE => Some("set_game_rule"),
id::UPDATE_JIGSAW_BLOCK => Some("update_jigsaw_block"),
id::UPDATE_STRUCTURE_BLOCK => Some("update_structure_block"),
id::SET_TEST_BLOCK => Some("set_test_block"),
id::UPDATE_SIGN => Some("update_sign"),
id::SPECTATE_ENTITY => Some("spectate_entity"),
id::ARM_ANIMATION => Some("arm_animation"),
id::SPECTATE => Some("spectate"),
id::TEST_INSTANCE_BLOCK_ACTION => Some("test_instance_block_action"),
id::BLOCK_PLACE => Some("block_place"),
id::USE_ITEM => Some("use_item"),
id::CUSTOM_CLICK_ACTION => Some("custom_click_action"),
_ => None,
}
}
}
impl ServerboundPlayPacket {
pub const IDS: &'static [i32] = &[
id::TELEPORT_CONFIRM,
id::ATTACK,
id::QUERY_BLOCK_NBT,
id::SELECT_BUNDLE_ITEM,
id::SET_DIFFICULTY,
id::CHANGE_GAMEMODE,
id::MESSAGE_ACKNOWLEDGEMENT,
id::CHAT_COMMAND,
id::CHAT_COMMAND_SIGNED,
id::CHAT_MESSAGE,
id::CHAT_SESSION_UPDATE,
id::CHUNK_BATCH_RECEIVED,
id::CLIENT_COMMAND,
id::TICK_END,
id::SETTINGS,
id::TAB_COMPLETE,
id::CONFIGURATION_ACKNOWLEDGED,
id::ENCHANT_ITEM,
id::WINDOW_CLICK,
id::CLOSE_WINDOW,
id::SET_SLOT_STATE,
id::COOKIE_RESPONSE,
id::CUSTOM_PAYLOAD,
id::DEBUG_SUBSCRIPTION_REQUEST,
id::EDIT_BOOK,
id::QUERY_ENTITY_NBT,
id::USE_ENTITY,
id::GENERATE_STRUCTURE,
id::KEEP_ALIVE,
id::LOCK_DIFFICULTY,
id::POSITION,
id::POSITION_LOOK,
id::LOOK,
id::FLYING,
id::VEHICLE_MOVE,
id::STEER_BOAT,
id::PICK_ITEM_FROM_BLOCK,
id::PICK_ITEM_FROM_ENTITY,
id::PING_REQUEST,
id::CRAFT_RECIPE_REQUEST,
id::ABILITIES,
id::BLOCK_DIG,
id::ENTITY_ACTION,
id::PLAYER_INPUT,
id::PLAYER_LOADED,
id::PONG,
id::RECIPE_BOOK,
id::DISPLAYED_RECIPE,
id::NAME_ITEM,
id::RESOURCE_PACK_RECEIVE,
id::ADVANCEMENT_TAB,
id::SELECT_TRADE,
id::SET_BEACON_EFFECT,
id::HELD_ITEM_SLOT,
id::UPDATE_COMMAND_BLOCK,
id::UPDATE_COMMAND_BLOCK_MINECART,
id::SET_CREATIVE_SLOT,
id::SET_GAME_RULE,
id::UPDATE_JIGSAW_BLOCK,
id::UPDATE_STRUCTURE_BLOCK,
id::SET_TEST_BLOCK,
id::UPDATE_SIGN,
id::SPECTATE_ENTITY,
id::ARM_ANIMATION,
id::SPECTATE,
id::TEST_INSTANCE_BLOCK_ACTION,
id::BLOCK_PLACE,
id::USE_ITEM,
id::CUSTOM_CLICK_ACTION,
];
#[cfg(feature = "testgen")]
pub fn generate_by_id(id: i32, g: &mut Gen) -> Option<Self> {
match id {
id::TELEPORT_CONFIRM => Some(Self::TeleportConfirm(
<TeleportConfirm as Generate>::generate(g),
)),
id::ATTACK => Some(Self::Attack(<Attack as Generate>::generate(g))),
id::QUERY_BLOCK_NBT => Some(Self::QueryBlockNbt(
<QueryBlockNbt as Generate>::generate(g),
)),
id::SELECT_BUNDLE_ITEM => Some(Self::SelectBundleItem(
<SelectBundleItem as Generate>::generate(g),
)),
id::SET_DIFFICULTY => Some(Self::SetDifficulty(<SetDifficulty as Generate>::generate(
g,
))),
id::CHANGE_GAMEMODE => Some(Self::ChangeGamemode(
<ChangeGamemode as Generate>::generate(g),
)),
id::MESSAGE_ACKNOWLEDGEMENT => Some(Self::MessageAcknowledgement(
<MessageAcknowledgement as Generate>::generate(g),
)),
id::CHAT_COMMAND => Some(Self::ChatCommand(<ChatCommand as Generate>::generate(g))),
id::CHAT_COMMAND_SIGNED => Some(Self::ChatCommandSigned(
<ChatCommandSigned as Generate>::generate(g),
)),
id::CHAT_MESSAGE => Some(Self::ChatMessage(<ChatMessage as Generate>::generate(g))),
id::CHAT_SESSION_UPDATE => Some(Self::ChatSessionUpdate(
<ChatSessionUpdate as Generate>::generate(g),
)),
id::CHUNK_BATCH_RECEIVED => Some(Self::ChunkBatchReceived(
<ChunkBatchReceived as Generate>::generate(g),
)),
id::CLIENT_COMMAND => Some(Self::ClientCommand(<ClientCommand as Generate>::generate(
g,
))),
id::TICK_END => Some(Self::TickEnd(<TickEnd as Generate>::generate(g))),
id::SETTINGS => Some(Self::Settings(<Settings as Generate>::generate(g))),
id::TAB_COMPLETE => Some(Self::TabComplete(<TabComplete as Generate>::generate(g))),
id::CONFIGURATION_ACKNOWLEDGED => Some(Self::ConfigurationAcknowledged(
<ConfigurationAcknowledged as Generate>::generate(g),
)),
id::ENCHANT_ITEM => Some(Self::EnchantItem(<EnchantItem as Generate>::generate(g))),
id::WINDOW_CLICK => Some(Self::WindowClick(<WindowClick as Generate>::generate(g))),
id::CLOSE_WINDOW => Some(Self::CloseWindow(<CloseWindow as Generate>::generate(g))),
id::SET_SLOT_STATE => Some(Self::SetSlotState(<SetSlotState as Generate>::generate(g))),
id::COOKIE_RESPONSE => Some(Self::CookieResponse(
<CookieResponse as Generate>::generate(g),
)),
id::CUSTOM_PAYLOAD => Some(Self::CustomPayload(<CustomPayload as Generate>::generate(
g,
))),
id::DEBUG_SUBSCRIPTION_REQUEST => Some(Self::DebugSubscriptionRequest(
<DebugSubscriptionRequest as Generate>::generate(g),
)),
id::EDIT_BOOK => Some(Self::EditBook(<EditBook as Generate>::generate(g))),
id::QUERY_ENTITY_NBT => Some(Self::QueryEntityNbt(
<QueryEntityNbt as Generate>::generate(g),
)),
id::USE_ENTITY => Some(Self::UseEntity(<UseEntity as Generate>::generate(g))),
id::GENERATE_STRUCTURE => Some(Self::GenerateStructure(
<GenerateStructure as Generate>::generate(g),
)),
id::KEEP_ALIVE => Some(Self::KeepAlive(<KeepAlive as Generate>::generate(g))),
id::LOCK_DIFFICULTY => Some(Self::LockDifficulty(
<LockDifficulty as Generate>::generate(g),
)),
id::POSITION => Some(Self::Position(<Position as Generate>::generate(g))),
id::POSITION_LOOK => Some(Self::PositionLook(<PositionLook as Generate>::generate(g))),
id::LOOK => Some(Self::Look(<Look as Generate>::generate(g))),
id::FLYING => Some(Self::Flying(<Flying as Generate>::generate(g))),
id::VEHICLE_MOVE => Some(Self::VehicleMove(<VehicleMove as Generate>::generate(g))),
id::STEER_BOAT => Some(Self::SteerBoat(<SteerBoat as Generate>::generate(g))),
id::PICK_ITEM_FROM_BLOCK => Some(Self::PickItemFromBlock(
<PickItemFromBlock as Generate>::generate(g),
)),
id::PICK_ITEM_FROM_ENTITY => Some(Self::PickItemFromEntity(
<PickItemFromEntity as Generate>::generate(g),
)),
id::PING_REQUEST => Some(Self::PingRequest(<PingRequest as Generate>::generate(g))),
id::CRAFT_RECIPE_REQUEST => Some(Self::CraftRecipeRequest(
<CraftRecipeRequest as Generate>::generate(g),
)),
id::ABILITIES => Some(Self::Abilities(<Abilities as Generate>::generate(g))),
id::BLOCK_DIG => Some(Self::BlockDig(<BlockDig as Generate>::generate(g))),
id::ENTITY_ACTION => Some(Self::EntityAction(<EntityAction as Generate>::generate(g))),
id::PLAYER_INPUT => Some(Self::PlayerInput(<PlayerInput as Generate>::generate(g))),
id::PLAYER_LOADED => Some(Self::PlayerLoaded(<PlayerLoaded as Generate>::generate(g))),
id::PONG => Some(Self::Pong(<Pong as Generate>::generate(g))),
id::RECIPE_BOOK => Some(Self::RecipeBook(<RecipeBook as Generate>::generate(g))),
id::DISPLAYED_RECIPE => Some(Self::DisplayedRecipe(
<DisplayedRecipe as Generate>::generate(g),
)),
id::NAME_ITEM => Some(Self::NameItem(<NameItem as Generate>::generate(g))),
id::RESOURCE_PACK_RECEIVE => Some(Self::ResourcePackReceive(
<ResourcePackReceive as Generate>::generate(g),
)),
id::ADVANCEMENT_TAB => Some(Self::AdvancementTab(
<AdvancementTab as Generate>::generate(g),
)),
id::SELECT_TRADE => Some(Self::SelectTrade(<SelectTrade as Generate>::generate(g))),
id::SET_BEACON_EFFECT => Some(Self::SetBeaconEffect(
<SetBeaconEffect as Generate>::generate(g),
)),
id::HELD_ITEM_SLOT => Some(Self::HeldItemSlot(<HeldItemSlot as Generate>::generate(g))),
id::UPDATE_COMMAND_BLOCK => Some(Self::UpdateCommandBlock(
<UpdateCommandBlock as Generate>::generate(g),
)),
id::UPDATE_COMMAND_BLOCK_MINECART => Some(Self::UpdateCommandBlockMinecart(
<UpdateCommandBlockMinecart as Generate>::generate(g),
)),
id::SET_CREATIVE_SLOT => Some(Self::SetCreativeSlot(
<SetCreativeSlot as Generate>::generate(g),
)),
id::SET_GAME_RULE => Some(Self::SetGameRule(<SetGameRule as Generate>::generate(g))),
id::UPDATE_JIGSAW_BLOCK => Some(Self::UpdateJigsawBlock(
<UpdateJigsawBlock as Generate>::generate(g),
)),
id::UPDATE_STRUCTURE_BLOCK => Some(Self::UpdateStructureBlock(
<UpdateStructureBlock as Generate>::generate(g),
)),
id::SET_TEST_BLOCK => Some(Self::SetTestBlock(<SetTestBlock as Generate>::generate(g))),
id::UPDATE_SIGN => Some(Self::UpdateSign(<UpdateSign as Generate>::generate(g))),
id::SPECTATE_ENTITY => Some(Self::SpectateEntity(
<SpectateEntity as Generate>::generate(g),
)),
id::ARM_ANIMATION => Some(Self::ArmAnimation(<ArmAnimation as Generate>::generate(g))),
id::SPECTATE => Some(Self::Spectate(<Spectate as Generate>::generate(g))),
id::TEST_INSTANCE_BLOCK_ACTION => Some(Self::TestInstanceBlockAction(
<TestInstanceBlockAction as Generate>::generate(g),
)),
id::BLOCK_PLACE => Some(Self::BlockPlace(<BlockPlace as Generate>::generate(g))),
id::USE_ITEM => Some(Self::UseItem(<UseItem as Generate>::generate(g))),
id::CUSTOM_CLICK_ACTION => Some(Self::CustomClickAction(
<CustomClickAction as Generate>::generate(g),
)),
_ => None,
}
}
}