#![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 SPAWN_ENTITY: i32 = 0x00;
pub const SPAWN_ENTITY_EXPERIENCE_ORB: i32 = 0x01;
pub const SPAWN_ENTITY_WEATHER: i32 = 0x02;
pub const SPAWN_ENTITY_LIVING: i32 = 0x03;
pub const SPAWN_ENTITY_PAINTING: i32 = 0x04;
pub const NAMED_ENTITY_SPAWN: i32 = 0x05;
pub const ANIMATION: i32 = 0x06;
pub const STATISTICS: i32 = 0x07;
pub const BLOCK_BREAK_ANIMATION: i32 = 0x08;
pub const TILE_ENTITY_DATA: i32 = 0x09;
pub const BLOCK_ACTION: i32 = 0x0a;
pub const BLOCK_CHANGE: i32 = 0x0b;
pub const BOSS_BAR: i32 = 0x0c;
pub const DIFFICULTY: i32 = 0x0d;
pub const TAB_COMPLETE: i32 = 0x0e;
pub const CHAT: i32 = 0x0f;
pub const MULTI_BLOCK_CHANGE: i32 = 0x10;
pub const TRANSACTION: i32 = 0x11;
pub const CLOSE_WINDOW: i32 = 0x12;
pub const OPEN_WINDOW: i32 = 0x13;
pub const WINDOW_ITEMS: i32 = 0x14;
pub const CRAFT_PROGRESS_BAR: i32 = 0x15;
pub const SET_SLOT: i32 = 0x16;
pub const SET_COOLDOWN: i32 = 0x17;
pub const CUSTOM_PAYLOAD: i32 = 0x18;
pub const NAMED_SOUND_EFFECT: i32 = 0x19;
pub const KICK_DISCONNECT: i32 = 0x1a;
pub const ENTITY_STATUS: i32 = 0x1b;
pub const EXPLOSION: i32 = 0x1c;
pub const UNLOAD_CHUNK: i32 = 0x1d;
pub const GAME_STATE_CHANGE: i32 = 0x1e;
pub const KEEP_ALIVE: i32 = 0x1f;
pub const MAP_CHUNK: i32 = 0x20;
pub const WORLD_EVENT: i32 = 0x21;
pub const WORLD_PARTICLES: i32 = 0x22;
pub const LOGIN: i32 = 0x23;
pub const MAP: i32 = 0x24;
pub const ENTITY: i32 = 0x25;
pub const REL_ENTITY_MOVE: i32 = 0x26;
pub const ENTITY_MOVE_LOOK: i32 = 0x27;
pub const ENTITY_LOOK: i32 = 0x28;
pub const VEHICLE_MOVE: i32 = 0x29;
pub const OPEN_SIGN_ENTITY: i32 = 0x2a;
pub const CRAFT_RECIPE_RESPONSE: i32 = 0x2b;
pub const ABILITIES: i32 = 0x2c;
pub const COMBAT_EVENT: i32 = 0x2d;
pub const PLAYER_INFO: i32 = 0x2e;
pub const POSITION: i32 = 0x2f;
pub const BED: i32 = 0x30;
pub const UNLOCK_RECIPES: i32 = 0x31;
pub const ENTITY_DESTROY: i32 = 0x32;
pub const REMOVE_ENTITY_EFFECT: i32 = 0x33;
pub const RESOURCE_PACK_SEND: i32 = 0x34;
pub const RESPAWN: i32 = 0x35;
pub const ENTITY_HEAD_ROTATION: i32 = 0x36;
pub const SELECT_ADVANCEMENT_TAB: i32 = 0x37;
pub const WORLD_BORDER: i32 = 0x38;
pub const CAMERA: i32 = 0x39;
pub const HELD_ITEM_SLOT: i32 = 0x3a;
pub const SCOREBOARD_DISPLAY_OBJECTIVE: i32 = 0x3b;
pub const ENTITY_METADATA: i32 = 0x3c;
pub const ATTACH_ENTITY: i32 = 0x3d;
pub const ENTITY_VELOCITY: i32 = 0x3e;
pub const ENTITY_EQUIPMENT: i32 = 0x3f;
pub const EXPERIENCE: i32 = 0x40;
pub const UPDATE_HEALTH: i32 = 0x41;
pub const SCOREBOARD_OBJECTIVE: i32 = 0x42;
pub const SET_PASSENGERS: i32 = 0x43;
pub const TEAMS: i32 = 0x44;
pub const SCOREBOARD_SCORE: i32 = 0x45;
pub const SPAWN_POSITION: i32 = 0x46;
pub const UPDATE_TIME: i32 = 0x47;
pub const TITLE: i32 = 0x48;
pub const SOUND_EFFECT: i32 = 0x49;
pub const PLAYERLIST_HEADER: i32 = 0x4a;
pub const COLLECT: i32 = 0x4b;
pub const ENTITY_TELEPORT: i32 = 0x4c;
pub const ADVANCEMENTS: i32 = 0x4d;
pub const ENTITY_UPDATE_ATTRIBUTES: i32 = 0x4e;
pub const ENTITY_EFFECT: i32 = 0x4f;
}
pub use crate::defs::p47::play::clientbound::DifficultyDifficulty;
pub use crate::defs::p47::play::clientbound::ExplosionAffectedBlockOffsets;
pub use crate::defs::p47::play::clientbound::GameStateChangeReason;
pub use crate::defs::p47::play::clientbound::MapIcons;
pub use crate::defs::p47::play::clientbound::MultiBlockChangeRecords;
pub use crate::defs::p47::play::clientbound::PlayerInfoAction;
pub use crate::defs::p47::play::clientbound::PlayerInfoData;
pub use crate::defs::p47::play::clientbound::PlayerInfoDataBody;
pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyAddPlayer;
pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyAddPlayerProperties;
pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyUpdateDisplayName;
pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyUpdateGameMode;
pub use crate::defs::p47::play::clientbound::PlayerInfoDataBodyUpdateLatency;
pub use crate::defs::p47::play::clientbound::StatisticsEntries;
pub use crate::defs::p47::play::clientbound::WorldParticlesData;
pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMapping;
pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMappingValue;
pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMappingValueCriteria;
pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMappingValueDisplayData;
pub use crate::defs::p340::play::clientbound::AdvancementsAdvancementMappingValueDisplayDataFlags;
pub use crate::defs::p340::play::clientbound::AdvancementsProgressMapping;
pub use crate::defs::p340::play::clientbound::AdvancementsProgressMappingValue;
pub use crate::defs::p340::play::clientbound::EntityUpdateAttributesProperties;
pub use crate::defs::p340::play::clientbound::EntityUpdateAttributesPropertiesModifiers;
pub type SpawnEntity = crate::defs::p340::play::clientbound::SpawnEntity<338>;
impl crate::packet::Packet for SpawnEntity {
const ID: i32 = id::SPAWN_ENTITY;
const NAME: &'static str = "spawn_entity";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SpawnEntity> for ClientboundPlayPacket {
fn from(p: SpawnEntity) -> Self {
Self::SpawnEntity(p)
}
}
pub type SpawnEntityExperienceOrb =
crate::defs::p340::play::clientbound::SpawnEntityExperienceOrb<338>;
impl crate::packet::Packet for SpawnEntityExperienceOrb {
const ID: i32 = id::SPAWN_ENTITY_EXPERIENCE_ORB;
const NAME: &'static str = "spawn_entity_experience_orb";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SpawnEntityExperienceOrb> for ClientboundPlayPacket {
fn from(p: SpawnEntityExperienceOrb) -> Self {
Self::SpawnEntityExperienceOrb(p)
}
}
pub type SpawnEntityWeather = crate::defs::p340::play::clientbound::SpawnEntityWeather<338>;
impl crate::packet::Packet for SpawnEntityWeather {
const ID: i32 = id::SPAWN_ENTITY_WEATHER;
const NAME: &'static str = "spawn_entity_weather";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SpawnEntityWeather> for ClientboundPlayPacket {
fn from(p: SpawnEntityWeather) -> Self {
Self::SpawnEntityWeather(p)
}
}
pub type SpawnEntityLiving = crate::defs::p340::play::clientbound::SpawnEntityLiving<338>;
impl crate::packet::Packet for SpawnEntityLiving {
const ID: i32 = id::SPAWN_ENTITY_LIVING;
const NAME: &'static str = "spawn_entity_living";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SpawnEntityLiving> for ClientboundPlayPacket {
fn from(p: SpawnEntityLiving) -> Self {
Self::SpawnEntityLiving(p)
}
}
pub type SpawnEntityPainting = crate::defs::p340::play::clientbound::SpawnEntityPainting<338>;
impl crate::packet::Packet for SpawnEntityPainting {
const ID: i32 = id::SPAWN_ENTITY_PAINTING;
const NAME: &'static str = "spawn_entity_painting";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SpawnEntityPainting> for ClientboundPlayPacket {
fn from(p: SpawnEntityPainting) -> Self {
Self::SpawnEntityPainting(p)
}
}
pub type NamedEntitySpawn = crate::defs::p340::play::clientbound::NamedEntitySpawn<338>;
impl crate::packet::Packet for NamedEntitySpawn {
const ID: i32 = id::NAMED_ENTITY_SPAWN;
const NAME: &'static str = "named_entity_spawn";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<NamedEntitySpawn> for ClientboundPlayPacket {
fn from(p: NamedEntitySpawn) -> Self {
Self::NamedEntitySpawn(p)
}
}
pub type Animation = crate::defs::p47::play::clientbound::Animation<338>;
impl crate::packet::Packet for Animation {
const ID: i32 = id::ANIMATION;
const NAME: &'static str = "animation";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Animation> for ClientboundPlayPacket {
fn from(p: Animation) -> Self {
Self::Animation(p)
}
}
pub type Statistics = crate::defs::p47::play::clientbound::Statistics<338>;
impl crate::packet::Packet for Statistics {
const ID: i32 = id::STATISTICS;
const NAME: &'static str = "statistics";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Statistics> for ClientboundPlayPacket {
fn from(p: Statistics) -> Self {
Self::Statistics(p)
}
}
pub type BlockBreakAnimation = crate::defs::p47::play::clientbound::BlockBreakAnimation<338>;
impl crate::packet::Packet for BlockBreakAnimation {
const ID: i32 = id::BLOCK_BREAK_ANIMATION;
const NAME: &'static str = "block_break_animation";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<BlockBreakAnimation> for ClientboundPlayPacket {
fn from(p: BlockBreakAnimation) -> Self {
Self::BlockBreakAnimation(p)
}
}
pub type TileEntityData = crate::defs::p47::play::clientbound::TileEntityData<338>;
impl crate::packet::Packet for TileEntityData {
const ID: i32 = id::TILE_ENTITY_DATA;
const NAME: &'static str = "tile_entity_data";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<TileEntityData> for ClientboundPlayPacket {
fn from(p: TileEntityData) -> Self {
Self::TileEntityData(p)
}
}
pub type BlockAction = crate::defs::p47::play::clientbound::BlockAction<338>;
impl crate::packet::Packet for BlockAction {
const ID: i32 = id::BLOCK_ACTION;
const NAME: &'static str = "block_action";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<BlockAction> for ClientboundPlayPacket {
fn from(p: BlockAction) -> Self {
Self::BlockAction(p)
}
}
pub type BlockChange = crate::defs::p47::play::clientbound::BlockChange<338>;
impl crate::packet::Packet for BlockChange {
const ID: i32 = id::BLOCK_CHANGE;
const NAME: &'static str = "block_change";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<BlockChange> for ClientboundPlayPacket {
fn from(p: BlockChange) -> Self {
Self::BlockChange(p)
}
}
pub type BossBar = crate::defs::p340::play::clientbound::BossBar<338>;
impl crate::packet::Packet for BossBar {
const ID: i32 = id::BOSS_BAR;
const NAME: &'static str = "boss_bar";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<BossBar> for ClientboundPlayPacket {
fn from(p: BossBar) -> Self {
Self::BossBar(p)
}
}
pub type Difficulty = crate::defs::p47::play::clientbound::Difficulty<338>;
impl crate::packet::Packet for Difficulty {
const ID: i32 = id::DIFFICULTY;
const NAME: &'static str = "difficulty";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Difficulty> for ClientboundPlayPacket {
fn from(p: Difficulty) -> Self {
Self::Difficulty(p)
}
}
pub type TabComplete = crate::defs::p47::play::clientbound::TabComplete<338>;
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::Clientbound;
}
impl From<TabComplete> for ClientboundPlayPacket {
fn from(p: TabComplete) -> Self {
Self::TabComplete(p)
}
}
pub type Chat = crate::defs::p47::play::clientbound::Chat<338>;
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::Clientbound;
}
impl From<Chat> for ClientboundPlayPacket {
fn from(p: Chat) -> Self {
Self::Chat(p)
}
}
pub type MultiBlockChange = crate::defs::p47::play::clientbound::MultiBlockChange<338>;
impl crate::packet::Packet for MultiBlockChange {
const ID: i32 = id::MULTI_BLOCK_CHANGE;
const NAME: &'static str = "multi_block_change";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<MultiBlockChange> for ClientboundPlayPacket {
fn from(p: MultiBlockChange) -> Self {
Self::MultiBlockChange(p)
}
}
pub type Transaction = crate::defs::p47::play::clientbound::Transaction<338>;
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::Clientbound;
}
impl From<Transaction> for ClientboundPlayPacket {
fn from(p: Transaction) -> Self {
Self::Transaction(p)
}
}
pub type CloseWindow = crate::defs::p47::play::clientbound::CloseWindow<338>;
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::Clientbound;
}
impl From<CloseWindow> for ClientboundPlayPacket {
fn from(p: CloseWindow) -> Self {
Self::CloseWindow(p)
}
}
pub type OpenWindow = crate::defs::p47::play::clientbound::OpenWindow<338>;
impl crate::packet::Packet for OpenWindow {
const ID: i32 = id::OPEN_WINDOW;
const NAME: &'static str = "open_window";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<OpenWindow> for ClientboundPlayPacket {
fn from(p: OpenWindow) -> Self {
Self::OpenWindow(p)
}
}
pub type WindowItems = crate::defs::p47::play::clientbound::WindowItems<338>;
impl crate::packet::Packet for WindowItems {
const ID: i32 = id::WINDOW_ITEMS;
const NAME: &'static str = "window_items";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<WindowItems> for ClientboundPlayPacket {
fn from(p: WindowItems) -> Self {
Self::WindowItems(p)
}
}
pub type CraftProgressBar = crate::defs::p47::play::clientbound::CraftProgressBar<338>;
impl crate::packet::Packet for CraftProgressBar {
const ID: i32 = id::CRAFT_PROGRESS_BAR;
const NAME: &'static str = "craft_progress_bar";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<CraftProgressBar> for ClientboundPlayPacket {
fn from(p: CraftProgressBar) -> Self {
Self::CraftProgressBar(p)
}
}
pub type SetSlot = crate::defs::p47::play::clientbound::SetSlot<338>;
impl crate::packet::Packet for SetSlot {
const ID: i32 = id::SET_SLOT;
const NAME: &'static str = "set_slot";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SetSlot> for ClientboundPlayPacket {
fn from(p: SetSlot) -> Self {
Self::SetSlot(p)
}
}
pub type SetCooldown = crate::defs::p340::play::clientbound::SetCooldown<338>;
impl crate::packet::Packet for SetCooldown {
const ID: i32 = id::SET_COOLDOWN;
const NAME: &'static str = "set_cooldown";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SetCooldown> for ClientboundPlayPacket {
fn from(p: SetCooldown) -> Self {
Self::SetCooldown(p)
}
}
pub type CustomPayload = crate::defs::p47::play::clientbound::CustomPayload<338>;
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::Clientbound;
}
impl From<CustomPayload> for ClientboundPlayPacket {
fn from(p: CustomPayload) -> Self {
Self::CustomPayload(p)
}
}
pub type NamedSoundEffect = crate::defs::p340::play::clientbound::NamedSoundEffect<338>;
impl crate::packet::Packet for NamedSoundEffect {
const ID: i32 = id::NAMED_SOUND_EFFECT;
const NAME: &'static str = "named_sound_effect";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<NamedSoundEffect> for ClientboundPlayPacket {
fn from(p: NamedSoundEffect) -> Self {
Self::NamedSoundEffect(p)
}
}
pub type KickDisconnect = crate::defs::p47::play::clientbound::KickDisconnect<338>;
impl crate::packet::Packet for KickDisconnect {
const ID: i32 = id::KICK_DISCONNECT;
const NAME: &'static str = "kick_disconnect";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<KickDisconnect> for ClientboundPlayPacket {
fn from(p: KickDisconnect) -> Self {
Self::KickDisconnect(p)
}
}
pub type EntityStatus = crate::defs::p47::play::clientbound::EntityStatus<338>;
impl crate::packet::Packet for EntityStatus {
const ID: i32 = id::ENTITY_STATUS;
const NAME: &'static str = "entity_status";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityStatus> for ClientboundPlayPacket {
fn from(p: EntityStatus) -> Self {
Self::EntityStatus(p)
}
}
pub type Explosion = crate::defs::p47::play::clientbound::Explosion<338>;
impl crate::packet::Packet for Explosion {
const ID: i32 = id::EXPLOSION;
const NAME: &'static str = "explosion";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Explosion> for ClientboundPlayPacket {
fn from(p: Explosion) -> Self {
Self::Explosion(p)
}
}
pub type UnloadChunk = crate::defs::p340::play::clientbound::UnloadChunk<338>;
impl crate::packet::Packet for UnloadChunk {
const ID: i32 = id::UNLOAD_CHUNK;
const NAME: &'static str = "unload_chunk";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<UnloadChunk> for ClientboundPlayPacket {
fn from(p: UnloadChunk) -> Self {
Self::UnloadChunk(p)
}
}
pub type GameStateChange = crate::defs::p47::play::clientbound::GameStateChange<338>;
impl crate::packet::Packet for GameStateChange {
const ID: i32 = id::GAME_STATE_CHANGE;
const NAME: &'static str = "game_state_change";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<GameStateChange> for ClientboundPlayPacket {
fn from(p: GameStateChange) -> Self {
Self::GameStateChange(p)
}
}
pub type KeepAlive = crate::defs::p47::play::clientbound::KeepAlive<338>;
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::Clientbound;
}
impl From<KeepAlive> for ClientboundPlayPacket {
fn from(p: KeepAlive) -> Self {
Self::KeepAlive(p)
}
}
pub type MapChunk = crate::defs::p340::play::clientbound::MapChunk<338>;
impl crate::packet::Packet for MapChunk {
const ID: i32 = id::MAP_CHUNK;
const NAME: &'static str = "map_chunk";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<MapChunk> for ClientboundPlayPacket {
fn from(p: MapChunk) -> Self {
Self::MapChunk(p)
}
}
pub type WorldEvent = crate::defs::p47::play::clientbound::WorldEvent<338>;
impl crate::packet::Packet for WorldEvent {
const ID: i32 = id::WORLD_EVENT;
const NAME: &'static str = "world_event";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<WorldEvent> for ClientboundPlayPacket {
fn from(p: WorldEvent) -> Self {
Self::WorldEvent(p)
}
}
pub type WorldParticles = crate::defs::p47::play::clientbound::WorldParticles<338>;
impl crate::packet::Packet for WorldParticles {
const ID: i32 = id::WORLD_PARTICLES;
const NAME: &'static str = "world_particles";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<WorldParticles> for ClientboundPlayPacket {
fn from(p: WorldParticles) -> Self {
Self::WorldParticles(p)
}
}
pub type Login = crate::defs::p340::play::clientbound::Login<338>;
impl crate::packet::Packet for Login {
const ID: i32 = id::LOGIN;
const NAME: &'static str = "login";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Login> for ClientboundPlayPacket {
fn from(p: Login) -> Self {
Self::Login(p)
}
}
pub type Map = crate::defs::p340::play::clientbound::Map<338>;
impl crate::packet::Packet for Map {
const ID: i32 = id::MAP;
const NAME: &'static str = "map";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Map> for ClientboundPlayPacket {
fn from(p: Map) -> Self {
Self::Map(p)
}
}
pub type Entity = crate::defs::p47::play::clientbound::Entity<338>;
impl crate::packet::Packet for Entity {
const ID: i32 = id::ENTITY;
const NAME: &'static str = "entity";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Entity> for ClientboundPlayPacket {
fn from(p: Entity) -> Self {
Self::Entity(p)
}
}
pub type RelEntityMove = crate::defs::p340::play::clientbound::RelEntityMove<338>;
impl crate::packet::Packet for RelEntityMove {
const ID: i32 = id::REL_ENTITY_MOVE;
const NAME: &'static str = "rel_entity_move";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<RelEntityMove> for ClientboundPlayPacket {
fn from(p: RelEntityMove) -> Self {
Self::RelEntityMove(p)
}
}
pub type EntityMoveLook = crate::defs::p340::play::clientbound::EntityMoveLook<338>;
impl crate::packet::Packet for EntityMoveLook {
const ID: i32 = id::ENTITY_MOVE_LOOK;
const NAME: &'static str = "entity_move_look";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityMoveLook> for ClientboundPlayPacket {
fn from(p: EntityMoveLook) -> Self {
Self::EntityMoveLook(p)
}
}
pub type EntityLook = crate::defs::p47::play::clientbound::EntityLook<338>;
impl crate::packet::Packet for EntityLook {
const ID: i32 = id::ENTITY_LOOK;
const NAME: &'static str = "entity_look";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityLook> for ClientboundPlayPacket {
fn from(p: EntityLook) -> Self {
Self::EntityLook(p)
}
}
pub type VehicleMove = crate::defs::p340::play::clientbound::VehicleMove<338>;
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::Clientbound;
}
impl From<VehicleMove> for ClientboundPlayPacket {
fn from(p: VehicleMove) -> Self {
Self::VehicleMove(p)
}
}
pub type OpenSignEntity = crate::defs::p47::play::clientbound::OpenSignEntity<338>;
impl crate::packet::Packet for OpenSignEntity {
const ID: i32 = id::OPEN_SIGN_ENTITY;
const NAME: &'static str = "open_sign_entity";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<OpenSignEntity> for ClientboundPlayPacket {
fn from(p: OpenSignEntity) -> Self {
Self::OpenSignEntity(p)
}
}
pub type CraftRecipeResponse = crate::defs::p340::play::clientbound::CraftRecipeResponse<338>;
impl crate::packet::Packet for CraftRecipeResponse {
const ID: i32 = id::CRAFT_RECIPE_RESPONSE;
const NAME: &'static str = "craft_recipe_response";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<CraftRecipeResponse> for ClientboundPlayPacket {
fn from(p: CraftRecipeResponse) -> Self {
Self::CraftRecipeResponse(p)
}
}
pub type Abilities = crate::defs::p47::play::clientbound::Abilities<338>;
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::Clientbound;
}
impl From<Abilities> for ClientboundPlayPacket {
fn from(p: Abilities) -> Self {
Self::Abilities(p)
}
}
pub type CombatEvent = crate::defs::p47::play::clientbound::CombatEvent<338>;
impl crate::packet::Packet for CombatEvent {
const ID: i32 = id::COMBAT_EVENT;
const NAME: &'static str = "combat_event";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<CombatEvent> for ClientboundPlayPacket {
fn from(p: CombatEvent) -> Self {
Self::CombatEvent(p)
}
}
pub type PlayerInfo = crate::defs::p47::play::clientbound::PlayerInfo<338>;
impl crate::packet::Packet for PlayerInfo {
const ID: i32 = id::PLAYER_INFO;
const NAME: &'static str = "player_info";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<PlayerInfo> for ClientboundPlayPacket {
fn from(p: PlayerInfo) -> Self {
Self::PlayerInfo(p)
}
}
pub type Position = crate::defs::p340::play::clientbound::Position<338>;
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::Clientbound;
}
impl From<Position> for ClientboundPlayPacket {
fn from(p: Position) -> Self {
Self::Position(p)
}
}
pub type Bed = crate::defs::p47::play::clientbound::Bed<338>;
impl crate::packet::Packet for Bed {
const ID: i32 = id::BED;
const NAME: &'static str = "bed";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Bed> for ClientboundPlayPacket {
fn from(p: Bed) -> Self {
Self::Bed(p)
}
}
pub type UnlockRecipes = crate::defs::p340::play::clientbound::UnlockRecipes<338>;
impl crate::packet::Packet for UnlockRecipes {
const ID: i32 = id::UNLOCK_RECIPES;
const NAME: &'static str = "unlock_recipes";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<UnlockRecipes> for ClientboundPlayPacket {
fn from(p: UnlockRecipes) -> Self {
Self::UnlockRecipes(p)
}
}
pub type EntityDestroy = crate::defs::p47::play::clientbound::EntityDestroy<338>;
impl crate::packet::Packet for EntityDestroy {
const ID: i32 = id::ENTITY_DESTROY;
const NAME: &'static str = "entity_destroy";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityDestroy> for ClientboundPlayPacket {
fn from(p: EntityDestroy) -> Self {
Self::EntityDestroy(p)
}
}
pub type RemoveEntityEffect = crate::defs::p47::play::clientbound::RemoveEntityEffect<338>;
impl crate::packet::Packet for RemoveEntityEffect {
const ID: i32 = id::REMOVE_ENTITY_EFFECT;
const NAME: &'static str = "remove_entity_effect";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<RemoveEntityEffect> for ClientboundPlayPacket {
fn from(p: RemoveEntityEffect) -> Self {
Self::RemoveEntityEffect(p)
}
}
pub type ResourcePackSend = crate::defs::p47::play::clientbound::ResourcePackSend<338>;
impl crate::packet::Packet for ResourcePackSend {
const ID: i32 = id::RESOURCE_PACK_SEND;
const NAME: &'static str = "resource_pack_send";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<ResourcePackSend> for ClientboundPlayPacket {
fn from(p: ResourcePackSend) -> Self {
Self::ResourcePackSend(p)
}
}
pub type Respawn = crate::defs::p47::play::clientbound::Respawn<338>;
impl crate::packet::Packet for Respawn {
const ID: i32 = id::RESPAWN;
const NAME: &'static str = "respawn";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Respawn> for ClientboundPlayPacket {
fn from(p: Respawn) -> Self {
Self::Respawn(p)
}
}
pub type EntityHeadRotation = crate::defs::p47::play::clientbound::EntityHeadRotation<338>;
impl crate::packet::Packet for EntityHeadRotation {
const ID: i32 = id::ENTITY_HEAD_ROTATION;
const NAME: &'static str = "entity_head_rotation";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityHeadRotation> for ClientboundPlayPacket {
fn from(p: EntityHeadRotation) -> Self {
Self::EntityHeadRotation(p)
}
}
pub type SelectAdvancementTab = crate::defs::p340::play::clientbound::SelectAdvancementTab<338>;
impl crate::packet::Packet for SelectAdvancementTab {
const ID: i32 = id::SELECT_ADVANCEMENT_TAB;
const NAME: &'static str = "select_advancement_tab";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SelectAdvancementTab> for ClientboundPlayPacket {
fn from(p: SelectAdvancementTab) -> Self {
Self::SelectAdvancementTab(p)
}
}
pub type WorldBorder = crate::defs::p47::play::clientbound::WorldBorder<338>;
impl crate::packet::Packet for WorldBorder {
const ID: i32 = id::WORLD_BORDER;
const NAME: &'static str = "world_border";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<WorldBorder> for ClientboundPlayPacket {
fn from(p: WorldBorder) -> Self {
Self::WorldBorder(p)
}
}
pub type Camera = crate::defs::p47::play::clientbound::Camera<338>;
impl crate::packet::Packet for Camera {
const ID: i32 = id::CAMERA;
const NAME: &'static str = "camera";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Camera> for ClientboundPlayPacket {
fn from(p: Camera) -> Self {
Self::Camera(p)
}
}
pub type HeldItemSlot = crate::defs::p47::play::clientbound::HeldItemSlot<338>;
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::Clientbound;
}
impl From<HeldItemSlot> for ClientboundPlayPacket {
fn from(p: HeldItemSlot) -> Self {
Self::HeldItemSlot(p)
}
}
pub type ScoreboardDisplayObjective =
crate::defs::p47::play::clientbound::ScoreboardDisplayObjective<338>;
impl crate::packet::Packet for ScoreboardDisplayObjective {
const ID: i32 = id::SCOREBOARD_DISPLAY_OBJECTIVE;
const NAME: &'static str = "scoreboard_display_objective";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<ScoreboardDisplayObjective> for ClientboundPlayPacket {
fn from(p: ScoreboardDisplayObjective) -> Self {
Self::ScoreboardDisplayObjective(p)
}
}
pub type EntityMetadata = crate::defs::p340::play::clientbound::EntityMetadata<338>;
impl crate::packet::Packet for EntityMetadata {
const ID: i32 = id::ENTITY_METADATA;
const NAME: &'static str = "entity_metadata";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityMetadata> for ClientboundPlayPacket {
fn from(p: EntityMetadata) -> Self {
Self::EntityMetadata(p)
}
}
pub type AttachEntity = crate::defs::p340::play::clientbound::AttachEntity<338>;
impl crate::packet::Packet for AttachEntity {
const ID: i32 = id::ATTACH_ENTITY;
const NAME: &'static str = "attach_entity";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<AttachEntity> for ClientboundPlayPacket {
fn from(p: AttachEntity) -> Self {
Self::AttachEntity(p)
}
}
pub type EntityVelocity = crate::defs::p47::play::clientbound::EntityVelocity<338>;
impl crate::packet::Packet for EntityVelocity {
const ID: i32 = id::ENTITY_VELOCITY;
const NAME: &'static str = "entity_velocity";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityVelocity> for ClientboundPlayPacket {
fn from(p: EntityVelocity) -> Self {
Self::EntityVelocity(p)
}
}
pub type EntityEquipment = crate::defs::p340::play::clientbound::EntityEquipment<338>;
impl crate::packet::Packet for EntityEquipment {
const ID: i32 = id::ENTITY_EQUIPMENT;
const NAME: &'static str = "entity_equipment";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityEquipment> for ClientboundPlayPacket {
fn from(p: EntityEquipment) -> Self {
Self::EntityEquipment(p)
}
}
pub type Experience = crate::defs::p47::play::clientbound::Experience<338>;
impl crate::packet::Packet for Experience {
const ID: i32 = id::EXPERIENCE;
const NAME: &'static str = "experience";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Experience> for ClientboundPlayPacket {
fn from(p: Experience) -> Self {
Self::Experience(p)
}
}
pub type UpdateHealth = crate::defs::p47::play::clientbound::UpdateHealth<338>;
impl crate::packet::Packet for UpdateHealth {
const ID: i32 = id::UPDATE_HEALTH;
const NAME: &'static str = "update_health";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<UpdateHealth> for ClientboundPlayPacket {
fn from(p: UpdateHealth) -> Self {
Self::UpdateHealth(p)
}
}
pub type ScoreboardObjective = crate::defs::p47::play::clientbound::ScoreboardObjective<338>;
impl crate::packet::Packet for ScoreboardObjective {
const ID: i32 = id::SCOREBOARD_OBJECTIVE;
const NAME: &'static str = "scoreboard_objective";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<ScoreboardObjective> for ClientboundPlayPacket {
fn from(p: ScoreboardObjective) -> Self {
Self::ScoreboardObjective(p)
}
}
pub type SetPassengers = crate::defs::p340::play::clientbound::SetPassengers<338>;
impl crate::packet::Packet for SetPassengers {
const ID: i32 = id::SET_PASSENGERS;
const NAME: &'static str = "set_passengers";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SetPassengers> for ClientboundPlayPacket {
fn from(p: SetPassengers) -> Self {
Self::SetPassengers(p)
}
}
pub type Teams = crate::defs::p340::play::clientbound::Teams<338>;
impl crate::packet::Packet for Teams {
const ID: i32 = id::TEAMS;
const NAME: &'static str = "teams";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Teams> for ClientboundPlayPacket {
fn from(p: Teams) -> Self {
Self::Teams(p)
}
}
pub type ScoreboardScore = crate::defs::p47::play::clientbound::ScoreboardScore<338>;
impl crate::packet::Packet for ScoreboardScore {
const ID: i32 = id::SCOREBOARD_SCORE;
const NAME: &'static str = "scoreboard_score";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<ScoreboardScore> for ClientboundPlayPacket {
fn from(p: ScoreboardScore) -> Self {
Self::ScoreboardScore(p)
}
}
pub type SpawnPosition = crate::defs::p47::play::clientbound::SpawnPosition<338>;
impl crate::packet::Packet for SpawnPosition {
const ID: i32 = id::SPAWN_POSITION;
const NAME: &'static str = "spawn_position";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SpawnPosition> for ClientboundPlayPacket {
fn from(p: SpawnPosition) -> Self {
Self::SpawnPosition(p)
}
}
pub type UpdateTime = crate::defs::p47::play::clientbound::UpdateTime<338>;
impl crate::packet::Packet for UpdateTime {
const ID: i32 = id::UPDATE_TIME;
const NAME: &'static str = "update_time";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<UpdateTime> for ClientboundPlayPacket {
fn from(p: UpdateTime) -> Self {
Self::UpdateTime(p)
}
}
pub type Title = crate::defs::p340::play::clientbound::Title<338>;
impl crate::packet::Packet for Title {
const ID: i32 = id::TITLE;
const NAME: &'static str = "title";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Title> for ClientboundPlayPacket {
fn from(p: Title) -> Self {
Self::Title(p)
}
}
pub type SoundEffect = crate::defs::p340::play::clientbound::SoundEffect<338>;
impl crate::packet::Packet for SoundEffect {
const ID: i32 = id::SOUND_EFFECT;
const NAME: &'static str = "sound_effect";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<SoundEffect> for ClientboundPlayPacket {
fn from(p: SoundEffect) -> Self {
Self::SoundEffect(p)
}
}
pub type PlayerlistHeader = crate::defs::p47::play::clientbound::PlayerlistHeader<338>;
impl crate::packet::Packet for PlayerlistHeader {
const ID: i32 = id::PLAYERLIST_HEADER;
const NAME: &'static str = "playerlist_header";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<PlayerlistHeader> for ClientboundPlayPacket {
fn from(p: PlayerlistHeader) -> Self {
Self::PlayerlistHeader(p)
}
}
pub type Collect = crate::defs::p340::play::clientbound::Collect<338>;
impl crate::packet::Packet for Collect {
const ID: i32 = id::COLLECT;
const NAME: &'static str = "collect";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Collect> for ClientboundPlayPacket {
fn from(p: Collect) -> Self {
Self::Collect(p)
}
}
pub type EntityTeleport = crate::defs::p340::play::clientbound::EntityTeleport<338>;
impl crate::packet::Packet for EntityTeleport {
const ID: i32 = id::ENTITY_TELEPORT;
const NAME: &'static str = "entity_teleport";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityTeleport> for ClientboundPlayPacket {
fn from(p: EntityTeleport) -> Self {
Self::EntityTeleport(p)
}
}
pub type Advancements = crate::defs::p340::play::clientbound::Advancements<338>;
impl crate::packet::Packet for Advancements {
const ID: i32 = id::ADVANCEMENTS;
const NAME: &'static str = "advancements";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<Advancements> for ClientboundPlayPacket {
fn from(p: Advancements) -> Self {
Self::Advancements(p)
}
}
pub type EntityUpdateAttributes = crate::defs::p340::play::clientbound::EntityUpdateAttributes<338>;
impl crate::packet::Packet for EntityUpdateAttributes {
const ID: i32 = id::ENTITY_UPDATE_ATTRIBUTES;
const NAME: &'static str = "entity_update_attributes";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityUpdateAttributes> for ClientboundPlayPacket {
fn from(p: EntityUpdateAttributes) -> Self {
Self::EntityUpdateAttributes(p)
}
}
pub type EntityEffect = crate::defs::p340::play::clientbound::EntityEffect<338>;
impl crate::packet::Packet for EntityEffect {
const ID: i32 = id::ENTITY_EFFECT;
const NAME: &'static str = "entity_effect";
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
}
impl From<EntityEffect> for ClientboundPlayPacket {
fn from(p: EntityEffect) -> Self {
Self::EntityEffect(p)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum ClientboundPlayPacket {
SpawnEntity(SpawnEntity),
SpawnEntityExperienceOrb(SpawnEntityExperienceOrb),
SpawnEntityWeather(SpawnEntityWeather),
SpawnEntityLiving(SpawnEntityLiving),
SpawnEntityPainting(SpawnEntityPainting),
NamedEntitySpawn(NamedEntitySpawn),
Animation(Animation),
Statistics(Statistics),
BlockBreakAnimation(BlockBreakAnimation),
TileEntityData(TileEntityData),
BlockAction(BlockAction),
BlockChange(BlockChange),
BossBar(BossBar),
Difficulty(Difficulty),
TabComplete(TabComplete),
Chat(Chat),
MultiBlockChange(MultiBlockChange),
Transaction(Transaction),
CloseWindow(CloseWindow),
OpenWindow(OpenWindow),
WindowItems(WindowItems),
CraftProgressBar(CraftProgressBar),
SetSlot(SetSlot),
SetCooldown(SetCooldown),
CustomPayload(CustomPayload),
NamedSoundEffect(NamedSoundEffect),
KickDisconnect(KickDisconnect),
EntityStatus(EntityStatus),
Explosion(Explosion),
UnloadChunk(UnloadChunk),
GameStateChange(GameStateChange),
KeepAlive(KeepAlive),
MapChunk(MapChunk),
WorldEvent(WorldEvent),
WorldParticles(WorldParticles),
Login(Login),
Map(Map),
Entity(Entity),
RelEntityMove(RelEntityMove),
EntityMoveLook(EntityMoveLook),
EntityLook(EntityLook),
VehicleMove(VehicleMove),
OpenSignEntity(OpenSignEntity),
CraftRecipeResponse(CraftRecipeResponse),
Abilities(Abilities),
CombatEvent(CombatEvent),
PlayerInfo(PlayerInfo),
Position(Position),
Bed(Bed),
UnlockRecipes(UnlockRecipes),
EntityDestroy(EntityDestroy),
RemoveEntityEffect(RemoveEntityEffect),
ResourcePackSend(ResourcePackSend),
Respawn(Respawn),
EntityHeadRotation(EntityHeadRotation),
SelectAdvancementTab(SelectAdvancementTab),
WorldBorder(WorldBorder),
Camera(Camera),
HeldItemSlot(HeldItemSlot),
ScoreboardDisplayObjective(ScoreboardDisplayObjective),
EntityMetadata(EntityMetadata),
AttachEntity(AttachEntity),
EntityVelocity(EntityVelocity),
EntityEquipment(EntityEquipment),
Experience(Experience),
UpdateHealth(UpdateHealth),
ScoreboardObjective(ScoreboardObjective),
SetPassengers(SetPassengers),
Teams(Teams),
ScoreboardScore(ScoreboardScore),
SpawnPosition(SpawnPosition),
UpdateTime(UpdateTime),
Title(Title),
SoundEffect(SoundEffect),
PlayerlistHeader(PlayerlistHeader),
Collect(Collect),
EntityTeleport(EntityTeleport),
Advancements(Advancements),
EntityUpdateAttributes(EntityUpdateAttributes),
EntityEffect(EntityEffect),
}
impl PacketSet for ClientboundPlayPacket {
const STATE: State = State::Play;
const DIRECTION: Direction = Direction::Clientbound;
fn decode_raw(raw: &RawPacket) -> DecodeResult<Self> {
match raw.id {
id::SPAWN_ENTITY => decode_exact(&raw.body).map(Self::SpawnEntity),
id::SPAWN_ENTITY_EXPERIENCE_ORB => {
decode_exact(&raw.body).map(Self::SpawnEntityExperienceOrb)
}
id::SPAWN_ENTITY_WEATHER => decode_exact(&raw.body).map(Self::SpawnEntityWeather),
id::SPAWN_ENTITY_LIVING => decode_exact(&raw.body).map(Self::SpawnEntityLiving),
id::SPAWN_ENTITY_PAINTING => decode_exact(&raw.body).map(Self::SpawnEntityPainting),
id::NAMED_ENTITY_SPAWN => decode_exact(&raw.body).map(Self::NamedEntitySpawn),
id::ANIMATION => decode_exact(&raw.body).map(Self::Animation),
id::STATISTICS => decode_exact(&raw.body).map(Self::Statistics),
id::BLOCK_BREAK_ANIMATION => decode_exact(&raw.body).map(Self::BlockBreakAnimation),
id::TILE_ENTITY_DATA => decode_exact(&raw.body).map(Self::TileEntityData),
id::BLOCK_ACTION => decode_exact(&raw.body).map(Self::BlockAction),
id::BLOCK_CHANGE => decode_exact(&raw.body).map(Self::BlockChange),
id::BOSS_BAR => decode_exact(&raw.body).map(Self::BossBar),
id::DIFFICULTY => decode_exact(&raw.body).map(Self::Difficulty),
id::TAB_COMPLETE => decode_exact(&raw.body).map(Self::TabComplete),
id::CHAT => decode_exact(&raw.body).map(Self::Chat),
id::MULTI_BLOCK_CHANGE => decode_exact(&raw.body).map(Self::MultiBlockChange),
id::TRANSACTION => decode_exact(&raw.body).map(Self::Transaction),
id::CLOSE_WINDOW => decode_exact(&raw.body).map(Self::CloseWindow),
id::OPEN_WINDOW => decode_exact(&raw.body).map(Self::OpenWindow),
id::WINDOW_ITEMS => decode_exact(&raw.body).map(Self::WindowItems),
id::CRAFT_PROGRESS_BAR => decode_exact(&raw.body).map(Self::CraftProgressBar),
id::SET_SLOT => decode_exact(&raw.body).map(Self::SetSlot),
id::SET_COOLDOWN => decode_exact(&raw.body).map(Self::SetCooldown),
id::CUSTOM_PAYLOAD => decode_exact(&raw.body).map(Self::CustomPayload),
id::NAMED_SOUND_EFFECT => decode_exact(&raw.body).map(Self::NamedSoundEffect),
id::KICK_DISCONNECT => decode_exact(&raw.body).map(Self::KickDisconnect),
id::ENTITY_STATUS => decode_exact(&raw.body).map(Self::EntityStatus),
id::EXPLOSION => decode_exact(&raw.body).map(Self::Explosion),
id::UNLOAD_CHUNK => decode_exact(&raw.body).map(Self::UnloadChunk),
id::GAME_STATE_CHANGE => decode_exact(&raw.body).map(Self::GameStateChange),
id::KEEP_ALIVE => decode_exact(&raw.body).map(Self::KeepAlive),
id::MAP_CHUNK => decode_exact(&raw.body).map(Self::MapChunk),
id::WORLD_EVENT => decode_exact(&raw.body).map(Self::WorldEvent),
id::WORLD_PARTICLES => decode_exact(&raw.body).map(Self::WorldParticles),
id::LOGIN => decode_exact(&raw.body).map(Self::Login),
id::MAP => decode_exact(&raw.body).map(Self::Map),
id::ENTITY => decode_exact(&raw.body).map(Self::Entity),
id::REL_ENTITY_MOVE => decode_exact(&raw.body).map(Self::RelEntityMove),
id::ENTITY_MOVE_LOOK => decode_exact(&raw.body).map(Self::EntityMoveLook),
id::ENTITY_LOOK => decode_exact(&raw.body).map(Self::EntityLook),
id::VEHICLE_MOVE => decode_exact(&raw.body).map(Self::VehicleMove),
id::OPEN_SIGN_ENTITY => decode_exact(&raw.body).map(Self::OpenSignEntity),
id::CRAFT_RECIPE_RESPONSE => decode_exact(&raw.body).map(Self::CraftRecipeResponse),
id::ABILITIES => decode_exact(&raw.body).map(Self::Abilities),
id::COMBAT_EVENT => decode_exact(&raw.body).map(Self::CombatEvent),
id::PLAYER_INFO => decode_exact(&raw.body).map(Self::PlayerInfo),
id::POSITION => decode_exact(&raw.body).map(Self::Position),
id::BED => decode_exact(&raw.body).map(Self::Bed),
id::UNLOCK_RECIPES => decode_exact(&raw.body).map(Self::UnlockRecipes),
id::ENTITY_DESTROY => decode_exact(&raw.body).map(Self::EntityDestroy),
id::REMOVE_ENTITY_EFFECT => decode_exact(&raw.body).map(Self::RemoveEntityEffect),
id::RESOURCE_PACK_SEND => decode_exact(&raw.body).map(Self::ResourcePackSend),
id::RESPAWN => decode_exact(&raw.body).map(Self::Respawn),
id::ENTITY_HEAD_ROTATION => decode_exact(&raw.body).map(Self::EntityHeadRotation),
id::SELECT_ADVANCEMENT_TAB => decode_exact(&raw.body).map(Self::SelectAdvancementTab),
id::WORLD_BORDER => decode_exact(&raw.body).map(Self::WorldBorder),
id::CAMERA => decode_exact(&raw.body).map(Self::Camera),
id::HELD_ITEM_SLOT => decode_exact(&raw.body).map(Self::HeldItemSlot),
id::SCOREBOARD_DISPLAY_OBJECTIVE => {
decode_exact(&raw.body).map(Self::ScoreboardDisplayObjective)
}
id::ENTITY_METADATA => decode_exact(&raw.body).map(Self::EntityMetadata),
id::ATTACH_ENTITY => decode_exact(&raw.body).map(Self::AttachEntity),
id::ENTITY_VELOCITY => decode_exact(&raw.body).map(Self::EntityVelocity),
id::ENTITY_EQUIPMENT => decode_exact(&raw.body).map(Self::EntityEquipment),
id::EXPERIENCE => decode_exact(&raw.body).map(Self::Experience),
id::UPDATE_HEALTH => decode_exact(&raw.body).map(Self::UpdateHealth),
id::SCOREBOARD_OBJECTIVE => decode_exact(&raw.body).map(Self::ScoreboardObjective),
id::SET_PASSENGERS => decode_exact(&raw.body).map(Self::SetPassengers),
id::TEAMS => decode_exact(&raw.body).map(Self::Teams),
id::SCOREBOARD_SCORE => decode_exact(&raw.body).map(Self::ScoreboardScore),
id::SPAWN_POSITION => decode_exact(&raw.body).map(Self::SpawnPosition),
id::UPDATE_TIME => decode_exact(&raw.body).map(Self::UpdateTime),
id::TITLE => decode_exact(&raw.body).map(Self::Title),
id::SOUND_EFFECT => decode_exact(&raw.body).map(Self::SoundEffect),
id::PLAYERLIST_HEADER => decode_exact(&raw.body).map(Self::PlayerlistHeader),
id::COLLECT => decode_exact(&raw.body).map(Self::Collect),
id::ENTITY_TELEPORT => decode_exact(&raw.body).map(Self::EntityTeleport),
id::ADVANCEMENTS => decode_exact(&raw.body).map(Self::Advancements),
id::ENTITY_UPDATE_ATTRIBUTES => {
decode_exact(&raw.body).map(Self::EntityUpdateAttributes)
}
id::ENTITY_EFFECT => decode_exact(&raw.body).map(Self::EntityEffect),
other => Err(DecodeError::UnknownPacketId(other)),
}
}
fn id(&self) -> i32 {
match *self {
Self::SpawnEntity(_) => id::SPAWN_ENTITY,
Self::SpawnEntityExperienceOrb(_) => id::SPAWN_ENTITY_EXPERIENCE_ORB,
Self::SpawnEntityWeather(_) => id::SPAWN_ENTITY_WEATHER,
Self::SpawnEntityLiving(_) => id::SPAWN_ENTITY_LIVING,
Self::SpawnEntityPainting(_) => id::SPAWN_ENTITY_PAINTING,
Self::NamedEntitySpawn(_) => id::NAMED_ENTITY_SPAWN,
Self::Animation(_) => id::ANIMATION,
Self::Statistics(_) => id::STATISTICS,
Self::BlockBreakAnimation(_) => id::BLOCK_BREAK_ANIMATION,
Self::TileEntityData(_) => id::TILE_ENTITY_DATA,
Self::BlockAction(_) => id::BLOCK_ACTION,
Self::BlockChange(_) => id::BLOCK_CHANGE,
Self::BossBar(_) => id::BOSS_BAR,
Self::Difficulty(_) => id::DIFFICULTY,
Self::TabComplete(_) => id::TAB_COMPLETE,
Self::Chat(_) => id::CHAT,
Self::MultiBlockChange(_) => id::MULTI_BLOCK_CHANGE,
Self::Transaction(_) => id::TRANSACTION,
Self::CloseWindow(_) => id::CLOSE_WINDOW,
Self::OpenWindow(_) => id::OPEN_WINDOW,
Self::WindowItems(_) => id::WINDOW_ITEMS,
Self::CraftProgressBar(_) => id::CRAFT_PROGRESS_BAR,
Self::SetSlot(_) => id::SET_SLOT,
Self::SetCooldown(_) => id::SET_COOLDOWN,
Self::CustomPayload(_) => id::CUSTOM_PAYLOAD,
Self::NamedSoundEffect(_) => id::NAMED_SOUND_EFFECT,
Self::KickDisconnect(_) => id::KICK_DISCONNECT,
Self::EntityStatus(_) => id::ENTITY_STATUS,
Self::Explosion(_) => id::EXPLOSION,
Self::UnloadChunk(_) => id::UNLOAD_CHUNK,
Self::GameStateChange(_) => id::GAME_STATE_CHANGE,
Self::KeepAlive(_) => id::KEEP_ALIVE,
Self::MapChunk(_) => id::MAP_CHUNK,
Self::WorldEvent(_) => id::WORLD_EVENT,
Self::WorldParticles(_) => id::WORLD_PARTICLES,
Self::Login(_) => id::LOGIN,
Self::Map(_) => id::MAP,
Self::Entity(_) => id::ENTITY,
Self::RelEntityMove(_) => id::REL_ENTITY_MOVE,
Self::EntityMoveLook(_) => id::ENTITY_MOVE_LOOK,
Self::EntityLook(_) => id::ENTITY_LOOK,
Self::VehicleMove(_) => id::VEHICLE_MOVE,
Self::OpenSignEntity(_) => id::OPEN_SIGN_ENTITY,
Self::CraftRecipeResponse(_) => id::CRAFT_RECIPE_RESPONSE,
Self::Abilities(_) => id::ABILITIES,
Self::CombatEvent(_) => id::COMBAT_EVENT,
Self::PlayerInfo(_) => id::PLAYER_INFO,
Self::Position(_) => id::POSITION,
Self::Bed(_) => id::BED,
Self::UnlockRecipes(_) => id::UNLOCK_RECIPES,
Self::EntityDestroy(_) => id::ENTITY_DESTROY,
Self::RemoveEntityEffect(_) => id::REMOVE_ENTITY_EFFECT,
Self::ResourcePackSend(_) => id::RESOURCE_PACK_SEND,
Self::Respawn(_) => id::RESPAWN,
Self::EntityHeadRotation(_) => id::ENTITY_HEAD_ROTATION,
Self::SelectAdvancementTab(_) => id::SELECT_ADVANCEMENT_TAB,
Self::WorldBorder(_) => id::WORLD_BORDER,
Self::Camera(_) => id::CAMERA,
Self::HeldItemSlot(_) => id::HELD_ITEM_SLOT,
Self::ScoreboardDisplayObjective(_) => id::SCOREBOARD_DISPLAY_OBJECTIVE,
Self::EntityMetadata(_) => id::ENTITY_METADATA,
Self::AttachEntity(_) => id::ATTACH_ENTITY,
Self::EntityVelocity(_) => id::ENTITY_VELOCITY,
Self::EntityEquipment(_) => id::ENTITY_EQUIPMENT,
Self::Experience(_) => id::EXPERIENCE,
Self::UpdateHealth(_) => id::UPDATE_HEALTH,
Self::ScoreboardObjective(_) => id::SCOREBOARD_OBJECTIVE,
Self::SetPassengers(_) => id::SET_PASSENGERS,
Self::Teams(_) => id::TEAMS,
Self::ScoreboardScore(_) => id::SCOREBOARD_SCORE,
Self::SpawnPosition(_) => id::SPAWN_POSITION,
Self::UpdateTime(_) => id::UPDATE_TIME,
Self::Title(_) => id::TITLE,
Self::SoundEffect(_) => id::SOUND_EFFECT,
Self::PlayerlistHeader(_) => id::PLAYERLIST_HEADER,
Self::Collect(_) => id::COLLECT,
Self::EntityTeleport(_) => id::ENTITY_TELEPORT,
Self::Advancements(_) => id::ADVANCEMENTS,
Self::EntityUpdateAttributes(_) => id::ENTITY_UPDATE_ATTRIBUTES,
Self::EntityEffect(_) => id::ENTITY_EFFECT,
}
}
fn name(&self) -> &'static str {
match *self {
Self::SpawnEntity(_) => "spawn_entity",
Self::SpawnEntityExperienceOrb(_) => "spawn_entity_experience_orb",
Self::SpawnEntityWeather(_) => "spawn_entity_weather",
Self::SpawnEntityLiving(_) => "spawn_entity_living",
Self::SpawnEntityPainting(_) => "spawn_entity_painting",
Self::NamedEntitySpawn(_) => "named_entity_spawn",
Self::Animation(_) => "animation",
Self::Statistics(_) => "statistics",
Self::BlockBreakAnimation(_) => "block_break_animation",
Self::TileEntityData(_) => "tile_entity_data",
Self::BlockAction(_) => "block_action",
Self::BlockChange(_) => "block_change",
Self::BossBar(_) => "boss_bar",
Self::Difficulty(_) => "difficulty",
Self::TabComplete(_) => "tab_complete",
Self::Chat(_) => "chat",
Self::MultiBlockChange(_) => "multi_block_change",
Self::Transaction(_) => "transaction",
Self::CloseWindow(_) => "close_window",
Self::OpenWindow(_) => "open_window",
Self::WindowItems(_) => "window_items",
Self::CraftProgressBar(_) => "craft_progress_bar",
Self::SetSlot(_) => "set_slot",
Self::SetCooldown(_) => "set_cooldown",
Self::CustomPayload(_) => "custom_payload",
Self::NamedSoundEffect(_) => "named_sound_effect",
Self::KickDisconnect(_) => "kick_disconnect",
Self::EntityStatus(_) => "entity_status",
Self::Explosion(_) => "explosion",
Self::UnloadChunk(_) => "unload_chunk",
Self::GameStateChange(_) => "game_state_change",
Self::KeepAlive(_) => "keep_alive",
Self::MapChunk(_) => "map_chunk",
Self::WorldEvent(_) => "world_event",
Self::WorldParticles(_) => "world_particles",
Self::Login(_) => "login",
Self::Map(_) => "map",
Self::Entity(_) => "entity",
Self::RelEntityMove(_) => "rel_entity_move",
Self::EntityMoveLook(_) => "entity_move_look",
Self::EntityLook(_) => "entity_look",
Self::VehicleMove(_) => "vehicle_move",
Self::OpenSignEntity(_) => "open_sign_entity",
Self::CraftRecipeResponse(_) => "craft_recipe_response",
Self::Abilities(_) => "abilities",
Self::CombatEvent(_) => "combat_event",
Self::PlayerInfo(_) => "player_info",
Self::Position(_) => "position",
Self::Bed(_) => "bed",
Self::UnlockRecipes(_) => "unlock_recipes",
Self::EntityDestroy(_) => "entity_destroy",
Self::RemoveEntityEffect(_) => "remove_entity_effect",
Self::ResourcePackSend(_) => "resource_pack_send",
Self::Respawn(_) => "respawn",
Self::EntityHeadRotation(_) => "entity_head_rotation",
Self::SelectAdvancementTab(_) => "select_advancement_tab",
Self::WorldBorder(_) => "world_border",
Self::Camera(_) => "camera",
Self::HeldItemSlot(_) => "held_item_slot",
Self::ScoreboardDisplayObjective(_) => "scoreboard_display_objective",
Self::EntityMetadata(_) => "entity_metadata",
Self::AttachEntity(_) => "attach_entity",
Self::EntityVelocity(_) => "entity_velocity",
Self::EntityEquipment(_) => "entity_equipment",
Self::Experience(_) => "experience",
Self::UpdateHealth(_) => "update_health",
Self::ScoreboardObjective(_) => "scoreboard_objective",
Self::SetPassengers(_) => "set_passengers",
Self::Teams(_) => "teams",
Self::ScoreboardScore(_) => "scoreboard_score",
Self::SpawnPosition(_) => "spawn_position",
Self::UpdateTime(_) => "update_time",
Self::Title(_) => "title",
Self::SoundEffect(_) => "sound_effect",
Self::PlayerlistHeader(_) => "playerlist_header",
Self::Collect(_) => "collect",
Self::EntityTeleport(_) => "entity_teleport",
Self::Advancements(_) => "advancements",
Self::EntityUpdateAttributes(_) => "entity_update_attributes",
Self::EntityEffect(_) => "entity_effect",
}
}
fn encode_body(&self, w: &mut BytesMut) -> EncodeResult {
match *self {
Self::SpawnEntity(ref p) => p.encode(w),
Self::SpawnEntityExperienceOrb(ref p) => p.encode(w),
Self::SpawnEntityWeather(ref p) => p.encode(w),
Self::SpawnEntityLiving(ref p) => p.encode(w),
Self::SpawnEntityPainting(ref p) => p.encode(w),
Self::NamedEntitySpawn(ref p) => p.encode(w),
Self::Animation(ref p) => p.encode(w),
Self::Statistics(ref p) => p.encode(w),
Self::BlockBreakAnimation(ref p) => p.encode(w),
Self::TileEntityData(ref p) => p.encode(w),
Self::BlockAction(ref p) => p.encode(w),
Self::BlockChange(ref p) => p.encode(w),
Self::BossBar(ref p) => p.encode(w),
Self::Difficulty(ref p) => p.encode(w),
Self::TabComplete(ref p) => p.encode(w),
Self::Chat(ref p) => p.encode(w),
Self::MultiBlockChange(ref p) => p.encode(w),
Self::Transaction(ref p) => p.encode(w),
Self::CloseWindow(ref p) => p.encode(w),
Self::OpenWindow(ref p) => p.encode(w),
Self::WindowItems(ref p) => p.encode(w),
Self::CraftProgressBar(ref p) => p.encode(w),
Self::SetSlot(ref p) => p.encode(w),
Self::SetCooldown(ref p) => p.encode(w),
Self::CustomPayload(ref p) => p.encode(w),
Self::NamedSoundEffect(ref p) => p.encode(w),
Self::KickDisconnect(ref p) => p.encode(w),
Self::EntityStatus(ref p) => p.encode(w),
Self::Explosion(ref p) => p.encode(w),
Self::UnloadChunk(ref p) => p.encode(w),
Self::GameStateChange(ref p) => p.encode(w),
Self::KeepAlive(ref p) => p.encode(w),
Self::MapChunk(ref p) => p.encode(w),
Self::WorldEvent(ref p) => p.encode(w),
Self::WorldParticles(ref p) => p.encode(w),
Self::Login(ref p) => p.encode(w),
Self::Map(ref p) => p.encode(w),
Self::Entity(ref p) => p.encode(w),
Self::RelEntityMove(ref p) => p.encode(w),
Self::EntityMoveLook(ref p) => p.encode(w),
Self::EntityLook(ref p) => p.encode(w),
Self::VehicleMove(ref p) => p.encode(w),
Self::OpenSignEntity(ref p) => p.encode(w),
Self::CraftRecipeResponse(ref p) => p.encode(w),
Self::Abilities(ref p) => p.encode(w),
Self::CombatEvent(ref p) => p.encode(w),
Self::PlayerInfo(ref p) => p.encode(w),
Self::Position(ref p) => p.encode(w),
Self::Bed(ref p) => p.encode(w),
Self::UnlockRecipes(ref p) => p.encode(w),
Self::EntityDestroy(ref p) => p.encode(w),
Self::RemoveEntityEffect(ref p) => p.encode(w),
Self::ResourcePackSend(ref p) => p.encode(w),
Self::Respawn(ref p) => p.encode(w),
Self::EntityHeadRotation(ref p) => p.encode(w),
Self::SelectAdvancementTab(ref p) => p.encode(w),
Self::WorldBorder(ref p) => p.encode(w),
Self::Camera(ref p) => p.encode(w),
Self::HeldItemSlot(ref p) => p.encode(w),
Self::ScoreboardDisplayObjective(ref p) => p.encode(w),
Self::EntityMetadata(ref p) => p.encode(w),
Self::AttachEntity(ref p) => p.encode(w),
Self::EntityVelocity(ref p) => p.encode(w),
Self::EntityEquipment(ref p) => p.encode(w),
Self::Experience(ref p) => p.encode(w),
Self::UpdateHealth(ref p) => p.encode(w),
Self::ScoreboardObjective(ref p) => p.encode(w),
Self::SetPassengers(ref p) => p.encode(w),
Self::Teams(ref p) => p.encode(w),
Self::ScoreboardScore(ref p) => p.encode(w),
Self::SpawnPosition(ref p) => p.encode(w),
Self::UpdateTime(ref p) => p.encode(w),
Self::Title(ref p) => p.encode(w),
Self::SoundEffect(ref p) => p.encode(w),
Self::PlayerlistHeader(ref p) => p.encode(w),
Self::Collect(ref p) => p.encode(w),
Self::EntityTeleport(ref p) => p.encode(w),
Self::Advancements(ref p) => p.encode(w),
Self::EntityUpdateAttributes(ref p) => p.encode(w),
Self::EntityEffect(ref p) => p.encode(w),
}
}
fn name_of(id: i32) -> Option<&'static str> {
match id {
id::SPAWN_ENTITY => Some("spawn_entity"),
id::SPAWN_ENTITY_EXPERIENCE_ORB => Some("spawn_entity_experience_orb"),
id::SPAWN_ENTITY_WEATHER => Some("spawn_entity_weather"),
id::SPAWN_ENTITY_LIVING => Some("spawn_entity_living"),
id::SPAWN_ENTITY_PAINTING => Some("spawn_entity_painting"),
id::NAMED_ENTITY_SPAWN => Some("named_entity_spawn"),
id::ANIMATION => Some("animation"),
id::STATISTICS => Some("statistics"),
id::BLOCK_BREAK_ANIMATION => Some("block_break_animation"),
id::TILE_ENTITY_DATA => Some("tile_entity_data"),
id::BLOCK_ACTION => Some("block_action"),
id::BLOCK_CHANGE => Some("block_change"),
id::BOSS_BAR => Some("boss_bar"),
id::DIFFICULTY => Some("difficulty"),
id::TAB_COMPLETE => Some("tab_complete"),
id::CHAT => Some("chat"),
id::MULTI_BLOCK_CHANGE => Some("multi_block_change"),
id::TRANSACTION => Some("transaction"),
id::CLOSE_WINDOW => Some("close_window"),
id::OPEN_WINDOW => Some("open_window"),
id::WINDOW_ITEMS => Some("window_items"),
id::CRAFT_PROGRESS_BAR => Some("craft_progress_bar"),
id::SET_SLOT => Some("set_slot"),
id::SET_COOLDOWN => Some("set_cooldown"),
id::CUSTOM_PAYLOAD => Some("custom_payload"),
id::NAMED_SOUND_EFFECT => Some("named_sound_effect"),
id::KICK_DISCONNECT => Some("kick_disconnect"),
id::ENTITY_STATUS => Some("entity_status"),
id::EXPLOSION => Some("explosion"),
id::UNLOAD_CHUNK => Some("unload_chunk"),
id::GAME_STATE_CHANGE => Some("game_state_change"),
id::KEEP_ALIVE => Some("keep_alive"),
id::MAP_CHUNK => Some("map_chunk"),
id::WORLD_EVENT => Some("world_event"),
id::WORLD_PARTICLES => Some("world_particles"),
id::LOGIN => Some("login"),
id::MAP => Some("map"),
id::ENTITY => Some("entity"),
id::REL_ENTITY_MOVE => Some("rel_entity_move"),
id::ENTITY_MOVE_LOOK => Some("entity_move_look"),
id::ENTITY_LOOK => Some("entity_look"),
id::VEHICLE_MOVE => Some("vehicle_move"),
id::OPEN_SIGN_ENTITY => Some("open_sign_entity"),
id::CRAFT_RECIPE_RESPONSE => Some("craft_recipe_response"),
id::ABILITIES => Some("abilities"),
id::COMBAT_EVENT => Some("combat_event"),
id::PLAYER_INFO => Some("player_info"),
id::POSITION => Some("position"),
id::BED => Some("bed"),
id::UNLOCK_RECIPES => Some("unlock_recipes"),
id::ENTITY_DESTROY => Some("entity_destroy"),
id::REMOVE_ENTITY_EFFECT => Some("remove_entity_effect"),
id::RESOURCE_PACK_SEND => Some("resource_pack_send"),
id::RESPAWN => Some("respawn"),
id::ENTITY_HEAD_ROTATION => Some("entity_head_rotation"),
id::SELECT_ADVANCEMENT_TAB => Some("select_advancement_tab"),
id::WORLD_BORDER => Some("world_border"),
id::CAMERA => Some("camera"),
id::HELD_ITEM_SLOT => Some("held_item_slot"),
id::SCOREBOARD_DISPLAY_OBJECTIVE => Some("scoreboard_display_objective"),
id::ENTITY_METADATA => Some("entity_metadata"),
id::ATTACH_ENTITY => Some("attach_entity"),
id::ENTITY_VELOCITY => Some("entity_velocity"),
id::ENTITY_EQUIPMENT => Some("entity_equipment"),
id::EXPERIENCE => Some("experience"),
id::UPDATE_HEALTH => Some("update_health"),
id::SCOREBOARD_OBJECTIVE => Some("scoreboard_objective"),
id::SET_PASSENGERS => Some("set_passengers"),
id::TEAMS => Some("teams"),
id::SCOREBOARD_SCORE => Some("scoreboard_score"),
id::SPAWN_POSITION => Some("spawn_position"),
id::UPDATE_TIME => Some("update_time"),
id::TITLE => Some("title"),
id::SOUND_EFFECT => Some("sound_effect"),
id::PLAYERLIST_HEADER => Some("playerlist_header"),
id::COLLECT => Some("collect"),
id::ENTITY_TELEPORT => Some("entity_teleport"),
id::ADVANCEMENTS => Some("advancements"),
id::ENTITY_UPDATE_ATTRIBUTES => Some("entity_update_attributes"),
id::ENTITY_EFFECT => Some("entity_effect"),
_ => None,
}
}
}
impl ClientboundPlayPacket {
pub const IDS: &'static [i32] = &[
id::SPAWN_ENTITY,
id::SPAWN_ENTITY_EXPERIENCE_ORB,
id::SPAWN_ENTITY_WEATHER,
id::SPAWN_ENTITY_LIVING,
id::SPAWN_ENTITY_PAINTING,
id::NAMED_ENTITY_SPAWN,
id::ANIMATION,
id::STATISTICS,
id::BLOCK_BREAK_ANIMATION,
id::TILE_ENTITY_DATA,
id::BLOCK_ACTION,
id::BLOCK_CHANGE,
id::BOSS_BAR,
id::DIFFICULTY,
id::TAB_COMPLETE,
id::CHAT,
id::MULTI_BLOCK_CHANGE,
id::TRANSACTION,
id::CLOSE_WINDOW,
id::OPEN_WINDOW,
id::WINDOW_ITEMS,
id::CRAFT_PROGRESS_BAR,
id::SET_SLOT,
id::SET_COOLDOWN,
id::CUSTOM_PAYLOAD,
id::NAMED_SOUND_EFFECT,
id::KICK_DISCONNECT,
id::ENTITY_STATUS,
id::EXPLOSION,
id::UNLOAD_CHUNK,
id::GAME_STATE_CHANGE,
id::KEEP_ALIVE,
id::MAP_CHUNK,
id::WORLD_EVENT,
id::WORLD_PARTICLES,
id::LOGIN,
id::MAP,
id::ENTITY,
id::REL_ENTITY_MOVE,
id::ENTITY_MOVE_LOOK,
id::ENTITY_LOOK,
id::VEHICLE_MOVE,
id::OPEN_SIGN_ENTITY,
id::CRAFT_RECIPE_RESPONSE,
id::ABILITIES,
id::COMBAT_EVENT,
id::PLAYER_INFO,
id::POSITION,
id::BED,
id::UNLOCK_RECIPES,
id::ENTITY_DESTROY,
id::REMOVE_ENTITY_EFFECT,
id::RESOURCE_PACK_SEND,
id::RESPAWN,
id::ENTITY_HEAD_ROTATION,
id::SELECT_ADVANCEMENT_TAB,
id::WORLD_BORDER,
id::CAMERA,
id::HELD_ITEM_SLOT,
id::SCOREBOARD_DISPLAY_OBJECTIVE,
id::ENTITY_METADATA,
id::ATTACH_ENTITY,
id::ENTITY_VELOCITY,
id::ENTITY_EQUIPMENT,
id::EXPERIENCE,
id::UPDATE_HEALTH,
id::SCOREBOARD_OBJECTIVE,
id::SET_PASSENGERS,
id::TEAMS,
id::SCOREBOARD_SCORE,
id::SPAWN_POSITION,
id::UPDATE_TIME,
id::TITLE,
id::SOUND_EFFECT,
id::PLAYERLIST_HEADER,
id::COLLECT,
id::ENTITY_TELEPORT,
id::ADVANCEMENTS,
id::ENTITY_UPDATE_ATTRIBUTES,
id::ENTITY_EFFECT,
];
#[cfg(feature = "testgen")]
pub fn generate_by_id(id: i32, g: &mut Gen) -> Option<Self> {
match id {
id::SPAWN_ENTITY => Some(Self::SpawnEntity(<SpawnEntity as Generate>::generate(g))),
id::SPAWN_ENTITY_EXPERIENCE_ORB => Some(Self::SpawnEntityExperienceOrb(
<SpawnEntityExperienceOrb as Generate>::generate(g),
)),
id::SPAWN_ENTITY_WEATHER => Some(Self::SpawnEntityWeather(
<SpawnEntityWeather as Generate>::generate(g),
)),
id::SPAWN_ENTITY_LIVING => Some(Self::SpawnEntityLiving(
<SpawnEntityLiving as Generate>::generate(g),
)),
id::SPAWN_ENTITY_PAINTING => Some(Self::SpawnEntityPainting(
<SpawnEntityPainting as Generate>::generate(g),
)),
id::NAMED_ENTITY_SPAWN => Some(Self::NamedEntitySpawn(
<NamedEntitySpawn as Generate>::generate(g),
)),
id::ANIMATION => Some(Self::Animation(<Animation as Generate>::generate(g))),
id::STATISTICS => Some(Self::Statistics(<Statistics as Generate>::generate(g))),
id::BLOCK_BREAK_ANIMATION => Some(Self::BlockBreakAnimation(
<BlockBreakAnimation as Generate>::generate(g),
)),
id::TILE_ENTITY_DATA => Some(Self::TileEntityData(
<TileEntityData as Generate>::generate(g),
)),
id::BLOCK_ACTION => Some(Self::BlockAction(<BlockAction as Generate>::generate(g))),
id::BLOCK_CHANGE => Some(Self::BlockChange(<BlockChange as Generate>::generate(g))),
id::BOSS_BAR => Some(Self::BossBar(<BossBar as Generate>::generate(g))),
id::DIFFICULTY => Some(Self::Difficulty(<Difficulty as Generate>::generate(g))),
id::TAB_COMPLETE => Some(Self::TabComplete(<TabComplete as Generate>::generate(g))),
id::CHAT => Some(Self::Chat(<Chat as Generate>::generate(g))),
id::MULTI_BLOCK_CHANGE => Some(Self::MultiBlockChange(
<MultiBlockChange as Generate>::generate(g),
)),
id::TRANSACTION => Some(Self::Transaction(<Transaction as Generate>::generate(g))),
id::CLOSE_WINDOW => Some(Self::CloseWindow(<CloseWindow as Generate>::generate(g))),
id::OPEN_WINDOW => Some(Self::OpenWindow(<OpenWindow as Generate>::generate(g))),
id::WINDOW_ITEMS => Some(Self::WindowItems(<WindowItems as Generate>::generate(g))),
id::CRAFT_PROGRESS_BAR => Some(Self::CraftProgressBar(
<CraftProgressBar as Generate>::generate(g),
)),
id::SET_SLOT => Some(Self::SetSlot(<SetSlot as Generate>::generate(g))),
id::SET_COOLDOWN => Some(Self::SetCooldown(<SetCooldown as Generate>::generate(g))),
id::CUSTOM_PAYLOAD => Some(Self::CustomPayload(<CustomPayload as Generate>::generate(
g,
))),
id::NAMED_SOUND_EFFECT => Some(Self::NamedSoundEffect(
<NamedSoundEffect as Generate>::generate(g),
)),
id::KICK_DISCONNECT => Some(Self::KickDisconnect(
<KickDisconnect as Generate>::generate(g),
)),
id::ENTITY_STATUS => Some(Self::EntityStatus(<EntityStatus as Generate>::generate(g))),
id::EXPLOSION => Some(Self::Explosion(<Explosion as Generate>::generate(g))),
id::UNLOAD_CHUNK => Some(Self::UnloadChunk(<UnloadChunk as Generate>::generate(g))),
id::GAME_STATE_CHANGE => Some(Self::GameStateChange(
<GameStateChange as Generate>::generate(g),
)),
id::KEEP_ALIVE => Some(Self::KeepAlive(<KeepAlive as Generate>::generate(g))),
id::MAP_CHUNK => Some(Self::MapChunk(<MapChunk as Generate>::generate(g))),
id::WORLD_EVENT => Some(Self::WorldEvent(<WorldEvent as Generate>::generate(g))),
id::WORLD_PARTICLES => Some(Self::WorldParticles(
<WorldParticles as Generate>::generate(g),
)),
id::LOGIN => Some(Self::Login(<Login as Generate>::generate(g))),
id::MAP => Some(Self::Map(<Map as Generate>::generate(g))),
id::ENTITY => Some(Self::Entity(<Entity as Generate>::generate(g))),
id::REL_ENTITY_MOVE => Some(Self::RelEntityMove(
<RelEntityMove as Generate>::generate(g),
)),
id::ENTITY_MOVE_LOOK => Some(Self::EntityMoveLook(
<EntityMoveLook as Generate>::generate(g),
)),
id::ENTITY_LOOK => Some(Self::EntityLook(<EntityLook as Generate>::generate(g))),
id::VEHICLE_MOVE => Some(Self::VehicleMove(<VehicleMove as Generate>::generate(g))),
id::OPEN_SIGN_ENTITY => Some(Self::OpenSignEntity(
<OpenSignEntity as Generate>::generate(g),
)),
id::CRAFT_RECIPE_RESPONSE => Some(Self::CraftRecipeResponse(
<CraftRecipeResponse as Generate>::generate(g),
)),
id::ABILITIES => Some(Self::Abilities(<Abilities as Generate>::generate(g))),
id::COMBAT_EVENT => Some(Self::CombatEvent(<CombatEvent as Generate>::generate(g))),
id::PLAYER_INFO => Some(Self::PlayerInfo(<PlayerInfo as Generate>::generate(g))),
id::POSITION => Some(Self::Position(<Position as Generate>::generate(g))),
id::BED => Some(Self::Bed(<Bed as Generate>::generate(g))),
id::UNLOCK_RECIPES => Some(Self::UnlockRecipes(<UnlockRecipes as Generate>::generate(
g,
))),
id::ENTITY_DESTROY => Some(Self::EntityDestroy(<EntityDestroy as Generate>::generate(
g,
))),
id::REMOVE_ENTITY_EFFECT => Some(Self::RemoveEntityEffect(
<RemoveEntityEffect as Generate>::generate(g),
)),
id::RESOURCE_PACK_SEND => Some(Self::ResourcePackSend(
<ResourcePackSend as Generate>::generate(g),
)),
id::RESPAWN => Some(Self::Respawn(<Respawn as Generate>::generate(g))),
id::ENTITY_HEAD_ROTATION => Some(Self::EntityHeadRotation(
<EntityHeadRotation as Generate>::generate(g),
)),
id::SELECT_ADVANCEMENT_TAB => Some(Self::SelectAdvancementTab(
<SelectAdvancementTab as Generate>::generate(g),
)),
id::WORLD_BORDER => Some(Self::WorldBorder(<WorldBorder as Generate>::generate(g))),
id::CAMERA => Some(Self::Camera(<Camera as Generate>::generate(g))),
id::HELD_ITEM_SLOT => Some(Self::HeldItemSlot(<HeldItemSlot as Generate>::generate(g))),
id::SCOREBOARD_DISPLAY_OBJECTIVE => Some(Self::ScoreboardDisplayObjective(
<ScoreboardDisplayObjective as Generate>::generate(g),
)),
id::ENTITY_METADATA => Some(Self::EntityMetadata(
<EntityMetadata as Generate>::generate(g),
)),
id::ATTACH_ENTITY => Some(Self::AttachEntity(<AttachEntity as Generate>::generate(g))),
id::ENTITY_VELOCITY => Some(Self::EntityVelocity(
<EntityVelocity as Generate>::generate(g),
)),
id::ENTITY_EQUIPMENT => Some(Self::EntityEquipment(
<EntityEquipment as Generate>::generate(g),
)),
id::EXPERIENCE => Some(Self::Experience(<Experience as Generate>::generate(g))),
id::UPDATE_HEALTH => Some(Self::UpdateHealth(<UpdateHealth as Generate>::generate(g))),
id::SCOREBOARD_OBJECTIVE => Some(Self::ScoreboardObjective(
<ScoreboardObjective as Generate>::generate(g),
)),
id::SET_PASSENGERS => Some(Self::SetPassengers(<SetPassengers as Generate>::generate(
g,
))),
id::TEAMS => Some(Self::Teams(<Teams as Generate>::generate(g))),
id::SCOREBOARD_SCORE => Some(Self::ScoreboardScore(
<ScoreboardScore as Generate>::generate(g),
)),
id::SPAWN_POSITION => Some(Self::SpawnPosition(<SpawnPosition as Generate>::generate(
g,
))),
id::UPDATE_TIME => Some(Self::UpdateTime(<UpdateTime as Generate>::generate(g))),
id::TITLE => Some(Self::Title(<Title as Generate>::generate(g))),
id::SOUND_EFFECT => Some(Self::SoundEffect(<SoundEffect as Generate>::generate(g))),
id::PLAYERLIST_HEADER => Some(Self::PlayerlistHeader(
<PlayerlistHeader as Generate>::generate(g),
)),
id::COLLECT => Some(Self::Collect(<Collect as Generate>::generate(g))),
id::ENTITY_TELEPORT => Some(Self::EntityTeleport(
<EntityTeleport as Generate>::generate(g),
)),
id::ADVANCEMENTS => Some(Self::Advancements(<Advancements as Generate>::generate(g))),
id::ENTITY_UPDATE_ATTRIBUTES => Some(Self::EntityUpdateAttributes(
<EntityUpdateAttributes as Generate>::generate(g),
)),
id::ENTITY_EFFECT => Some(Self::EntityEffect(<EntityEffect as Generate>::generate(g))),
_ => None,
}
}
}