summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorchangyong guo <guo1487@163.com>2018-06-24 11:24:10 +0200
committerpeterbell10 <peterbell10@live.co.uk>2018-06-24 11:24:10 +0200
commit2d3013d1d35a2bcba63cffd9012898defff26f93 (patch)
treee344931e67b4094671e01a3bf7dca2d600e32d3e /src/ClientHandle.cpp
parentFlush stdout after resetting console colour. (#4240) (diff)
downloadcuberite-2d3013d1d35a2bcba63cffd9012898defff26f93.tar
cuberite-2d3013d1d35a2bcba63cffd9012898defff26f93.tar.gz
cuberite-2d3013d1d35a2bcba63cffd9012898defff26f93.tar.bz2
cuberite-2d3013d1d35a2bcba63cffd9012898defff26f93.tar.lz
cuberite-2d3013d1d35a2bcba63cffd9012898defff26f93.tar.xz
cuberite-2d3013d1d35a2bcba63cffd9012898defff26f93.tar.zst
cuberite-2d3013d1d35a2bcba63cffd9012898defff26f93.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index a895dd3b3..ff649ea4d 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1188,7 +1188,14 @@ void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, eB
case DIG_STATUS_SWAP_ITEM_IN_HAND:
{
- // TODO: Not yet implemented
+
+ cItem EquippedItem = m_Player->GetEquippedItem();
+ cItem OffhandItem = m_Player->GetOffHandEquipedItem();
+
+ cInventory & Intentory = m_Player->GetInventory();
+ Intentory.SetShieldSlot(EquippedItem);
+ Intentory.SetHotbarSlot(Intentory.GetEquippedSlotNum(), OffhandItem);
+
return;
}