pub mod chat;
pub mod entity;
pub mod inventory;
pub mod misc;
pub mod player;
pub mod types;
pub mod world;
pub use types::Particle;
pub use types::RecipeDisplay;
pub use types::SlotDisplay;
pub use chat::ClientboundPlayActionBar;
pub use chat::ClientboundPlayBossBar;
pub use chat::ClientboundPlayBossBarAction;
pub use chat::ClientboundPlayChatSuggestions;
pub use chat::ClientboundPlayClearTitles;
pub use chat::ClientboundPlayDeclareCommands;
pub use chat::ClientboundPlayDeclareCommandsCommandNode;
pub use chat::ClientboundPlayHideMessage;
pub use chat::ClientboundPlayHideMessageId;
pub use chat::ClientboundPlayPlayerlistHeader;
pub use chat::ClientboundPlayProfilelessChat;
pub use chat::ClientboundPlayResetScore;
pub use chat::ClientboundPlayScoreboardDisplayObjective;
pub use chat::ClientboundPlayScoreboardObjective;
pub use chat::ClientboundPlayScoreboardObjectiveAction;
pub use chat::ClientboundPlayScoreboardScore;
pub use chat::ClientboundPlayScoreboardScoreNumberFormat;
pub use chat::ClientboundPlaySetTitleSubtitle;
pub use chat::ClientboundPlaySetTitleText;
pub use chat::ClientboundPlaySetTitleTime;
pub use chat::ClientboundPlaySystemChat;
pub use chat::ClientboundPlayTabComplete;
pub use chat::ClientboundPlayTabCompleteMatches;
pub use chat::ClientboundPlayTeams;
pub use chat::ClientboundPlayTeamsMode;
pub use chat::ServerboundPlayChatCommand;
pub use chat::ServerboundPlayChatCommandSigned;
pub use chat::ServerboundPlayChatCommandSignedArgumentsignatures;
pub use chat::ServerboundPlayChatMessage;
pub use chat::ServerboundPlayChatSessionUpdate;
pub use chat::ServerboundPlayMessageAcknowledgement;
pub use chat::ServerboundPlayTabComplete;
pub use entity::ClientboundPlayAnimation;
pub use entity::ClientboundPlayAttachEntity;
pub use entity::ClientboundPlayBlockBreakAnimation;
pub use entity::ClientboundPlayCollect;
pub use entity::ClientboundPlayDamageEvent;
pub use entity::ClientboundPlayEntityDestroy;
pub use entity::ClientboundPlayEntityEffect;
pub use entity::ClientboundPlayEntityEquipment;
pub use entity::ClientboundPlayEntityHeadRotation;
pub use entity::ClientboundPlayEntityLook;
pub use entity::ClientboundPlayEntityMetadata;
pub use entity::ClientboundPlayEntityMoveLook;
pub use entity::ClientboundPlayEntitySoundEffect;
pub use entity::ClientboundPlayEntityStatus;
pub use entity::ClientboundPlayEntityTeleport;
pub use entity::ClientboundPlayEntityUpdateAttributes;
pub use entity::ClientboundPlayEntityUpdateAttributesProperties;
pub use entity::ClientboundPlayEntityUpdateAttributesPropertiesModifiers;
pub use entity::ClientboundPlayEntityVelocity;
pub use entity::ClientboundPlayHurtAnimation;
pub use entity::ClientboundPlayMoveMinecart;
pub use entity::ClientboundPlayMoveMinecartSteps;
pub use entity::ClientboundPlayRelEntityMove;
pub use entity::ClientboundPlayRemoveEntityEffect;
pub use entity::ClientboundPlaySetPassengers;
pub use entity::ClientboundPlaySetProjectilePower;
pub use entity::ClientboundPlaySpawnEntity;
pub use entity::ClientboundPlaySpawnEntityExperienceOrb;
pub use entity::ClientboundPlaySyncEntityPosition;
pub use entity::ServerboundPlayArmAnimation;
pub use entity::ServerboundPlayEntityAction;
pub use entity::ServerboundPlayQueryEntityNbt;
pub use entity::ServerboundPlayUseEntity;
pub use entity::ServerboundPlayUseEntityMouse;
pub use inventory::ClientboundPlayCloseWindow;
pub use inventory::ClientboundPlayCraftProgressBar;
pub use inventory::ClientboundPlayCraftRecipeResponse;
pub use inventory::ClientboundPlayHeldItemSlot;
pub use inventory::ClientboundPlayOpenBook;
pub use inventory::ClientboundPlayOpenHorseWindow;
pub use inventory::ClientboundPlayOpenSignEntity;
pub use inventory::ClientboundPlayOpenWindow;
pub use inventory::ClientboundPlaySetCooldown;
pub use inventory::ClientboundPlaySetCursorItem;
pub use inventory::ClientboundPlaySetPlayerInventory;
pub use inventory::ClientboundPlaySetSlot;
pub use inventory::ClientboundPlayTradeList;
pub use inventory::ClientboundPlayTradeListTrades;
pub use inventory::ClientboundPlayTradeListTradesInputitem1;
pub use inventory::ClientboundPlayTradeListTradesInputitem1Slotcomponent;
pub use inventory::ClientboundPlayWindowItems;
pub use inventory::ServerboundPlayCloseWindow;
pub use inventory::ServerboundPlayCraftRecipeRequest;
pub use inventory::ServerboundPlayEnchantItem;
pub use inventory::ServerboundPlayHeldItemSlot;
pub use inventory::ServerboundPlayNameItem;
pub use inventory::ServerboundPlayPickItemFromBlock;
pub use inventory::ServerboundPlayPickItemFromEntity;
pub use inventory::ServerboundPlaySelectBundleItem;
pub use inventory::ServerboundPlaySelectTrade;
pub use inventory::ServerboundPlaySetBeaconEffect;
pub use inventory::ServerboundPlaySetCreativeSlot;
pub use inventory::ServerboundPlaySetSlotState;
pub use inventory::ServerboundPlayWindowClick;
pub use inventory::ServerboundPlayWindowClickChangedslots;
pub use misc::ClientboundPlayAdvancements;
pub use misc::ClientboundPlayAdvancementsAdvancementmapping;
pub use misc::ClientboundPlayAdvancementsAdvancementmappingValue;
pub use misc::ClientboundPlayAdvancementsProgressmapping;
pub use misc::ClientboundPlayAdvancementsProgressmappingValue;
pub use misc::ClientboundPlayCustomPayload;
pub use misc::ClientboundPlayDebugSample;
pub use misc::ClientboundPlayDeclareRecipes;
pub use misc::ClientboundPlayDeclareRecipesRecipes;
pub use misc::ClientboundPlayDeclareRecipesStonecutterrecipes;
pub use misc::ClientboundPlayKeepAlive;
pub use misc::ClientboundPlayKickDisconnect;
pub use misc::ClientboundPlayPing;
pub use misc::ClientboundPlayPingResponse;
pub use misc::ClientboundPlayRecipeBookAdd;
pub use misc::ClientboundPlayRecipeBookAddEntries;
pub use misc::ClientboundPlayRecipeBookAddEntriesRecipe;
pub use misc::ClientboundPlayRecipeBookRemove;
pub use misc::ClientboundPlayRecipeBookSettings;
pub use misc::ClientboundPlaySelectAdvancementTab;
pub use misc::ClientboundPlayServerData;
pub use misc::ClientboundPlaySetTickingState;
pub use misc::ClientboundPlaySoundEffect;
pub use misc::ClientboundPlayStartConfiguration;
pub use misc::ClientboundPlayStatistics;
pub use misc::ClientboundPlayStatisticsEntries;
pub use misc::ClientboundPlayStepTick;
pub use misc::ClientboundPlayStopSound;
pub use misc::ClientboundPlayStopSoundFlags;
pub use misc::ClientboundPlayTags;
pub use misc::ClientboundPlayTagsTags;
pub use misc::ClientboundPlayTagsTagsTags;
pub use misc::ServerboundPlayAdvancementTab;
pub use misc::ServerboundPlayAdvancementTabAction;
pub use misc::ServerboundPlayConfigurationAcknowledged;
pub use misc::ServerboundPlayCustomPayload;
pub use misc::ServerboundPlayDebugSampleSubscription;
pub use misc::ServerboundPlayDisplayedRecipe;
pub use misc::ServerboundPlayEditBook;
pub use misc::ServerboundPlayKeepAlive;
pub use misc::ServerboundPlayPingRequest;
pub use misc::ServerboundPlayPong;
pub use misc::ServerboundPlayRecipeBook;
pub use misc::ServerboundPlayResourcePackReceive;
pub use misc::ServerboundPlayTickEnd;
pub use misc::ServerboundPlayUpdateCommandBlock;
pub use misc::ServerboundPlayUpdateCommandBlockMinecart;
pub use misc::ServerboundPlayUpdateJigsawBlock;
pub use misc::ServerboundPlayUpdateStructureBlock;
pub use misc::ServerboundPlayUseItem;
pub use player::ClientboundPlayAbilities;
pub use player::ClientboundPlayCamera;
pub use player::ClientboundPlayDeathCombatEvent;
pub use player::ClientboundPlayDifficulty;
pub use player::ClientboundPlayEndCombatEvent;
pub use player::ClientboundPlayEnterCombatEvent;
pub use player::ClientboundPlayExperience;
pub use player::ClientboundPlayFacePlayer;
pub use player::ClientboundPlayGameStateChange;
pub use player::ClientboundPlayLogin;
pub use player::ClientboundPlayLoginSpawninfo;
pub use player::ClientboundPlayPlayerChat;
pub use player::ClientboundPlayPlayerChatFiltertype;
pub use player::ClientboundPlayPlayerChatPreviousmessages;
pub use player::ClientboundPlayPlayerInfo;
pub use player::ClientboundPlayPlayerInfoData;
pub use player::ClientboundPlayPlayerRemove;
pub use player::ClientboundPlayPlayerRotation;
pub use player::ClientboundPlayPosition;
pub use player::ClientboundPlayRespawn;
pub use player::ClientboundPlayRespawnSpawninfo;
pub use player::ClientboundPlaySimulationDistance;
pub use player::ClientboundPlayUpdateHealth;
pub use player::ClientboundPlayVehicleMove;
pub use player::ServerboundPlayAbilities;
pub use player::ServerboundPlayClientCommand;
pub use player::ServerboundPlayFlying;
pub use player::ServerboundPlayLockDifficulty;
pub use player::ServerboundPlayLook;
pub use player::ServerboundPlayPlayerInput;
pub use player::ServerboundPlayPlayerLoaded;
pub use player::ServerboundPlayPosition;
pub use player::ServerboundPlayPositionLook;
pub use player::ServerboundPlaySetDifficulty;
pub use player::ServerboundPlaySpectate;
pub use player::ServerboundPlaySteerBoat;
pub use player::ServerboundPlayTeleportConfirm;
pub use player::ServerboundPlayVehicleMove;
pub use world::ClientboundPlayAcknowledgePlayerDigging;
pub use world::ClientboundPlayBlockAction;
pub use world::ClientboundPlayBlockChange;
pub use world::ClientboundPlayChunkBatchFinished;
pub use world::ClientboundPlayChunkBatchStart;
pub use world::ClientboundPlayChunkBiomes;
pub use world::ClientboundPlayChunkBiomesBiomes;
pub use world::ClientboundPlayExplosion;
pub use world::ClientboundPlayInitializeWorldBorder;
pub use world::ClientboundPlayMap;
pub use world::ClientboundPlayMapChunk;
pub use world::ClientboundPlayMapChunkChunkblockentity;
pub use world::ClientboundPlayMapIcons;
pub use world::ClientboundPlayMultiBlockChange;
pub use world::ClientboundPlayNbtQueryResponse;
pub use world::ClientboundPlaySpawnPosition;
pub use world::ClientboundPlayTileEntityData;
pub use world::ClientboundPlayUnloadChunk;
pub use world::ClientboundPlayUpdateLight;
pub use world::ClientboundPlayUpdateTime;
pub use world::ClientboundPlayUpdateViewDistance;
pub use world::ClientboundPlayUpdateViewPosition;
pub use world::ClientboundPlayWorldBorderCenter;
pub use world::ClientboundPlayWorldBorderLerpSize;
pub use world::ClientboundPlayWorldBorderSize;
pub use world::ClientboundPlayWorldBorderWarningDelay;
pub use world::ClientboundPlayWorldBorderWarningReach;
pub use world::ClientboundPlayWorldEvent;
pub use world::ClientboundPlayWorldParticles;
pub use world::ServerboundPlayBlockDig;
pub use world::ServerboundPlayBlockPlace;
pub use world::ServerboundPlayChunkBatchReceived;
pub use world::ServerboundPlayGenerateStructure;
pub use world::ServerboundPlayQueryBlockNbt;
pub use world::ServerboundPlayUpdateSign;
use crate::error::{Error, Result};
use basalt_types::Decode as _;
#[derive(Debug, Clone, PartialEq)]
pub enum ServerboundPlayPacket {
Abilities(ServerboundPlayAbilities),
AdvancementTab(ServerboundPlayAdvancementTab),
ArmAnimation(ServerboundPlayArmAnimation),
BlockDig(ServerboundPlayBlockDig),
BlockPlace(ServerboundPlayBlockPlace),
ChatCommand(ServerboundPlayChatCommand),
ChatCommandSigned(ServerboundPlayChatCommandSigned),
ChatMessage(ServerboundPlayChatMessage),
ChatSessionUpdate(ServerboundPlayChatSessionUpdate),
ChunkBatchReceived(ServerboundPlayChunkBatchReceived),
ClientCommand(ServerboundPlayClientCommand),
CloseWindow(ServerboundPlayCloseWindow),
ConfigurationAcknowledged(ServerboundPlayConfigurationAcknowledged),
CraftRecipeRequest(ServerboundPlayCraftRecipeRequest),
CustomPayload(ServerboundPlayCustomPayload),
DebugSampleSubscription(ServerboundPlayDebugSampleSubscription),
DisplayedRecipe(ServerboundPlayDisplayedRecipe),
EditBook(ServerboundPlayEditBook),
EnchantItem(ServerboundPlayEnchantItem),
EntityAction(ServerboundPlayEntityAction),
Flying(ServerboundPlayFlying),
GenerateStructure(ServerboundPlayGenerateStructure),
HeldItemSlot(ServerboundPlayHeldItemSlot),
KeepAlive(ServerboundPlayKeepAlive),
LockDifficulty(ServerboundPlayLockDifficulty),
Look(ServerboundPlayLook),
MessageAcknowledgement(ServerboundPlayMessageAcknowledgement),
NameItem(ServerboundPlayNameItem),
PickItemFromBlock(ServerboundPlayPickItemFromBlock),
PickItemFromEntity(ServerboundPlayPickItemFromEntity),
PingRequest(ServerboundPlayPingRequest),
PlayerInput(ServerboundPlayPlayerInput),
PlayerLoaded(ServerboundPlayPlayerLoaded),
Pong(ServerboundPlayPong),
Position(ServerboundPlayPosition),
PositionLook(ServerboundPlayPositionLook),
QueryBlockNbt(ServerboundPlayQueryBlockNbt),
QueryEntityNbt(ServerboundPlayQueryEntityNbt),
RecipeBook(ServerboundPlayRecipeBook),
ResourcePackReceive(ServerboundPlayResourcePackReceive),
SelectBundleItem(ServerboundPlaySelectBundleItem),
SelectTrade(ServerboundPlaySelectTrade),
SetBeaconEffect(ServerboundPlaySetBeaconEffect),
SetCreativeSlot(ServerboundPlaySetCreativeSlot),
SetDifficulty(ServerboundPlaySetDifficulty),
SetSlotState(ServerboundPlaySetSlotState),
Spectate(ServerboundPlaySpectate),
SteerBoat(ServerboundPlaySteerBoat),
TabComplete(ServerboundPlayTabComplete),
TeleportConfirm(ServerboundPlayTeleportConfirm),
TickEnd(ServerboundPlayTickEnd),
UpdateCommandBlock(ServerboundPlayUpdateCommandBlock),
UpdateCommandBlockMinecart(ServerboundPlayUpdateCommandBlockMinecart),
UpdateJigsawBlock(ServerboundPlayUpdateJigsawBlock),
UpdateSign(ServerboundPlayUpdateSign),
UpdateStructureBlock(ServerboundPlayUpdateStructureBlock),
UseEntity(ServerboundPlayUseEntity),
UseItem(ServerboundPlayUseItem),
VehicleMove(ServerboundPlayVehicleMove),
WindowClick(ServerboundPlayWindowClick),
}
impl ServerboundPlayPacket {
pub fn decode_by_id(id: i32, buf: &mut &[u8]) -> Result<Self> {
match id {
ServerboundPlayAbilities::PACKET_ID => {
Ok(Self::Abilities(ServerboundPlayAbilities::decode(buf)?))
}
ServerboundPlayAdvancementTab::PACKET_ID => Ok(Self::AdvancementTab(
ServerboundPlayAdvancementTab::decode(buf)?,
)),
ServerboundPlayArmAnimation::PACKET_ID => Ok(Self::ArmAnimation(
ServerboundPlayArmAnimation::decode(buf)?,
)),
ServerboundPlayBlockDig::PACKET_ID => {
Ok(Self::BlockDig(ServerboundPlayBlockDig::decode(buf)?))
}
ServerboundPlayBlockPlace::PACKET_ID => {
Ok(Self::BlockPlace(ServerboundPlayBlockPlace::decode(buf)?))
}
ServerboundPlayChatCommand::PACKET_ID => {
Ok(Self::ChatCommand(ServerboundPlayChatCommand::decode(buf)?))
}
ServerboundPlayChatCommandSigned::PACKET_ID => Ok(Self::ChatCommandSigned(
ServerboundPlayChatCommandSigned::decode(buf)?,
)),
ServerboundPlayChatMessage::PACKET_ID => {
Ok(Self::ChatMessage(ServerboundPlayChatMessage::decode(buf)?))
}
ServerboundPlayChatSessionUpdate::PACKET_ID => Ok(Self::ChatSessionUpdate(
ServerboundPlayChatSessionUpdate::decode(buf)?,
)),
ServerboundPlayChunkBatchReceived::PACKET_ID => Ok(Self::ChunkBatchReceived(
ServerboundPlayChunkBatchReceived::decode(buf)?,
)),
ServerboundPlayClientCommand::PACKET_ID => Ok(Self::ClientCommand(
ServerboundPlayClientCommand::decode(buf)?,
)),
ServerboundPlayCloseWindow::PACKET_ID => {
Ok(Self::CloseWindow(ServerboundPlayCloseWindow::decode(buf)?))
}
ServerboundPlayConfigurationAcknowledged::PACKET_ID => {
Ok(Self::ConfigurationAcknowledged(
ServerboundPlayConfigurationAcknowledged::decode(buf)?,
))
}
ServerboundPlayCraftRecipeRequest::PACKET_ID => Ok(Self::CraftRecipeRequest(
ServerboundPlayCraftRecipeRequest::decode(buf)?,
)),
ServerboundPlayCustomPayload::PACKET_ID => Ok(Self::CustomPayload(
ServerboundPlayCustomPayload::decode(buf)?,
)),
ServerboundPlayDebugSampleSubscription::PACKET_ID => Ok(Self::DebugSampleSubscription(
ServerboundPlayDebugSampleSubscription::decode(buf)?,
)),
ServerboundPlayDisplayedRecipe::PACKET_ID => Ok(Self::DisplayedRecipe(
ServerboundPlayDisplayedRecipe::decode(buf)?,
)),
ServerboundPlayEditBook::PACKET_ID => {
Ok(Self::EditBook(ServerboundPlayEditBook::decode(buf)?))
}
ServerboundPlayEnchantItem::PACKET_ID => {
Ok(Self::EnchantItem(ServerboundPlayEnchantItem::decode(buf)?))
}
ServerboundPlayEntityAction::PACKET_ID => Ok(Self::EntityAction(
ServerboundPlayEntityAction::decode(buf)?,
)),
ServerboundPlayFlying::PACKET_ID => {
Ok(Self::Flying(ServerboundPlayFlying::decode(buf)?))
}
ServerboundPlayGenerateStructure::PACKET_ID => Ok(Self::GenerateStructure(
ServerboundPlayGenerateStructure::decode(buf)?,
)),
ServerboundPlayHeldItemSlot::PACKET_ID => Ok(Self::HeldItemSlot(
ServerboundPlayHeldItemSlot::decode(buf)?,
)),
ServerboundPlayKeepAlive::PACKET_ID => {
Ok(Self::KeepAlive(ServerboundPlayKeepAlive::decode(buf)?))
}
ServerboundPlayLockDifficulty::PACKET_ID => Ok(Self::LockDifficulty(
ServerboundPlayLockDifficulty::decode(buf)?,
)),
ServerboundPlayLook::PACKET_ID => Ok(Self::Look(ServerboundPlayLook::decode(buf)?)),
ServerboundPlayMessageAcknowledgement::PACKET_ID => Ok(Self::MessageAcknowledgement(
ServerboundPlayMessageAcknowledgement::decode(buf)?,
)),
ServerboundPlayNameItem::PACKET_ID => {
Ok(Self::NameItem(ServerboundPlayNameItem::decode(buf)?))
}
ServerboundPlayPickItemFromBlock::PACKET_ID => Ok(Self::PickItemFromBlock(
ServerboundPlayPickItemFromBlock::decode(buf)?,
)),
ServerboundPlayPickItemFromEntity::PACKET_ID => Ok(Self::PickItemFromEntity(
ServerboundPlayPickItemFromEntity::decode(buf)?,
)),
ServerboundPlayPingRequest::PACKET_ID => {
Ok(Self::PingRequest(ServerboundPlayPingRequest::decode(buf)?))
}
ServerboundPlayPlayerInput::PACKET_ID => {
Ok(Self::PlayerInput(ServerboundPlayPlayerInput::decode(buf)?))
}
ServerboundPlayPlayerLoaded::PACKET_ID => Ok(Self::PlayerLoaded(
ServerboundPlayPlayerLoaded::decode(buf)?,
)),
ServerboundPlayPong::PACKET_ID => Ok(Self::Pong(ServerboundPlayPong::decode(buf)?)),
ServerboundPlayPosition::PACKET_ID => {
Ok(Self::Position(ServerboundPlayPosition::decode(buf)?))
}
ServerboundPlayPositionLook::PACKET_ID => Ok(Self::PositionLook(
ServerboundPlayPositionLook::decode(buf)?,
)),
ServerboundPlayQueryBlockNbt::PACKET_ID => Ok(Self::QueryBlockNbt(
ServerboundPlayQueryBlockNbt::decode(buf)?,
)),
ServerboundPlayQueryEntityNbt::PACKET_ID => Ok(Self::QueryEntityNbt(
ServerboundPlayQueryEntityNbt::decode(buf)?,
)),
ServerboundPlayRecipeBook::PACKET_ID => {
Ok(Self::RecipeBook(ServerboundPlayRecipeBook::decode(buf)?))
}
ServerboundPlayResourcePackReceive::PACKET_ID => Ok(Self::ResourcePackReceive(
ServerboundPlayResourcePackReceive::decode(buf)?,
)),
ServerboundPlaySelectBundleItem::PACKET_ID => Ok(Self::SelectBundleItem(
ServerboundPlaySelectBundleItem::decode(buf)?,
)),
ServerboundPlaySelectTrade::PACKET_ID => {
Ok(Self::SelectTrade(ServerboundPlaySelectTrade::decode(buf)?))
}
ServerboundPlaySetBeaconEffect::PACKET_ID => Ok(Self::SetBeaconEffect(
ServerboundPlaySetBeaconEffect::decode(buf)?,
)),
ServerboundPlaySetCreativeSlot::PACKET_ID => Ok(Self::SetCreativeSlot(
ServerboundPlaySetCreativeSlot::decode(buf)?,
)),
ServerboundPlaySetDifficulty::PACKET_ID => Ok(Self::SetDifficulty(
ServerboundPlaySetDifficulty::decode(buf)?,
)),
ServerboundPlaySetSlotState::PACKET_ID => Ok(Self::SetSlotState(
ServerboundPlaySetSlotState::decode(buf)?,
)),
ServerboundPlaySpectate::PACKET_ID => {
Ok(Self::Spectate(ServerboundPlaySpectate::decode(buf)?))
}
ServerboundPlaySteerBoat::PACKET_ID => {
Ok(Self::SteerBoat(ServerboundPlaySteerBoat::decode(buf)?))
}
ServerboundPlayTabComplete::PACKET_ID => {
Ok(Self::TabComplete(ServerboundPlayTabComplete::decode(buf)?))
}
ServerboundPlayTeleportConfirm::PACKET_ID => Ok(Self::TeleportConfirm(
ServerboundPlayTeleportConfirm::decode(buf)?,
)),
ServerboundPlayTickEnd::PACKET_ID => {
Ok(Self::TickEnd(ServerboundPlayTickEnd::decode(buf)?))
}
ServerboundPlayUpdateCommandBlock::PACKET_ID => Ok(Self::UpdateCommandBlock(
ServerboundPlayUpdateCommandBlock::decode(buf)?,
)),
ServerboundPlayUpdateCommandBlockMinecart::PACKET_ID => {
Ok(Self::UpdateCommandBlockMinecart(
ServerboundPlayUpdateCommandBlockMinecart::decode(buf)?,
))
}
ServerboundPlayUpdateJigsawBlock::PACKET_ID => Ok(Self::UpdateJigsawBlock(
ServerboundPlayUpdateJigsawBlock::decode(buf)?,
)),
ServerboundPlayUpdateSign::PACKET_ID => {
Ok(Self::UpdateSign(ServerboundPlayUpdateSign::decode(buf)?))
}
ServerboundPlayUpdateStructureBlock::PACKET_ID => Ok(Self::UpdateStructureBlock(
ServerboundPlayUpdateStructureBlock::decode(buf)?,
)),
ServerboundPlayUseEntity::PACKET_ID => {
Ok(Self::UseEntity(ServerboundPlayUseEntity::decode(buf)?))
}
ServerboundPlayUseItem::PACKET_ID => {
Ok(Self::UseItem(ServerboundPlayUseItem::decode(buf)?))
}
ServerboundPlayVehicleMove::PACKET_ID => {
Ok(Self::VehicleMove(ServerboundPlayVehicleMove::decode(buf)?))
}
ServerboundPlayWindowClick::PACKET_ID => {
Ok(Self::WindowClick(ServerboundPlayWindowClick::decode(buf)?))
}
_ => Err(Error::UnknownPacket { id, state: "play" }),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum ClientboundPlayPacket {
Abilities(ClientboundPlayAbilities),
AcknowledgePlayerDigging(ClientboundPlayAcknowledgePlayerDigging),
ActionBar(ClientboundPlayActionBar),
Advancements(ClientboundPlayAdvancements),
Animation(ClientboundPlayAnimation),
AttachEntity(ClientboundPlayAttachEntity),
BlockAction(ClientboundPlayBlockAction),
BlockBreakAnimation(ClientboundPlayBlockBreakAnimation),
BlockChange(ClientboundPlayBlockChange),
BossBar(ClientboundPlayBossBar),
Camera(ClientboundPlayCamera),
ChatSuggestions(ClientboundPlayChatSuggestions),
ChunkBatchFinished(ClientboundPlayChunkBatchFinished),
ChunkBatchStart(ClientboundPlayChunkBatchStart),
ChunkBiomes(ClientboundPlayChunkBiomes),
ClearTitles(ClientboundPlayClearTitles),
CloseWindow(ClientboundPlayCloseWindow),
Collect(ClientboundPlayCollect),
CraftProgressBar(ClientboundPlayCraftProgressBar),
CraftRecipeResponse(ClientboundPlayCraftRecipeResponse),
CustomPayload(ClientboundPlayCustomPayload),
DamageEvent(ClientboundPlayDamageEvent),
DeathCombatEvent(ClientboundPlayDeathCombatEvent),
DebugSample(ClientboundPlayDebugSample),
DeclareCommands(ClientboundPlayDeclareCommands),
DeclareRecipes(ClientboundPlayDeclareRecipes),
Difficulty(ClientboundPlayDifficulty),
EndCombatEvent(ClientboundPlayEndCombatEvent),
EnterCombatEvent(ClientboundPlayEnterCombatEvent),
EntityDestroy(ClientboundPlayEntityDestroy),
EntityEffect(ClientboundPlayEntityEffect),
EntityEquipment(ClientboundPlayEntityEquipment),
EntityHeadRotation(ClientboundPlayEntityHeadRotation),
EntityLook(ClientboundPlayEntityLook),
EntityMetadata(ClientboundPlayEntityMetadata),
EntityMoveLook(ClientboundPlayEntityMoveLook),
EntitySoundEffect(ClientboundPlayEntitySoundEffect),
EntityStatus(ClientboundPlayEntityStatus),
EntityTeleport(ClientboundPlayEntityTeleport),
EntityUpdateAttributes(ClientboundPlayEntityUpdateAttributes),
EntityVelocity(ClientboundPlayEntityVelocity),
Experience(ClientboundPlayExperience),
Explosion(ClientboundPlayExplosion),
FacePlayer(ClientboundPlayFacePlayer),
GameStateChange(ClientboundPlayGameStateChange),
HeldItemSlot(ClientboundPlayHeldItemSlot),
HideMessage(ClientboundPlayHideMessage),
HurtAnimation(ClientboundPlayHurtAnimation),
InitializeWorldBorder(ClientboundPlayInitializeWorldBorder),
KeepAlive(ClientboundPlayKeepAlive),
KickDisconnect(ClientboundPlayKickDisconnect),
Login(ClientboundPlayLogin),
Map(ClientboundPlayMap),
MapChunk(ClientboundPlayMapChunk),
MoveMinecart(ClientboundPlayMoveMinecart),
MultiBlockChange(ClientboundPlayMultiBlockChange),
NbtQueryResponse(ClientboundPlayNbtQueryResponse),
OpenBook(ClientboundPlayOpenBook),
OpenHorseWindow(ClientboundPlayOpenHorseWindow),
OpenSignEntity(ClientboundPlayOpenSignEntity),
OpenWindow(ClientboundPlayOpenWindow),
Ping(ClientboundPlayPing),
PingResponse(ClientboundPlayPingResponse),
PlayerChat(ClientboundPlayPlayerChat),
PlayerInfo(ClientboundPlayPlayerInfo),
PlayerRemove(ClientboundPlayPlayerRemove),
PlayerRotation(ClientboundPlayPlayerRotation),
PlayerlistHeader(ClientboundPlayPlayerlistHeader),
Position(ClientboundPlayPosition),
ProfilelessChat(ClientboundPlayProfilelessChat),
RecipeBookAdd(ClientboundPlayRecipeBookAdd),
RecipeBookRemove(ClientboundPlayRecipeBookRemove),
RecipeBookSettings(ClientboundPlayRecipeBookSettings),
RelEntityMove(ClientboundPlayRelEntityMove),
RemoveEntityEffect(ClientboundPlayRemoveEntityEffect),
ResetScore(ClientboundPlayResetScore),
Respawn(ClientboundPlayRespawn),
ScoreboardDisplayObjective(ClientboundPlayScoreboardDisplayObjective),
ScoreboardObjective(ClientboundPlayScoreboardObjective),
ScoreboardScore(ClientboundPlayScoreboardScore),
SelectAdvancementTab(ClientboundPlaySelectAdvancementTab),
ServerData(ClientboundPlayServerData),
SetCooldown(ClientboundPlaySetCooldown),
SetCursorItem(ClientboundPlaySetCursorItem),
SetPassengers(ClientboundPlaySetPassengers),
SetPlayerInventory(ClientboundPlaySetPlayerInventory),
SetProjectilePower(ClientboundPlaySetProjectilePower),
SetSlot(ClientboundPlaySetSlot),
SetTickingState(ClientboundPlaySetTickingState),
SetTitleSubtitle(ClientboundPlaySetTitleSubtitle),
SetTitleText(ClientboundPlaySetTitleText),
SetTitleTime(ClientboundPlaySetTitleTime),
SimulationDistance(ClientboundPlaySimulationDistance),
SoundEffect(ClientboundPlaySoundEffect),
SpawnEntity(ClientboundPlaySpawnEntity),
SpawnEntityExperienceOrb(ClientboundPlaySpawnEntityExperienceOrb),
SpawnPosition(ClientboundPlaySpawnPosition),
StartConfiguration(ClientboundPlayStartConfiguration),
Statistics(ClientboundPlayStatistics),
StepTick(ClientboundPlayStepTick),
StopSound(ClientboundPlayStopSound),
SyncEntityPosition(ClientboundPlaySyncEntityPosition),
SystemChat(ClientboundPlaySystemChat),
TabComplete(ClientboundPlayTabComplete),
Tags(ClientboundPlayTags),
Teams(ClientboundPlayTeams),
TileEntityData(ClientboundPlayTileEntityData),
TradeList(ClientboundPlayTradeList),
UnloadChunk(ClientboundPlayUnloadChunk),
UpdateHealth(ClientboundPlayUpdateHealth),
UpdateLight(ClientboundPlayUpdateLight),
UpdateTime(ClientboundPlayUpdateTime),
UpdateViewDistance(ClientboundPlayUpdateViewDistance),
UpdateViewPosition(ClientboundPlayUpdateViewPosition),
VehicleMove(ClientboundPlayVehicleMove),
WindowItems(ClientboundPlayWindowItems),
WorldBorderCenter(ClientboundPlayWorldBorderCenter),
WorldBorderLerpSize(ClientboundPlayWorldBorderLerpSize),
WorldBorderSize(ClientboundPlayWorldBorderSize),
WorldBorderWarningDelay(ClientboundPlayWorldBorderWarningDelay),
WorldBorderWarningReach(ClientboundPlayWorldBorderWarningReach),
WorldEvent(ClientboundPlayWorldEvent),
WorldParticles(ClientboundPlayWorldParticles),
}
impl ClientboundPlayPacket {
pub fn decode_by_id(id: i32, buf: &mut &[u8]) -> Result<Self> {
match id {
ClientboundPlayAbilities::PACKET_ID => {
Ok(Self::Abilities(ClientboundPlayAbilities::decode(buf)?))
}
ClientboundPlayAcknowledgePlayerDigging::PACKET_ID => {
Ok(Self::AcknowledgePlayerDigging(
ClientboundPlayAcknowledgePlayerDigging::decode(buf)?,
))
}
ClientboundPlayActionBar::PACKET_ID => {
Ok(Self::ActionBar(ClientboundPlayActionBar::decode(buf)?))
}
ClientboundPlayAdvancements::PACKET_ID => Ok(Self::Advancements(
ClientboundPlayAdvancements::decode(buf)?,
)),
ClientboundPlayAnimation::PACKET_ID => {
Ok(Self::Animation(ClientboundPlayAnimation::decode(buf)?))
}
ClientboundPlayAttachEntity::PACKET_ID => Ok(Self::AttachEntity(
ClientboundPlayAttachEntity::decode(buf)?,
)),
ClientboundPlayBlockAction::PACKET_ID => {
Ok(Self::BlockAction(ClientboundPlayBlockAction::decode(buf)?))
}
ClientboundPlayBlockBreakAnimation::PACKET_ID => Ok(Self::BlockBreakAnimation(
ClientboundPlayBlockBreakAnimation::decode(buf)?,
)),
ClientboundPlayBlockChange::PACKET_ID => {
Ok(Self::BlockChange(ClientboundPlayBlockChange::decode(buf)?))
}
ClientboundPlayBossBar::PACKET_ID => {
Ok(Self::BossBar(ClientboundPlayBossBar::decode(buf)?))
}
ClientboundPlayCamera::PACKET_ID => {
Ok(Self::Camera(ClientboundPlayCamera::decode(buf)?))
}
ClientboundPlayChatSuggestions::PACKET_ID => Ok(Self::ChatSuggestions(
ClientboundPlayChatSuggestions::decode(buf)?,
)),
ClientboundPlayChunkBatchFinished::PACKET_ID => Ok(Self::ChunkBatchFinished(
ClientboundPlayChunkBatchFinished::decode(buf)?,
)),
ClientboundPlayChunkBatchStart::PACKET_ID => Ok(Self::ChunkBatchStart(
ClientboundPlayChunkBatchStart::decode(buf)?,
)),
ClientboundPlayChunkBiomes::PACKET_ID => {
Ok(Self::ChunkBiomes(ClientboundPlayChunkBiomes::decode(buf)?))
}
ClientboundPlayClearTitles::PACKET_ID => {
Ok(Self::ClearTitles(ClientboundPlayClearTitles::decode(buf)?))
}
ClientboundPlayCloseWindow::PACKET_ID => {
Ok(Self::CloseWindow(ClientboundPlayCloseWindow::decode(buf)?))
}
ClientboundPlayCollect::PACKET_ID => {
Ok(Self::Collect(ClientboundPlayCollect::decode(buf)?))
}
ClientboundPlayCraftProgressBar::PACKET_ID => Ok(Self::CraftProgressBar(
ClientboundPlayCraftProgressBar::decode(buf)?,
)),
ClientboundPlayCraftRecipeResponse::PACKET_ID => Ok(Self::CraftRecipeResponse(
ClientboundPlayCraftRecipeResponse::decode(buf)?,
)),
ClientboundPlayCustomPayload::PACKET_ID => Ok(Self::CustomPayload(
ClientboundPlayCustomPayload::decode(buf)?,
)),
ClientboundPlayDamageEvent::PACKET_ID => {
Ok(Self::DamageEvent(ClientboundPlayDamageEvent::decode(buf)?))
}
ClientboundPlayDeathCombatEvent::PACKET_ID => Ok(Self::DeathCombatEvent(
ClientboundPlayDeathCombatEvent::decode(buf)?,
)),
ClientboundPlayDebugSample::PACKET_ID => {
Ok(Self::DebugSample(ClientboundPlayDebugSample::decode(buf)?))
}
ClientboundPlayDeclareCommands::PACKET_ID => Ok(Self::DeclareCommands(
ClientboundPlayDeclareCommands::decode(buf)?,
)),
ClientboundPlayDeclareRecipes::PACKET_ID => Ok(Self::DeclareRecipes(
ClientboundPlayDeclareRecipes::decode(buf)?,
)),
ClientboundPlayDifficulty::PACKET_ID => {
Ok(Self::Difficulty(ClientboundPlayDifficulty::decode(buf)?))
}
ClientboundPlayEndCombatEvent::PACKET_ID => Ok(Self::EndCombatEvent(
ClientboundPlayEndCombatEvent::decode(buf)?,
)),
ClientboundPlayEnterCombatEvent::PACKET_ID => Ok(Self::EnterCombatEvent(
ClientboundPlayEnterCombatEvent::decode(buf)?,
)),
ClientboundPlayEntityDestroy::PACKET_ID => Ok(Self::EntityDestroy(
ClientboundPlayEntityDestroy::decode(buf)?,
)),
ClientboundPlayEntityEffect::PACKET_ID => Ok(Self::EntityEffect(
ClientboundPlayEntityEffect::decode(buf)?,
)),
ClientboundPlayEntityEquipment::PACKET_ID => Ok(Self::EntityEquipment(
ClientboundPlayEntityEquipment::decode(buf)?,
)),
ClientboundPlayEntityHeadRotation::PACKET_ID => Ok(Self::EntityHeadRotation(
ClientboundPlayEntityHeadRotation::decode(buf)?,
)),
ClientboundPlayEntityLook::PACKET_ID => {
Ok(Self::EntityLook(ClientboundPlayEntityLook::decode(buf)?))
}
ClientboundPlayEntityMetadata::PACKET_ID => Ok(Self::EntityMetadata(
ClientboundPlayEntityMetadata::decode(buf)?,
)),
ClientboundPlayEntityMoveLook::PACKET_ID => Ok(Self::EntityMoveLook(
ClientboundPlayEntityMoveLook::decode(buf)?,
)),
ClientboundPlayEntitySoundEffect::PACKET_ID => Ok(Self::EntitySoundEffect(
ClientboundPlayEntitySoundEffect::decode(buf)?,
)),
ClientboundPlayEntityStatus::PACKET_ID => Ok(Self::EntityStatus(
ClientboundPlayEntityStatus::decode(buf)?,
)),
ClientboundPlayEntityTeleport::PACKET_ID => Ok(Self::EntityTeleport(
ClientboundPlayEntityTeleport::decode(buf)?,
)),
ClientboundPlayEntityUpdateAttributes::PACKET_ID => Ok(Self::EntityUpdateAttributes(
ClientboundPlayEntityUpdateAttributes::decode(buf)?,
)),
ClientboundPlayEntityVelocity::PACKET_ID => Ok(Self::EntityVelocity(
ClientboundPlayEntityVelocity::decode(buf)?,
)),
ClientboundPlayExperience::PACKET_ID => {
Ok(Self::Experience(ClientboundPlayExperience::decode(buf)?))
}
ClientboundPlayExplosion::PACKET_ID => {
Ok(Self::Explosion(ClientboundPlayExplosion::decode(buf)?))
}
ClientboundPlayFacePlayer::PACKET_ID => {
Ok(Self::FacePlayer(ClientboundPlayFacePlayer::decode(buf)?))
}
ClientboundPlayGameStateChange::PACKET_ID => Ok(Self::GameStateChange(
ClientboundPlayGameStateChange::decode(buf)?,
)),
ClientboundPlayHeldItemSlot::PACKET_ID => Ok(Self::HeldItemSlot(
ClientboundPlayHeldItemSlot::decode(buf)?,
)),
ClientboundPlayHideMessage::PACKET_ID => {
Ok(Self::HideMessage(ClientboundPlayHideMessage::decode(buf)?))
}
ClientboundPlayHurtAnimation::PACKET_ID => Ok(Self::HurtAnimation(
ClientboundPlayHurtAnimation::decode(buf)?,
)),
ClientboundPlayInitializeWorldBorder::PACKET_ID => Ok(Self::InitializeWorldBorder(
ClientboundPlayInitializeWorldBorder::decode(buf)?,
)),
ClientboundPlayKeepAlive::PACKET_ID => {
Ok(Self::KeepAlive(ClientboundPlayKeepAlive::decode(buf)?))
}
ClientboundPlayKickDisconnect::PACKET_ID => Ok(Self::KickDisconnect(
ClientboundPlayKickDisconnect::decode(buf)?,
)),
ClientboundPlayLogin::PACKET_ID => Ok(Self::Login(ClientboundPlayLogin::decode(buf)?)),
ClientboundPlayMap::PACKET_ID => Ok(Self::Map(ClientboundPlayMap::decode(buf)?)),
ClientboundPlayMapChunk::PACKET_ID => {
Ok(Self::MapChunk(ClientboundPlayMapChunk::decode(buf)?))
}
ClientboundPlayMoveMinecart::PACKET_ID => Ok(Self::MoveMinecart(
ClientboundPlayMoveMinecart::decode(buf)?,
)),
ClientboundPlayMultiBlockChange::PACKET_ID => Ok(Self::MultiBlockChange(
ClientboundPlayMultiBlockChange::decode(buf)?,
)),
ClientboundPlayNbtQueryResponse::PACKET_ID => Ok(Self::NbtQueryResponse(
ClientboundPlayNbtQueryResponse::decode(buf)?,
)),
ClientboundPlayOpenBook::PACKET_ID => {
Ok(Self::OpenBook(ClientboundPlayOpenBook::decode(buf)?))
}
ClientboundPlayOpenHorseWindow::PACKET_ID => Ok(Self::OpenHorseWindow(
ClientboundPlayOpenHorseWindow::decode(buf)?,
)),
ClientboundPlayOpenSignEntity::PACKET_ID => Ok(Self::OpenSignEntity(
ClientboundPlayOpenSignEntity::decode(buf)?,
)),
ClientboundPlayOpenWindow::PACKET_ID => {
Ok(Self::OpenWindow(ClientboundPlayOpenWindow::decode(buf)?))
}
ClientboundPlayPing::PACKET_ID => Ok(Self::Ping(ClientboundPlayPing::decode(buf)?)),
ClientboundPlayPingResponse::PACKET_ID => Ok(Self::PingResponse(
ClientboundPlayPingResponse::decode(buf)?,
)),
ClientboundPlayPlayerChat::PACKET_ID => {
Ok(Self::PlayerChat(ClientboundPlayPlayerChat::decode(buf)?))
}
ClientboundPlayPlayerInfo::PACKET_ID => {
Ok(Self::PlayerInfo(ClientboundPlayPlayerInfo::decode(buf)?))
}
ClientboundPlayPlayerRemove::PACKET_ID => Ok(Self::PlayerRemove(
ClientboundPlayPlayerRemove::decode(buf)?,
)),
ClientboundPlayPlayerRotation::PACKET_ID => Ok(Self::PlayerRotation(
ClientboundPlayPlayerRotation::decode(buf)?,
)),
ClientboundPlayPlayerlistHeader::PACKET_ID => Ok(Self::PlayerlistHeader(
ClientboundPlayPlayerlistHeader::decode(buf)?,
)),
ClientboundPlayPosition::PACKET_ID => {
Ok(Self::Position(ClientboundPlayPosition::decode(buf)?))
}
ClientboundPlayProfilelessChat::PACKET_ID => Ok(Self::ProfilelessChat(
ClientboundPlayProfilelessChat::decode(buf)?,
)),
ClientboundPlayRecipeBookAdd::PACKET_ID => Ok(Self::RecipeBookAdd(
ClientboundPlayRecipeBookAdd::decode(buf)?,
)),
ClientboundPlayRecipeBookRemove::PACKET_ID => Ok(Self::RecipeBookRemove(
ClientboundPlayRecipeBookRemove::decode(buf)?,
)),
ClientboundPlayRecipeBookSettings::PACKET_ID => Ok(Self::RecipeBookSettings(
ClientboundPlayRecipeBookSettings::decode(buf)?,
)),
ClientboundPlayRelEntityMove::PACKET_ID => Ok(Self::RelEntityMove(
ClientboundPlayRelEntityMove::decode(buf)?,
)),
ClientboundPlayRemoveEntityEffect::PACKET_ID => Ok(Self::RemoveEntityEffect(
ClientboundPlayRemoveEntityEffect::decode(buf)?,
)),
ClientboundPlayResetScore::PACKET_ID => {
Ok(Self::ResetScore(ClientboundPlayResetScore::decode(buf)?))
}
ClientboundPlayRespawn::PACKET_ID => {
Ok(Self::Respawn(ClientboundPlayRespawn::decode(buf)?))
}
ClientboundPlayScoreboardDisplayObjective::PACKET_ID => {
Ok(Self::ScoreboardDisplayObjective(
ClientboundPlayScoreboardDisplayObjective::decode(buf)?,
))
}
ClientboundPlayScoreboardObjective::PACKET_ID => Ok(Self::ScoreboardObjective(
ClientboundPlayScoreboardObjective::decode(buf)?,
)),
ClientboundPlayScoreboardScore::PACKET_ID => Ok(Self::ScoreboardScore(
ClientboundPlayScoreboardScore::decode(buf)?,
)),
ClientboundPlaySelectAdvancementTab::PACKET_ID => Ok(Self::SelectAdvancementTab(
ClientboundPlaySelectAdvancementTab::decode(buf)?,
)),
ClientboundPlayServerData::PACKET_ID => {
Ok(Self::ServerData(ClientboundPlayServerData::decode(buf)?))
}
ClientboundPlaySetCooldown::PACKET_ID => {
Ok(Self::SetCooldown(ClientboundPlaySetCooldown::decode(buf)?))
}
ClientboundPlaySetCursorItem::PACKET_ID => Ok(Self::SetCursorItem(
ClientboundPlaySetCursorItem::decode(buf)?,
)),
ClientboundPlaySetPassengers::PACKET_ID => Ok(Self::SetPassengers(
ClientboundPlaySetPassengers::decode(buf)?,
)),
ClientboundPlaySetPlayerInventory::PACKET_ID => Ok(Self::SetPlayerInventory(
ClientboundPlaySetPlayerInventory::decode(buf)?,
)),
ClientboundPlaySetProjectilePower::PACKET_ID => Ok(Self::SetProjectilePower(
ClientboundPlaySetProjectilePower::decode(buf)?,
)),
ClientboundPlaySetSlot::PACKET_ID => {
Ok(Self::SetSlot(ClientboundPlaySetSlot::decode(buf)?))
}
ClientboundPlaySetTickingState::PACKET_ID => Ok(Self::SetTickingState(
ClientboundPlaySetTickingState::decode(buf)?,
)),
ClientboundPlaySetTitleSubtitle::PACKET_ID => Ok(Self::SetTitleSubtitle(
ClientboundPlaySetTitleSubtitle::decode(buf)?,
)),
ClientboundPlaySetTitleText::PACKET_ID => Ok(Self::SetTitleText(
ClientboundPlaySetTitleText::decode(buf)?,
)),
ClientboundPlaySetTitleTime::PACKET_ID => Ok(Self::SetTitleTime(
ClientboundPlaySetTitleTime::decode(buf)?,
)),
ClientboundPlaySimulationDistance::PACKET_ID => Ok(Self::SimulationDistance(
ClientboundPlaySimulationDistance::decode(buf)?,
)),
ClientboundPlaySoundEffect::PACKET_ID => {
Ok(Self::SoundEffect(ClientboundPlaySoundEffect::decode(buf)?))
}
ClientboundPlaySpawnEntity::PACKET_ID => {
Ok(Self::SpawnEntity(ClientboundPlaySpawnEntity::decode(buf)?))
}
ClientboundPlaySpawnEntityExperienceOrb::PACKET_ID => {
Ok(Self::SpawnEntityExperienceOrb(
ClientboundPlaySpawnEntityExperienceOrb::decode(buf)?,
))
}
ClientboundPlaySpawnPosition::PACKET_ID => Ok(Self::SpawnPosition(
ClientboundPlaySpawnPosition::decode(buf)?,
)),
ClientboundPlayStartConfiguration::PACKET_ID => Ok(Self::StartConfiguration(
ClientboundPlayStartConfiguration::decode(buf)?,
)),
ClientboundPlayStatistics::PACKET_ID => {
Ok(Self::Statistics(ClientboundPlayStatistics::decode(buf)?))
}
ClientboundPlayStepTick::PACKET_ID => {
Ok(Self::StepTick(ClientboundPlayStepTick::decode(buf)?))
}
ClientboundPlayStopSound::PACKET_ID => {
Ok(Self::StopSound(ClientboundPlayStopSound::decode(buf)?))
}
ClientboundPlaySyncEntityPosition::PACKET_ID => Ok(Self::SyncEntityPosition(
ClientboundPlaySyncEntityPosition::decode(buf)?,
)),
ClientboundPlaySystemChat::PACKET_ID => {
Ok(Self::SystemChat(ClientboundPlaySystemChat::decode(buf)?))
}
ClientboundPlayTabComplete::PACKET_ID => {
Ok(Self::TabComplete(ClientboundPlayTabComplete::decode(buf)?))
}
ClientboundPlayTags::PACKET_ID => Ok(Self::Tags(ClientboundPlayTags::decode(buf)?)),
ClientboundPlayTeams::PACKET_ID => Ok(Self::Teams(ClientboundPlayTeams::decode(buf)?)),
ClientboundPlayTileEntityData::PACKET_ID => Ok(Self::TileEntityData(
ClientboundPlayTileEntityData::decode(buf)?,
)),
ClientboundPlayTradeList::PACKET_ID => {
Ok(Self::TradeList(ClientboundPlayTradeList::decode(buf)?))
}
ClientboundPlayUnloadChunk::PACKET_ID => {
Ok(Self::UnloadChunk(ClientboundPlayUnloadChunk::decode(buf)?))
}
ClientboundPlayUpdateHealth::PACKET_ID => Ok(Self::UpdateHealth(
ClientboundPlayUpdateHealth::decode(buf)?,
)),
ClientboundPlayUpdateLight::PACKET_ID => {
Ok(Self::UpdateLight(ClientboundPlayUpdateLight::decode(buf)?))
}
ClientboundPlayUpdateTime::PACKET_ID => {
Ok(Self::UpdateTime(ClientboundPlayUpdateTime::decode(buf)?))
}
ClientboundPlayUpdateViewDistance::PACKET_ID => Ok(Self::UpdateViewDistance(
ClientboundPlayUpdateViewDistance::decode(buf)?,
)),
ClientboundPlayUpdateViewPosition::PACKET_ID => Ok(Self::UpdateViewPosition(
ClientboundPlayUpdateViewPosition::decode(buf)?,
)),
ClientboundPlayVehicleMove::PACKET_ID => {
Ok(Self::VehicleMove(ClientboundPlayVehicleMove::decode(buf)?))
}
ClientboundPlayWindowItems::PACKET_ID => {
Ok(Self::WindowItems(ClientboundPlayWindowItems::decode(buf)?))
}
ClientboundPlayWorldBorderCenter::PACKET_ID => Ok(Self::WorldBorderCenter(
ClientboundPlayWorldBorderCenter::decode(buf)?,
)),
ClientboundPlayWorldBorderLerpSize::PACKET_ID => Ok(Self::WorldBorderLerpSize(
ClientboundPlayWorldBorderLerpSize::decode(buf)?,
)),
ClientboundPlayWorldBorderSize::PACKET_ID => Ok(Self::WorldBorderSize(
ClientboundPlayWorldBorderSize::decode(buf)?,
)),
ClientboundPlayWorldBorderWarningDelay::PACKET_ID => Ok(Self::WorldBorderWarningDelay(
ClientboundPlayWorldBorderWarningDelay::decode(buf)?,
)),
ClientboundPlayWorldBorderWarningReach::PACKET_ID => Ok(Self::WorldBorderWarningReach(
ClientboundPlayWorldBorderWarningReach::decode(buf)?,
)),
ClientboundPlayWorldEvent::PACKET_ID => {
Ok(Self::WorldEvent(ClientboundPlayWorldEvent::decode(buf)?))
}
ClientboundPlayWorldParticles::PACKET_ID => Ok(Self::WorldParticles(
ClientboundPlayWorldParticles::decode(buf)?,
)),
_ => Err(Error::UnknownPacket { id, state: "play" }),
}
}
}