Skip to content

Add remove_items2 and can_remove2 as a clean replacements #165

@SmallJoker

Description

@SmallJoker

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 ..

  1. .. have arguments that are ordered differently to the inventory callback API provided by Luanti.
  2. .. have a superfluous node arg
  3. .. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibilityCompatibility with games or other modsenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions