* 'main' of https://codeberg.org/piebot/LegacyEvolved:
  feat: Ctrl+Q to drop all stack
This commit is contained in:
Lord_Cambion 2026-04-02 14:45:51 +02:00
commit 128a862b92
4 changed files with 10 additions and 5 deletions

View file

@ -3882,7 +3882,8 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_DROP)) && gameMode->isInputAllowed(MINECRAFT_ACTION_DROP)) if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_DROP)) && gameMode->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; uint64_t ullButtonsPressed=player->ullButtonsPressed;

View file

@ -173,9 +173,12 @@ void MultiplayerLocalPlayer::sendPosition()
} }
shared_ptr<ItemEntity> MultiplayerLocalPlayer::drop() shared_ptr<ItemEntity> MultiplayerLocalPlayer::drop(bool dropAll)
{ {
connection->send(std::make_shared<PlayerActionPacket>(PlayerActionPacket::DROP_ITEM, 0, 0, 0, 0)); int action = dropAll ?
PlayerActionPacket::DROP_ALL_ITEMS :
PlayerActionPacket::DROP_ITEM;
connection->send(std::make_shared<PlayerActionPacket>(action, 0, 0, 0, 0));
return nullptr; return nullptr;
} }

View file

@ -35,7 +35,7 @@ public:
void sendPosition(); void sendPosition();
using Player::drop; using Player::drop;
virtual shared_ptr<ItemEntity> drop(); virtual shared_ptr<ItemEntity> drop(bool dropStack = false);
protected: protected:
virtual void reallyDrop(shared_ptr<ItemEntity> itemEntity); virtual void reallyDrop(shared_ptr<ItemEntity> itemEntity);
public: public:

View file

@ -32,6 +32,7 @@ public:
static const int KEY_TOGGLE_HUD = VK_F1; static const int KEY_TOGGLE_HUD = VK_F1;
static const int KEY_DEBUG_INFO = VK_F3; static const int KEY_DEBUG_INFO = VK_F3;
static const int KEY_DEBUG_MENU = VK_F4; static const int KEY_DEBUG_MENU = VK_F4;
static const int KEY_CONTROL = VK_CONTROL;
static const int KEY_THIRD_PERSON = VK_F5; static const int KEY_THIRD_PERSON = VK_F5;
static const int KEY_DEBUG_CONSOLE = VK_F6; static const int KEY_DEBUG_CONSOLE = VK_F6;
static const int KEY_HOST_SETTINGS = VK_TAB; static const int KEY_HOST_SETTINGS = VK_TAB;