From acc399ffb3a8a542b0bb99d056de045f7e7d26e0 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 11 Sep 2020 19:42:22 +0100 Subject: Cleanup Protocol classes * Visibility, static, ordering changes --- src/Protocol/Protocol_1_14.cpp | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/Protocol/Protocol_1_14.cpp') diff --git a/src/Protocol/Protocol_1_14.cpp b/src/Protocol/Protocol_1_14.cpp index c31b3ddfb..c3e4a62d0 100644 --- a/src/Protocol/Protocol_1_14.cpp +++ b/src/Protocol/Protocol_1_14.cpp @@ -215,77 +215,77 @@ cProtocol::Version cProtocol_1_14::GetProtocolVersion() -bool cProtocol_1_14::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType) +std::pair cProtocol_1_14::GetItemFromProtocolID(UInt32 a_ProtocolID) { - if (m_State != 3) - { - return Super::HandlePacket(a_ByteBuffer, a_PacketType); - } - - // Game - switch (a_PacketType) - { - default: AString dum; a_ByteBuffer.ReadAll(dum); a_ByteBuffer.CommitRead(); a_ByteBuffer.Write(" ", 1); - return true; - } + return PaletteUpgrade::ToItem(Palette_1_14::ToItem(a_ProtocolID)); } -void cProtocol_1_14::HandlePacketBlockDig(cByteBuffer & a_ByteBuffer) +UInt32 cProtocol_1_14::GetProtocolBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) { + return Palette_1_14::From(PaletteUpgrade::FromBlock(a_BlockType, a_Meta)); } -void cProtocol_1_14::HandlePacketBlockPlace(cByteBuffer & a_ByteBuffer) +UInt32 cProtocol_1_14::GetProtocolItemType(short a_ItemID, short a_ItemDamage) { + return Palette_1_14::From(PaletteUpgrade::FromItem(a_ItemID, a_ItemDamage)); } -void cProtocol_1_14::HandlePacketUpdateSign(cByteBuffer & a_ByteBuffer) +UInt32 cProtocol_1_14::GetProtocolStatisticType(Statistic a_Statistic) { + return Palette_1_14::From(a_Statistic); } -std::pair cProtocol_1_14::GetItemFromProtocolID(UInt32 a_ProtocolID) +bool cProtocol_1_14::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType) { - return PaletteUpgrade::ToItem(Palette_1_14::ToItem(a_ProtocolID)); + if (m_State != 3) + { + return Super::HandlePacket(a_ByteBuffer, a_PacketType); + } + + // Game + switch (a_PacketType) + { + default: AString dum; a_ByteBuffer.ReadAll(dum); a_ByteBuffer.CommitRead(); a_ByteBuffer.Write(" ", 1); + return true; + } } -UInt32 cProtocol_1_14::GetProtocolBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) +void cProtocol_1_14::HandlePacketBlockDig(cByteBuffer & a_ByteBuffer) { - return Palette_1_14::FromBlock(PaletteUpgrade::FromBlock(a_BlockType, a_Meta)); } -UInt32 cProtocol_1_14::GetProtocolItemType(short a_ItemID, short a_ItemDamage) +void cProtocol_1_14::HandlePacketBlockPlace(cByteBuffer & a_ByteBuffer) { - return Palette_1_14::FromItem(PaletteUpgrade::FromItem(a_ItemID, a_ItemDamage)); } -UInt32 cProtocol_1_14::GetProtocolStatisticType(Statistic a_Statistic) +void cProtocol_1_14::HandlePacketUpdateSign(cByteBuffer & a_ByteBuffer) { - return Palette_1_14::From(a_Statistic); } -- cgit v1.2.3