diff options
author | Samuel Barney <samjbarney@gmail.com> | 2013-12-02 17:32:28 +0100 |
---|---|---|
committer | Samuel Barney <samjbarney@gmail.com> | 2013-12-02 17:32:28 +0100 |
commit | 050702eaa14180b1821e141203f613d9fc31805f (patch) | |
tree | 8355d713fdc4be9bc0d910b98f9e20bf3131f1ab | |
parent | Removed stray printf. (diff) | |
download | cuberite-050702eaa14180b1821e141203f613d9fc31805f.tar cuberite-050702eaa14180b1821e141203f613d9fc31805f.tar.gz cuberite-050702eaa14180b1821e141203f613d9fc31805f.tar.bz2 cuberite-050702eaa14180b1821e141203f613d9fc31805f.tar.lz cuberite-050702eaa14180b1821e141203f613d9fc31805f.tar.xz cuberite-050702eaa14180b1821e141203f613d9fc31805f.tar.zst cuberite-050702eaa14180b1821e141203f613d9fc31805f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/ClientHandle.cpp | 9 | ||||
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 20 |
2 files changed, 12 insertions, 17 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index f9a48003e..95d8f23e5 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -887,6 +887,15 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, c ) { // Coordinates at CLICKED block, don't move them anywhere + if((ClickedBlockMeta & 0x08) && (a_BlockFace == BLOCK_FACE_TOP)) + { + ++a_BlockY; + } + else if (!(ClickedBlockMeta & 0x08) && (a_BlockFace == BLOCK_FACE_BOTTOM)) + { + --a_BlockY; + } + World->GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, ClickedBlock, ClickedBlockMeta); } else { diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index fdebdbbb1..2704a4393 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -1152,27 +1152,13 @@ void cProtocol172::HandlePacketBlockPlace(UInt32 a_RemainingBytes) HANDLE_READ(ReadByte, Byte, BlockY); HANDLE_READ(ReadBEInt, int, BlockZ); HANDLE_READ(ReadByte, Byte, Face); - HANDLE_READ(ReadBEShort, short, ItemID); - - // Currently discarding extra info until it is decided what we do with it - if (ItemID != -1) - { - HANDLE_READ(ReadByte, Byte, Count); - HANDLE_READ(ReadBEShort, short, ItemDamage); - HANDLE_READ(ReadBEShort, short, MetaLen); - if (MetaLen != -1) - { - while(MetaLen--) - { - HANDLE_READ(ReadByte, Byte, MetaStuff); - } - } - - } + cItem Item; + ReadItem(Item); HANDLE_READ(ReadByte, Byte, CursorX); HANDLE_READ(ReadByte, Byte, CursorY); HANDLE_READ(ReadByte, Byte, CursorZ); + printf("Cursor: %i %i %i\n", CursorX, CursorY, CursorZ); m_Client->HandleRightClick(BlockX, BlockY, BlockZ, Face, CursorX, CursorY, CursorZ, m_Client->GetPlayer()->GetEquippedItem()); } |