summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2021-07-20 20:48:05 +0200
committerGitHub <noreply@github.com>2021-07-20 20:48:05 +0200
commit179d6da490636799fd765298c9e3d884d9d980a1 (patch)
tree73f8bce9a3d8f42aa5364c25abadc566f27892e5 /src/Protocol
parentUpdate README.md (#5262) (diff)
downloadcuberite-179d6da490636799fd765298c9e3d884d9d980a1.tar
cuberite-179d6da490636799fd765298c9e3d884d9d980a1.tar.gz
cuberite-179d6da490636799fd765298c9e3d884d9d980a1.tar.bz2
cuberite-179d6da490636799fd765298c9e3d884d9d980a1.tar.lz
cuberite-179d6da490636799fd765298c9e3d884d9d980a1.tar.xz
cuberite-179d6da490636799fd765298c9e3d884d9d980a1.tar.zst
cuberite-179d6da490636799fd765298c9e3d884d9d980a1.zip
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/Protocol_1_8.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 02b76ccae..e7e110296 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -2805,27 +2805,37 @@ void cProtocol_1_8_0::HandlePacketWindowClose(cByteBuffer & a_ByteBuffer)
void cProtocol_1_8_0::HandleVanillaPluginMessage(cByteBuffer & a_ByteBuffer, const AString & a_Channel)
{
- if (a_Channel == "MC|AdvCdm")
+ if ((a_Channel == "MC|AdvCdm") || (a_Channel == "MC|AdvCmd")) // Spelling was fixed in 15w34
{
- HANDLE_READ(a_ByteBuffer, ReadBEUInt8, UInt8, Mode);
+ // https://wiki.vg/index.php?title=Plugin_channels&oldid=14089#MC.7CAdvCmd
+ HANDLE_READ(a_ByteBuffer, ReadBEUInt8, UInt8, Dest);
- switch (Mode)
+ switch (Dest)
{
case 0x00:
{
+ // Editing a command-block
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);
-
m_Client->HandleCommandBlockBlockChange(BlockX, BlockY, BlockZ, Command);
break;
}
+ case 0x01:
+ {
+ // Editing a command-block-minecart
+ HANDLE_READ(a_ByteBuffer, ReadBEUInt32, UInt32, EntityID);
+ HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Command);
+ m_Client->HandleCommandBlockEntityChange(EntityID, Command);
+ break;
+ }
+
default:
{
- m_Client->SendChat(Printf("Failure setting command block command; unhandled mode %u (0x%02x)", Mode, Mode), mtFailure);
- LOG("Unhandled MC|AdvCdm packet mode.");
+ m_Client->SendChat(Printf("Failure setting command block command; unhandled destination %u (0x%02x)", Dest, Dest), mtFailure);
+ LOG("Unhandled MC|AdvCmd packet destination.");
return;
}
} // switch (Mode)