diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-20 22:26:29 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-21 01:53:09 +0200 |
commit | 9a9079d3da006dc59ee2a8867f832d03211b1cd5 (patch) | |
tree | 5b5153d1cb806d9567706d09108c60bcc743770a /src/Protocol/Protocol_1_14.cpp | |
parent | Replace PowerData struct with PowerLevel (diff) | |
download | cuberite-9a9079d3da006dc59ee2a8867f832d03211b1cd5.tar cuberite-9a9079d3da006dc59ee2a8867f832d03211b1cd5.tar.gz cuberite-9a9079d3da006dc59ee2a8867f832d03211b1cd5.tar.bz2 cuberite-9a9079d3da006dc59ee2a8867f832d03211b1cd5.tar.lz cuberite-9a9079d3da006dc59ee2a8867f832d03211b1cd5.tar.xz cuberite-9a9079d3da006dc59ee2a8867f832d03211b1cd5.tar.zst cuberite-9a9079d3da006dc59ee2a8867f832d03211b1cd5.zip |
Diffstat (limited to 'src/Protocol/Protocol_1_14.cpp')
-rw-r--r-- | src/Protocol/Protocol_1_14.cpp | 43 |
1 files changed, 10 insertions, 33 deletions
diff --git a/src/Protocol/Protocol_1_14.cpp b/src/Protocol/Protocol_1_14.cpp index 3222e7fe2..1cde27413 100644 --- a/src/Protocol/Protocol_1_14.cpp +++ b/src/Protocol/Protocol_1_14.cpp @@ -70,38 +70,6 @@ void cProtocol_1_14::SendBlockBreakAnim(UInt32 a_EntityID, int a_BlockX, int a_B -void cProtocol_1_14::SendBlockChange(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) -{ - SendBlockChange<&Palette_1_14::FromBlock>(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta); -} - - - - - -template <auto Palette> -void cProtocol_1_14::SendBlockChange(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) -{ - ASSERT(m_State == 3); // In game mode? - - cPacketizer Pkt(*this, pktBlockChange); - Pkt.WriteXZYPosition64(a_BlockX, a_BlockY, a_BlockZ); - Pkt.WriteVarInt32(Palette(PaletteUpgrade::FromBlock(a_BlockType, a_BlockMeta))); -} - - - - - -void cProtocol_1_14::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockVector & a_Changes) -{ - cProtocol_1_13::SendBlockChanges<&Palette_1_14::FromBlock>(a_ChunkX, a_ChunkZ, a_Changes); -} - - - - - void cProtocol_1_14::SendEditSign(int a_BlockX, int a_BlockY, int a_BlockZ) { } @@ -299,7 +267,16 @@ std::pair<short, short> cProtocol_1_14::GetItemFromProtocolID(UInt32 a_ProtocolI -UInt32 cProtocol_1_14::GetProtocolIDFromItem(short a_ItemID, short a_ItemDamage) +UInt32 cProtocol_1_14::GetProtocolBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta) +{ + return Palette_1_14::FromBlock(PaletteUpgrade::FromBlock(a_BlockType, a_Meta)); +} + + + + + +UInt32 cProtocol_1_14::GetProtocolItemType(short a_ItemID, short a_ItemDamage) { return Palette_1_14::FromItem(PaletteUpgrade::FromItem(a_ItemID, a_ItemDamage)); } |