diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-11-23 18:16:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 18:16:25 +0100 |
commit | 7c7890c658616222c6aba6dde365f757f75005d6 (patch) | |
tree | e76a422bdabaa26a3ac8448042a21653f4a545ae /src/Protocol/Protocol_1_9.cpp | |
parent | Dump the api as well as checking it. (diff) | |
download | cuberite-7c7890c658616222c6aba6dde365f757f75005d6.tar cuberite-7c7890c658616222c6aba6dde365f757f75005d6.tar.gz cuberite-7c7890c658616222c6aba6dde365f757f75005d6.tar.bz2 cuberite-7c7890c658616222c6aba6dde365f757f75005d6.tar.lz cuberite-7c7890c658616222c6aba6dde365f757f75005d6.tar.xz cuberite-7c7890c658616222c6aba6dde365f757f75005d6.tar.zst cuberite-7c7890c658616222c6aba6dde365f757f75005d6.zip |
Diffstat (limited to 'src/Protocol/Protocol_1_9.cpp')
-rw-r--r-- | src/Protocol/Protocol_1_9.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp index 3b09ada4c..2cc087682 100644 --- a/src/Protocol/Protocol_1_9.cpp +++ b/src/Protocol/Protocol_1_9.cpp @@ -1197,6 +1197,58 @@ void cProtocol_1_9_0::HandlePacketWindowClick(cByteBuffer & a_ByteBuffer) +void cProtocol_1_9_0::HandleVanillaPluginMessage(cByteBuffer & a_ByteBuffer, std::string_view a_Channel) +{ + if (a_Channel == "AutoCmd") + { + HANDLE_READ(a_ByteBuffer, ReadBEInt32, Int32, BlockX); + HANDLE_READ(a_ByteBuffer, ReadBEInt32, Int32, BlockY); + HANDLE_READ(a_ByteBuffer, ReadBEInt32, Int32, BlockZ); + HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Command); + HANDLE_READ(a_ByteBuffer, ReadBool, bool, TrackOutput); + HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Mode); + HANDLE_READ(a_ByteBuffer, ReadBool, bool, Conditional); + HANDLE_READ(a_ByteBuffer, ReadBool, bool, Automatic); + + m_Client->HandleCommandBlockBlockChange(BlockX, BlockY, BlockZ, Command); + } + else if (a_Channel == "PickItem") + { + HANDLE_READ(a_ByteBuffer, ReadVarInt32, UInt32, InventorySlotIndex); + } + else if (a_Channel == "Struct") + { + HANDLE_READ(a_ByteBuffer, ReadBEInt32, Int32, BlockX); + HANDLE_READ(a_ByteBuffer, ReadBEInt32, Int32, BlockY); + HANDLE_READ(a_ByteBuffer, ReadBEInt32, Int32, BlockZ); + HANDLE_READ(a_ByteBuffer, ReadBEUInt8, UInt8, Action); + HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Mode); + HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Name); + HANDLE_READ(a_ByteBuffer, ReadBEInt32, Int32, OffsetX); + HANDLE_READ(a_ByteBuffer, ReadBEInt32, Int32, OffsetY); + HANDLE_READ(a_ByteBuffer, ReadBEInt32, Int32, OffsetZ); + HANDLE_READ(a_ByteBuffer, ReadBEUInt32, UInt32, SizeX); + HANDLE_READ(a_ByteBuffer, ReadBEUInt32, UInt32, SizeY); + HANDLE_READ(a_ByteBuffer, ReadBEUInt32, UInt32, SizeZ); + HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Mirror); + HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Rotation); + HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Metadata); + HANDLE_READ(a_ByteBuffer, ReadBool, bool, IgnoreEntities); + HANDLE_READ(a_ByteBuffer, ReadBool, bool, ShowAir); + HANDLE_READ(a_ByteBuffer, ReadBool, bool, ShowBoundingBox); + HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, Integrity); + HANDLE_READ(a_ByteBuffer, ReadVarInt64, UInt64, Seed); + } + else + { + Super::HandleVanillaPluginMessage(a_ByteBuffer, a_Channel); + } +} + + + + + void cProtocol_1_9_0::ParseItemMetadata(cItem & a_Item, const ContiguousByteBufferView a_Metadata) const { // Parse into NBT: |