summaryrefslogtreecommitdiff
path: root/sorting_tubes.lua
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2015-03-05 11:14:30 +0100
committerTim <t4im@users.noreply.github.com>2015-03-11 19:36:41 +0100
commitd167aacf4d2cdcc98914cd05153b81e709e0eaa7 (patch)
tree5442649cd3416487bfb5e33faa9576884692866f /sorting_tubes.lua
parent86ee58b17c2ec9ad303116cf76cfac354cf0f484 (diff)
downloadpipeworks-d167aacf4d2cdcc98914cd05153b81e709e0eaa7.tar
pipeworks-d167aacf4d2cdcc98914cd05153b81e709e0eaa7.tar.gz
pipeworks-d167aacf4d2cdcc98914cd05153b81e709e0eaa7.tar.bz2
pipeworks-d167aacf4d2cdcc98914cd05153b81e709e0eaa7.tar.xz
pipeworks-d167aacf4d2cdcc98914cd05153b81e709e0eaa7.zip
add ownership/protection handling for device configuration
take any available ownership into account before deciding on area protection
Diffstat (limited to 'sorting_tubes.lua')
-rw-r--r--sorting_tubes.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/sorting_tubes.lua b/sorting_tubes.lua
index 8c1d49e..6f47f72 100644
--- a/sorting_tubes.lua
+++ b/sorting_tubes.lua
@@ -91,6 +91,7 @@ if pipeworks.enable_mese_tube then
end,
on_punch = update_formspec,
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)
update_formspec(pos)
end,
@@ -99,6 +100,7 @@ if pipeworks.enable_mese_tube then
return true
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
+ if not pipeworks.may_configure(pos, player) then return 0 end
update_formspec(pos) -- For old tubes
local inv = minetest.get_meta(pos):get_inventory()
local stack_copy = ItemStack(stack)
@@ -107,12 +109,14 @@ if pipeworks.enable_mese_tube then
return 0
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
+ if not pipeworks.may_configure(pos, player) then return 0 end
update_formspec(pos) -- For old tubes
local inv = minetest.get_meta(pos):get_inventory()
inv:set_stack(listname, index, ItemStack(""))
return 0
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
update_formspec(pos) -- For old tubes
local inv = minetest.get_meta(pos):get_inventory()
inv:set_stack(from_list, from_index, ItemStack(""))