diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index d04bdc785..50220652e 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -3816,7 +3816,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures) if((player->ullButtonsPressed&(1LL<isInputAllowed(MINECRAFT_ACTION_DROP)) { - player->drop(); + bool ctrlHeld = g_KBMInput.IsKBMActive() && g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_CONTROL); + player->drop(ctrlHeld); } uint64_t ullButtonsPressed=player->ullButtonsPressed; diff --git a/Minecraft.Client/MultiPlayerLocalPlayer.cpp b/Minecraft.Client/MultiPlayerLocalPlayer.cpp index bf1135d56..aa7ed9dd3 100644 --- a/Minecraft.Client/MultiPlayerLocalPlayer.cpp +++ b/Minecraft.Client/MultiPlayerLocalPlayer.cpp @@ -173,9 +173,13 @@ void MultiplayerLocalPlayer::sendPosition() } -shared_ptr MultiplayerLocalPlayer::drop() +shared_ptr MultiplayerLocalPlayer::drop(bool dropAll) { - connection->send(std::make_shared(PlayerActionPacket::DROP_ITEM, 0, 0, 0, 0)); + int action = dropAll ? + PlayerActionPacket::DROP_ALL_ITEMS : + PlayerActionPacket::DROP_ITEM; + + connection->send(std::make_shared(action, 0, 0, 0, 0)); return nullptr; } diff --git a/Minecraft.Client/MultiPlayerLocalPlayer.h b/Minecraft.Client/MultiPlayerLocalPlayer.h index 14b0bf429..e78711543 100644 --- a/Minecraft.Client/MultiPlayerLocalPlayer.h +++ b/Minecraft.Client/MultiPlayerLocalPlayer.h @@ -35,7 +35,7 @@ public: void sendPosition(); using Player::drop; - virtual shared_ptr drop(); + virtual shared_ptr drop(bool dropStack = false); protected: virtual void reallyDrop(shared_ptr itemEntity); public: diff --git a/Minecraft.Client/Windows64/KeyboardMouseInput.h b/Minecraft.Client/Windows64/KeyboardMouseInput.h index 9b25c929d..505d804e4 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.h +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.h @@ -38,6 +38,8 @@ public: static const int KEY_FULLSCREEN = VK_F11; static const int KEY_SCREENSHOT = VK_F2; + static const int KEY_CONTROL = VK_CONTROL; + void Init(); void Tick(); void ClearAllState(); diff --git a/README.md b/README.md index 560a798a5..46c2c5b90 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ If you're looking for Dedicated Server software, download its [Nightly Build her - **Inventory**: `E` - **Chat**: `T` - **Drop Item**: `Q` +- **Drop Stack**: `Ctrl` + `Q` - **Crafting**: `C` Use `Q` and `E` to move through tabs (cycles Left/Right) - **Toggle View (FPS/TPS)**: `F5` - **Fullscreen**: `F11`