diff options
author | Tim <t4im@users.noreply.github.com> | 2015-03-05 11:14:30 +0100 |
---|---|---|
committer | Tim <t4im@users.noreply.github.com> | 2015-03-11 19:36:41 +0100 |
commit | d167aacf4d2cdcc98914cd05153b81e709e0eaa7 (patch) | |
tree | 5442649cd3416487bfb5e33faa9576884692866f /filter-injector.lua | |
parent | 86ee58b17c2ec9ad303116cf76cfac354cf0f484 (diff) |
add ownership/protection handling for device configuration
take any available ownership into account before deciding on area protection
Diffstat (limited to 'filter-injector.lua')
-rw-r--r-- | filter-injector.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/filter-injector.lua b/filter-injector.lua index 20a9d44..620b7b3 100644 --- a/filter-injector.lua +++ b/filter-injector.lua @@ -181,12 +181,25 @@ for _, data in ipairs({ end, after_dig_node = pipeworks.after_dig, on_receive_fields = function(pos, formname, fields, sender) + if not pipeworks.may_configure(pos, sender) then return end fs_helpers.on_receive_fields(pos, fields) local meta = minetest.get_meta(pos) meta:set_int("slotseq_index", 1) set_filter_formspec(data, meta) set_filter_infotext(data, meta) end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + if not pipeworks.may_configure(pos, player) then return 0 end + return stack:get_count() + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + if not pipeworks.may_configure(pos, player) then return 0 end + return stack:get_count() + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + if not pipeworks.may_configure(pos, player) then return 0 end + return count + end, can_dig = function(pos, player) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() |