From 994592d01ff1252a12933724a0c8df0ed6a73f59 Mon Sep 17 00:00:00 2001 From: ethxn <163630159+ethxnblxd@users.noreply.github.com> Date: Tue, 17 Mar 2026 18:18:25 +0800 Subject: [PATCH] Add files via upload --- Minecraft.Client/Minecraft.cpp | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/Minecraft.Client/Minecraft.cpp b/Minecraft.Client/Minecraft.cpp index 01ff3e937..9afa7f234 100644 --- a/Minecraft.Client/Minecraft.cpp +++ b/Minecraft.Client/Minecraft.cpp @@ -1513,15 +1513,21 @@ void Minecraft::run_middle() } } - - // CHANGED FROM IsKeyPressed SO YOU CAN HOLD TO DROP (after 0.3 sec delay). + static bool wasDown = false; static std::chrono::steady_clock::time_point pressTime; bool down = g_KBMInput.IsKeyDown(KeyboardMouseInput::KEY_DROP); - if (down) + if (g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_DROP) && g_KBMInput.IsKeyDown(VK_CONTROL)) + // TO DROP A STACK + { + localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_DROPALL; + } + + else if (down) + // CHANGED FROM IsKeyPressed SO YOU CAN HOLD TO DROP (after 0.3 sec delay). { auto now = std::chrono::steady_clock::now(); @@ -1536,18 +1542,14 @@ void Minecraft::run_middle() float held = std::chrono::duration(now - pressTime).count(); if (held > 0.3f) + { localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_DROP; + } } } wasDown = down; - // TO DROP A STACK - - if (g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_DROP) && g_KBMInput.IsKeyDown(VK_CONTROL)) - { - localplayers[i]->ullButtonsPressed |= 1LL << MINECRAFT_ACTION_DROPALL; - } if(g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING) || g_KBMInput.IsKeyPressed(KeyboardMouseInput::KEY_CRAFTING_ALT)) { @@ -1561,12 +1563,17 @@ void Minecraft::run_middle() } } - for (int slot = 0; slot < 9; slot++) + // PREVENTS SWITCHING HOTBAR SLOTS WHEN IN MENUS + + if (!ui.GetMenuDisplayed(0)) { - if (g_KBMInput.IsKeyPressed('1' + slot)) + for (int slot = 0; slot < 9; slot++) { - if (localplayers[i]->inventory) - localplayers[i]->inventory->selected = slot; + if (g_KBMInput.IsKeyPressed('1' + slot)) + { + if (localplayers[i]->inventory) + localplayers[i]->inventory->selected = slot; + } } } }