Add fill all and empty all container actions #7837
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces two new actions for containers: fill all and empty all.
It also changes the default behavior of normal rightclick and leftclick of containers in terminals. The old implementation tried to insert and extract as much as possible and was only limited by the insertion/extraction limit set by the respective handlers of other mods. Basic Mekanism tanks for example only allowed 1 bucket per operation.
The new implementation follows the same approach but tries to insert/extract a bucket at most when leftclicking or rightclicking.
The new feature makes use of the shift key. If you shift-leftclick with a container on a fluid, it will try to fill the whole container. If a container doesn't allow to fill itself at once, the implementation will iterate to repeat the operation. It's limited to 10k iterations tho which is unlikely to happen.
Shift-rightclick allows the opposite and will try to empty the whole container at once.
This pull request covers some of the features requested in issue #3782
It does not implement the filling of stacked items tho.
Let me know if changes are required by submitting a review.