Skip to content

Enhance DropCommand to support item quantity#5664

Merged
Wide-Cat merged 3 commits into
MeteorDevelopment:masterfrom
IExploitableMan:drop-amount
Oct 9, 2025
Merged

Enhance DropCommand to support item quantity#5664
Wide-Cat merged 3 commits into
MeteorDevelopment:masterfrom
IExploitableMan:drop-amount

Conversation

@IExploitableMan

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix
  • New feature

Description

The DropCommand now supports an optional amount argument, allowing players to drop a specific number of items instead of entire stacks. The dropping logic was refactored into a dedicated dropItem method for cleaner structure, and InvUtils gained a dropOne helper to handle single-item drops.

Related issues

Closes #4222

How Has This Been Tested?

out.mp4

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@IExploitableMan

Copy link
Copy Markdown
Contributor Author

I'm not sure how to handle cases where amount is greater than items in inventory

@I-No-oNe

Copy link
Copy Markdown

I'm not sure how to handle cases where amount is greater than items in inventory

Just send a message using error() that says that you can only drop the amount u have on the inv

@IExploitableMan

Copy link
Copy Markdown
Contributor Author

I'm not sure how to handle cases where amount is greater than items in inventory

Just send a message using error() that says that you can only drop the amount u have on the inv

I've thought about it, but maybe it's better to warn that fewer items were dropped than were specified

@I-No-oNe

Copy link
Copy Markdown

I don't think that will be a good implantation
You want the user to have as much as possible control, so making the inv-drop happen even when the right amount hasn't been specified isn't a good idea

@Wide-Cat

Copy link
Copy Markdown
Collaborator

I'm not sure about the command erroring if you don't have enough items. Even ignoring a bug it created, I feel like it would create more frustration if you want to drop so many items and the command fails because you are slightly underneath it - it would be smoother if it executed anyway and dropped what it could. I am happy to hear arguments against this though.

@IExploitableMan

Copy link
Copy Markdown
Contributor Author

I'm not sure about the command erroring if you don't have enough items. Even ignoring a bug it created, I feel like it would create more frustration if you want to drop so many items and the command fails because you are slightly underneath it - it would be smoother if it executed anyway and dropped what it could. I am happy to hear arguments against this though.

I agree with giving warnings, but could you clarify which bug you're talking about?

@Wide-Cat

Copy link
Copy Markdown
Collaborator

if you wanted to drop all of an item it would always fail, because the command passed in Integer.MAX_VALUE to the drop method and you always have less than that of an item

@Wide-Cat Wide-Cat merged commit ffe3708 into MeteorDevelopment:master Oct 9, 2025
1 check passed
chri-k added a commit to chri-k/meteor-client that referenced this pull request Nov 15, 2025
MistressOfDNS pushed a commit to MistressOfDNS/meteor-client-fork that referenced this pull request May 7, 2026
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.

.drop

3 participants