diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index aa8fa1fa3a..14184cacd9 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -3797,7 +3797,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 aef7898f25..1c3dadb4cc 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 e660a96a20..7adb61cfc1 100644 --- a/Minecraft.Client/MultiPlayerLocalPlayer.h +++ b/Minecraft.Client/MultiPlayerLocalPlayer.h @@ -35,7 +35,7 @@ class MultiplayerLocalPlayer : public LocalPlayer 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 0f14dfa1f5..1bdbb3d9cf 100644 --- a/Minecraft.Client/Windows64/KeyboardMouseInput.h +++ b/Minecraft.Client/Windows64/KeyboardMouseInput.h @@ -32,6 +32,8 @@ class KeyboardMouseInput static const int KEY_DEBUG_INFO = VK_F3; static const int KEY_DEBUG_MENU = VK_F4; + static const int KEY_CONTROL = VK_CONTROL; + void Init(); void Tick(); void ClearAllState(); diff --git a/README.md b/README.md index 122157ba87..6d6e3234da 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ Minecraft.Client.exe -name Steve -fullscreen - **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`