Skip to content

fix swap and drop for oversized slots#194

Open
romanfedyniak wants to merge 1 commit into
CleanroomMC:masterfrom
romanfedyniak:master
Open

fix swap and drop for oversized slots#194
romanfedyniak wants to merge 1 commit into
CleanroomMC:masterfrom
romanfedyniak:master

Conversation

@romanfedyniak
Copy link
Copy Markdown

Previously, actions like dropping items (CTRL+Q) and hotbar swapping (number keys 1-9) completely ignored getMaxStackSize() and slot limits. This allowed players to move entire oversized stacks into standard inventories or drop them into the world with values exceeding normal limits.

Changes Made

  • Fixed CTRL+Q: Intercepted item drops from oversized slots to properly respect vanilla limits.
    • CTRL+Q now drops a maximum of one vanilla stack (e.g., 64 for stone, 1 for tools) per action.
  • Fixed Hotbar keys 1-9: Intercepted number key swaps to enforce slot limits when interacting with oversized slots.
    • Same items: Safely merges the stack up to the target slot's getItemStackLimit.
    • Different items: Swaps only if both stacks safely fit within the limits of their respective new slots. Otherwise, handles partial moves to empty slots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant