#![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 QUERY_BLOCK_NBT: i32 = 0x01;
pub const SET_DIFFICULTY: i32 = 0x02;
pub const CHAT: i32 = 0x03;
pub const CLIENT_COMMAND: i32 = 0x04;
pub const SETTINGS: i32 = 0x05;
pub const TAB_COMPLETE: i32 = 0x06;
pub const TRANSACTION: i32 = 0x07;
pub const ENCHANT_ITEM: i32 = 0x08;
pub const WINDOW_CLICK: i32 = 0x09;
pub const CLOSE_WINDOW: i32 = 0x0a;
pub const CUSTOM_PAYLOAD: i32 = 0x0b;
pub const EDIT_BOOK: i32 = 0x0c;
pub const QUERY_ENTITY_NBT: i32 = 0x0d;
pub const USE_ENTITY: i32 = 0x0e;
pub const GENERATE_STRUCTURE: i32 = 0x0f;
pub const KEEP_ALIVE: i32 = 0x10;
pub const LOCK_DIFFICULTY: i32 = 0x11;
pub const POSITION: i32 = 0x12;
pub const POSITION_LOOK: i32 = 0x13;
pub const LOOK: i32 = 0x14;
pub const FLYING: i32 = 0x15;
pub const VEHICLE_MOVE: i32 = 0x16;
pub const STEER_BOAT: i32 = 0x17;
pub const PICK_ITEM: i32 = 0x18;
pub const CRAFT_RECIPE_REQUEST: i32 = 0x19;
pub const ABILITIES: i32 = 0x1a;
pub const BLOCK_DIG: i32 = 0x1b;
pub const ENTITY_ACTION: i32 = 0x1c;
pub const STEER_VEHICLE: i32 = 0x1d;
pub const RECIPE_BOOK: i32 = 0x1e;
pub const DISPLAYED_RECIPE: i32 = 0x1f;
pub const NAME_ITEM: i32 = 0x20;
pub const RESOURCE_PACK_RECEIVE: i32 = 0x21;
pub const ADVANCEMENT_TAB: i32 = 0x22;
pub const SELECT_TRADE: i32 = 0x23;
pub const SET_BEACON_EFFECT: i32 = 0x24;
pub const HELD_ITEM_SLOT: i32 = 0x25;
pub const UPDATE_COMMAND_BLOCK: i32 = 0x26;
pub const UPDATE_COMMAND_BLOCK_MINECART: i32 = 0x27;
pub const SET_CREATIVE_SLOT: i32 = 0x28;
pub const UPDATE_JIGSAW_BLOCK: i32 = 0x29;
pub const UPDATE_STRUCTURE_BLOCK: i32 = 0x2a;
pub const UPDATE_SIGN: i32 = 0x2b;
pub const ARM_ANIMATION: i32 = 0x2c;
pub const SPECTATE: i32 = 0x2d;
pub const BLOCK_PLACE: i32 = 0x2e;
pub const USE_ITEM: i32 = 0x2f;
}
pub use crate::defs::p340::play::serverbound::ClientCommandActionId;
pub use crate::defs::p340::play::serverbound::EntityActionActionId;
pub use crate::defs::p754::play::serverbound::SetDifficultyNewDifficulty;
pub type TeleportConfirm = crate::defs::p340::play::serverbound::TeleportConfirm<754>;
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 QueryBlockNbt = crate::defs::p754::play::serverbound::QueryBlockNbt<754>;
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 SetDifficulty = crate::defs::p754::play::serverbound::SetDifficulty<754>;
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 Chat = crate::defs::p47::play::serverbound::Chat<754>;
impl crate::packet::Packet for Chat {
const ID: i32 = id::CHAT;
const NAME: &'static str = "chat";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Chat> for ServerboundPlayPacket {
fn from(p: Chat) -> Self {
Self::Chat(p)
}
}
pub type ClientCommand = crate::defs::p340::play::serverbound::ClientCommand<754>;
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 Settings = crate::defs::p340::play::serverbound::Settings<754>;
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<754>;
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 Transaction = crate::defs::p47::play::serverbound::Transaction<754>;
impl crate::packet::Packet for Transaction {
const ID: i32 = id::TRANSACTION;
const NAME: &'static str = "transaction";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<Transaction> for ServerboundPlayPacket {
fn from(p: Transaction) -> Self {
Self::Transaction(p)
}
}
pub type EnchantItem = crate::defs::p47::play::serverbound::EnchantItem<754>;
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::p754::play::serverbound::WindowClick<754>;
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::p47::play::serverbound::CloseWindow<754>;
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 CustomPayload = crate::defs::p47::play::serverbound::CustomPayload<754>;
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 EditBook = crate::defs::p754::play::serverbound::EditBook<754>;
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<754>;
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::p754::play::serverbound::UseEntity<754>;
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<754>;
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<754>;
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<754>;
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::p47::play::serverbound::Position<754>;
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::p47::play::serverbound::PositionLook<754>;
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::p47::play::serverbound::Look<754>;
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::p47::play::serverbound::Flying<754>;
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::p340::play::serverbound::VehicleMove<754>;
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<754>;
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 PickItem = crate::defs::p754::play::serverbound::PickItem<754>;
impl crate::packet::Packet for PickItem {
const ID: i32 = id::PICK_ITEM;
const NAME: &'static str = "pick_item";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<PickItem> for ServerboundPlayPacket {
fn from(p: PickItem) -> Self {
Self::PickItem(p)
}
}
pub type CraftRecipeRequest = crate::defs::p754::play::serverbound::CraftRecipeRequest<754>;
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<754>;
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::p754::play::serverbound::BlockDig<754>;
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::p340::play::serverbound::EntityAction<754>;
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 SteerVehicle = crate::defs::p47::play::serverbound::SteerVehicle<754>;
impl crate::packet::Packet for SteerVehicle {
const ID: i32 = id::STEER_VEHICLE;
const NAME: &'static str = "steer_vehicle";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Serverbound;
}
impl From<SteerVehicle> for ServerboundPlayPacket {
fn from(p: SteerVehicle) -> Self {
Self::SteerVehicle(p)
}
}
pub type RecipeBook = crate::defs::p754::play::serverbound::RecipeBook<754>;
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::p754::play::serverbound::DisplayedRecipe<754>;
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<754>;
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::p340::play::serverbound::ResourcePackReceive<754>;
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<754>;
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<754>;
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::p754::play::serverbound::SetBeaconEffect<754>;
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<754>;
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<754>;
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<754>;
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::p754::play::serverbound::SetCreativeSlot<754>;
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 UpdateJigsawBlock = crate::defs::p754::play::serverbound::UpdateJigsawBlock<754>;
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::p754::play::serverbound::UpdateStructureBlock<754>;
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 UpdateSign = crate::defs::p754::play::serverbound::UpdateSign<754>;
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 ArmAnimation = crate::defs::p340::play::serverbound::ArmAnimation<754>;
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<754>;
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 BlockPlace = crate::defs::p754::play::serverbound::BlockPlace<754>;
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::p340::play::serverbound::UseItem<754>;
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)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum ServerboundPlayPacket {
TeleportConfirm(TeleportConfirm),
QueryBlockNbt(QueryBlockNbt),
SetDifficulty(SetDifficulty),
Chat(Chat),
ClientCommand(ClientCommand),
Settings(Settings),
TabComplete(TabComplete),
Transaction(Transaction),
EnchantItem(EnchantItem),
WindowClick(WindowClick),
CloseWindow(CloseWindow),
CustomPayload(CustomPayload),
EditBook(EditBook),
QueryEntityNbt(QueryEntityNbt),
UseEntity(UseEntity),
GenerateStructure(GenerateStructure),
KeepAlive(KeepAlive),
LockDifficulty(LockDifficulty),
Position(Position),
PositionLook(PositionLook),
Look(Look),
Flying(Flying),
VehicleMove(VehicleMove),
SteerBoat(SteerBoat),
PickItem(PickItem),
CraftRecipeRequest(CraftRecipeRequest),
Abilities(Abilities),
BlockDig(BlockDig),
EntityAction(EntityAction),
SteerVehicle(SteerVehicle),
RecipeBook(RecipeBook),
DisplayedRecipe(DisplayedRecipe),
NameItem(NameItem),
ResourcePackReceive(ResourcePackReceive),
AdvancementTab(AdvancementTab),
SelectTrade(SelectTrade),
SetBeaconEffect(SetBeaconEffect),
HeldItemSlot(HeldItemSlot),
UpdateCommandBlock(UpdateCommandBlock),
UpdateCommandBlockMinecart(UpdateCommandBlockMinecart),
SetCreativeSlot(SetCreativeSlot),
UpdateJigsawBlock(UpdateJigsawBlock),
UpdateStructureBlock(UpdateStructureBlock),
UpdateSign(UpdateSign),
ArmAnimation(ArmAnimation),
Spectate(Spectate),
BlockPlace(BlockPlace),
UseItem(UseItem),
}
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::QUERY_BLOCK_NBT => decode_exact(&raw.body).map(Self::QueryBlockNbt),
id::SET_DIFFICULTY => decode_exact(&raw.body).map(Self::SetDifficulty),
id::CHAT => decode_exact(&raw.body).map(Self::Chat),
id::CLIENT_COMMAND => decode_exact(&raw.body).map(Self::ClientCommand),
id::SETTINGS => decode_exact(&raw.body).map(Self::Settings),
id::TAB_COMPLETE => decode_exact(&raw.body).map(Self::TabComplete),
id::TRANSACTION => decode_exact(&raw.body).map(Self::Transaction),
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::CUSTOM_PAYLOAD => decode_exact(&raw.body).map(Self::CustomPayload),
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 => decode_exact(&raw.body).map(Self::PickItem),
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::STEER_VEHICLE => decode_exact(&raw.body).map(Self::SteerVehicle),
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::UPDATE_JIGSAW_BLOCK => decode_exact(&raw.body).map(Self::UpdateJigsawBlock),
id::UPDATE_STRUCTURE_BLOCK => decode_exact(&raw.body).map(Self::UpdateStructureBlock),
id::UPDATE_SIGN => decode_exact(&raw.body).map(Self::UpdateSign),
id::ARM_ANIMATION => decode_exact(&raw.body).map(Self::ArmAnimation),
id::SPECTATE => decode_exact(&raw.body).map(Self::Spectate),
id::BLOCK_PLACE => decode_exact(&raw.body).map(Self::BlockPlace),
id::USE_ITEM => decode_exact(&raw.body).map(Self::UseItem),
other => Err(DecodeError::UnknownPacketId(other)),
}
}
fn id(&self) -> i32 {
match *self {
Self::TeleportConfirm(_) => id::TELEPORT_CONFIRM,
Self::QueryBlockNbt(_) => id::QUERY_BLOCK_NBT,
Self::SetDifficulty(_) => id::SET_DIFFICULTY,
Self::Chat(_) => id::CHAT,
Self::ClientCommand(_) => id::CLIENT_COMMAND,
Self::Settings(_) => id::SETTINGS,
Self::TabComplete(_) => id::TAB_COMPLETE,
Self::Transaction(_) => id::TRANSACTION,
Self::EnchantItem(_) => id::ENCHANT_ITEM,
Self::WindowClick(_) => id::WINDOW_CLICK,
Self::CloseWindow(_) => id::CLOSE_WINDOW,
Self::CustomPayload(_) => id::CUSTOM_PAYLOAD,
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::PickItem(_) => id::PICK_ITEM,
Self::CraftRecipeRequest(_) => id::CRAFT_RECIPE_REQUEST,
Self::Abilities(_) => id::ABILITIES,
Self::BlockDig(_) => id::BLOCK_DIG,
Self::EntityAction(_) => id::ENTITY_ACTION,
Self::SteerVehicle(_) => id::STEER_VEHICLE,
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::UpdateJigsawBlock(_) => id::UPDATE_JIGSAW_BLOCK,
Self::UpdateStructureBlock(_) => id::UPDATE_STRUCTURE_BLOCK,
Self::UpdateSign(_) => id::UPDATE_SIGN,
Self::ArmAnimation(_) => id::ARM_ANIMATION,
Self::Spectate(_) => id::SPECTATE,
Self::BlockPlace(_) => id::BLOCK_PLACE,
Self::UseItem(_) => id::USE_ITEM,
}
}
fn name(&self) -> &'static str {
match *self {
Self::TeleportConfirm(_) => "teleport_confirm",
Self::QueryBlockNbt(_) => "query_block_nbt",
Self::SetDifficulty(_) => "set_difficulty",
Self::Chat(_) => "chat",
Self::ClientCommand(_) => "client_command",
Self::Settings(_) => "settings",
Self::TabComplete(_) => "tab_complete",
Self::Transaction(_) => "transaction",
Self::EnchantItem(_) => "enchant_item",
Self::WindowClick(_) => "window_click",
Self::CloseWindow(_) => "close_window",
Self::CustomPayload(_) => "custom_payload",
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::PickItem(_) => "pick_item",
Self::CraftRecipeRequest(_) => "craft_recipe_request",
Self::Abilities(_) => "abilities",
Self::BlockDig(_) => "block_dig",
Self::EntityAction(_) => "entity_action",
Self::SteerVehicle(_) => "steer_vehicle",
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::UpdateJigsawBlock(_) => "update_jigsaw_block",
Self::UpdateStructureBlock(_) => "update_structure_block",
Self::UpdateSign(_) => "update_sign",
Self::ArmAnimation(_) => "arm_animation",
Self::Spectate(_) => "spectate",
Self::BlockPlace(_) => "block_place",
Self::UseItem(_) => "use_item",
}
}
fn encode_body(&self, w: &mut BytesMut) -> EncodeResult {
match *self {
Self::TeleportConfirm(ref p) => p.encode(w),
Self::QueryBlockNbt(ref p) => p.encode(w),
Self::SetDifficulty(ref p) => p.encode(w),
Self::Chat(ref p) => p.encode(w),
Self::ClientCommand(ref p) => p.encode(w),
Self::Settings(ref p) => p.encode(w),
Self::TabComplete(ref p) => p.encode(w),
Self::Transaction(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::CustomPayload(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::PickItem(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::SteerVehicle(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::UpdateJigsawBlock(ref p) => p.encode(w),
Self::UpdateStructureBlock(ref p) => p.encode(w),
Self::UpdateSign(ref p) => p.encode(w),
Self::ArmAnimation(ref p) => p.encode(w),
Self::Spectate(ref p) => p.encode(w),
Self::BlockPlace(ref p) => p.encode(w),
Self::UseItem(ref p) => p.encode(w),
}
}
fn name_of(id: i32) -> Option<&'static str> {
match id {
id::TELEPORT_CONFIRM => Some("teleport_confirm"),
id::QUERY_BLOCK_NBT => Some("query_block_nbt"),
id::SET_DIFFICULTY => Some("set_difficulty"),
id::CHAT => Some("chat"),
id::CLIENT_COMMAND => Some("client_command"),
id::SETTINGS => Some("settings"),
id::TAB_COMPLETE => Some("tab_complete"),
id::TRANSACTION => Some("transaction"),
id::ENCHANT_ITEM => Some("enchant_item"),
id::WINDOW_CLICK => Some("window_click"),
id::CLOSE_WINDOW => Some("close_window"),
id::CUSTOM_PAYLOAD => Some("custom_payload"),
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 => Some("pick_item"),
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::STEER_VEHICLE => Some("steer_vehicle"),
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::UPDATE_JIGSAW_BLOCK => Some("update_jigsaw_block"),
id::UPDATE_STRUCTURE_BLOCK => Some("update_structure_block"),
id::UPDATE_SIGN => Some("update_sign"),
id::ARM_ANIMATION => Some("arm_animation"),
id::SPECTATE => Some("spectate"),
id::BLOCK_PLACE => Some("block_place"),
id::USE_ITEM => Some("use_item"),
_ => None,
}
}
}
impl ServerboundPlayPacket {
pub const IDS: &'static [i32] = &[
id::TELEPORT_CONFIRM,
id::QUERY_BLOCK_NBT,
id::SET_DIFFICULTY,
id::CHAT,
id::CLIENT_COMMAND,
id::SETTINGS,
id::TAB_COMPLETE,
id::TRANSACTION,
id::ENCHANT_ITEM,
id::WINDOW_CLICK,
id::CLOSE_WINDOW,
id::CUSTOM_PAYLOAD,
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,
id::CRAFT_RECIPE_REQUEST,
id::ABILITIES,
id::BLOCK_DIG,
id::ENTITY_ACTION,
id::STEER_VEHICLE,
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::UPDATE_JIGSAW_BLOCK,
id::UPDATE_STRUCTURE_BLOCK,
id::UPDATE_SIGN,
id::ARM_ANIMATION,
id::SPECTATE,
id::BLOCK_PLACE,
id::USE_ITEM,
];
#[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::QUERY_BLOCK_NBT => Some(Self::QueryBlockNbt(
<QueryBlockNbt as Generate>::generate(g),
)),
id::SET_DIFFICULTY => Some(Self::SetDifficulty(<SetDifficulty as Generate>::generate(
g,
))),
id::CHAT => Some(Self::Chat(<Chat as Generate>::generate(g))),
id::CLIENT_COMMAND => Some(Self::ClientCommand(<ClientCommand 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::TRANSACTION => Some(Self::Transaction(<Transaction 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::CUSTOM_PAYLOAD => Some(Self::CustomPayload(<CustomPayload 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 => Some(Self::PickItem(<PickItem 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::STEER_VEHICLE => Some(Self::SteerVehicle(<SteerVehicle 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::UPDATE_JIGSAW_BLOCK => Some(Self::UpdateJigsawBlock(
<UpdateJigsawBlock as Generate>::generate(g),
)),
id::UPDATE_STRUCTURE_BLOCK => Some(Self::UpdateStructureBlock(
<UpdateStructureBlock as Generate>::generate(g),
)),
id::UPDATE_SIGN => Some(Self::UpdateSign(<UpdateSign 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::BLOCK_PLACE => Some(Self::BlockPlace(<BlockPlace as Generate>::generate(g))),
id::USE_ITEM => Some(Self::UseItem(<UseItem as Generate>::generate(g))),
_ => None,
}
}
}