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
node arg
- .. do not provide player information --> useful in
can_remove
Request:
- Implement and document
tube.remove_items2(pos, listname, index, stack, player, dir) (where dir is additional)
tube.can_remove2 likewise.
- 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.
Reason:
tube.remove_items(pos, node, stack, dir, count, listname, i)andtube.can_remove(pos, node, stack, dir, listname, i)are currently flawed as they ..nodeargcan_removeRequest:
tube.remove_items2(pos, listname, index, stack, player, dir)(wherediris additional)tube.can_remove2likewise.on_metadata_inventory_take, where this is already done well.I also thought of extending
fakeplayerwith a field to indicate the pipeworks origin, such thatallow_metadata_inventory_takecould be used, however, then there's no direction information, which might be needed in some cases.