Add `remove_items2` and `can_remove2` as a clean replacements
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 20
- Forks
- 31
- Avg merge
- 1m
- Merged PRs (30d)
- 9
Description
Reason: tube.remove_items(pos, node, stack, dir, count, listname, i) and tube.can_remove(pos, node, stack, dir, listname, i) are currently flawed as they ..
- .. have arguments that are ordered differently to the inventory callback API provided by Luanti.
- .. have a superfluous
nodearg - .. do not provide player information --> useful in
can_remove
Request:
- Implement and document
tube.remove_items2(pos, listname, index, stack, player, dir)(wherediris additional) tube.can_remove2likewise.- The returned stack should be removed by pipeworks and not the callback. Compare with
on_metadata_inventory_take, where this is already done well.
I also thought of extending fakeplayer with a field to indicate the pipeworks origin, such that allow_metadata_inventory_take could be used, however, then there's no direction information, which might be needed in some cases.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing tube.remove_items and tube.can_remove callbacks, then compare their argument handling with on_metadata_inventory_take. Implement and document the remove_items2 and can_remove2 interfaces described in the issue, including player and direction information. Done means the returned stack is removed by pipeworks rather than by the callback, with the documented signatures available to tube users.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100