diff options
author | Pablo Beltrán <spekdrum@gmail.com> | 2017-07-03 09:37:38 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2017-07-03 09:37:38 +0200 |
commit | 7606448b05d657e4f8bcb56f1830d25ff0b58274 (patch) | |
tree | 244205a8aabfaeaa38ab98072dd19f9f68fe5be8 | |
parent | You can't use beds when there are hostile mobs nearby (diff) | |
download | cuberite-7606448b05d657e4f8bcb56f1830d25ff0b58274.tar cuberite-7606448b05d657e4f8bcb56f1830d25ff0b58274.tar.gz cuberite-7606448b05d657e4f8bcb56f1830d25ff0b58274.tar.bz2 cuberite-7606448b05d657e4f8bcb56f1830d25ff0b58274.tar.lz cuberite-7606448b05d657e4f8bcb56f1830d25ff0b58274.tar.xz cuberite-7606448b05d657e4f8bcb56f1830d25ff0b58274.tar.zst cuberite-7606448b05d657e4f8bcb56f1830d25ff0b58274.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol_1_9.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp index d1b717bd0..5c3be674f 100644 --- a/src/Protocol/Protocol_1_9.cpp +++ b/src/Protocol/Protocol_1_9.cpp @@ -63,6 +63,9 @@ Implements the 1.9 protocol classes: /** The slot number that the client uses to indicate "outside the window". */ static const Int16 SLOT_NUM_OUTSIDE = -999; +/** Value for main hand in Hand parameter for Protocol 1.9. */ +static const UInt32 MAIN_HAND = 0; + @@ -2665,8 +2668,11 @@ void cProtocol_1_9_0::HandlePacketUseEntity(cByteBuffer & a_ByteBuffer) { case 0: { - HANDLE_READ(a_ByteBuffer, ReadVarInt, UInt32, Hand) - m_Client->HandleUseEntity(EntityID, false); + HANDLE_READ(a_ByteBuffer, ReadVarInt, UInt32, Hand); + if (Hand == MAIN_HAND) // TODO: implement handling of off-hand actions; ignore them for now to avoid processing actions twice + { + m_Client->HandleUseEntity(EntityID, false); + } break; } case 1: |