diff options
Diffstat (limited to 'autocrafter.lua')
-rw-r--r-- | autocrafter.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/autocrafter.lua b/autocrafter.lua index 89559ba..3609068 100644 --- a/autocrafter.lua +++ b/autocrafter.lua @@ -266,6 +266,7 @@ minetest.register_node("pipeworks:autocrafter", { update_meta(meta, false) end, on_receive_fields = function(pos, formname, fields, sender) + if not pipeworks.may_configure(pos, sender) then return end local meta = minetest.get_meta(pos) if fields.on then update_meta(meta, false) @@ -290,6 +291,7 @@ minetest.register_node("pipeworks:autocrafter", { autocrafterCache[minetest.hash_node_position(pos)] = nil end, allow_metadata_inventory_put = function(pos, listname, index, stack, player) + if not pipeworks.may_configure(pos, player) then return 0 end upgrade_autocrafter(pos) local inv = minetest.get_meta(pos):get_inventory() if listname == "recipe" then @@ -305,6 +307,10 @@ minetest.register_node("pipeworks:autocrafter", { return stack:get_count() end, allow_metadata_inventory_take = function(pos, listname, index, stack, player) + if not pipeworks.may_configure(pos, player) then + minetest.log("action", string.format("%s attempted to take from autocrafter at %s", player:get_player_name(), minetest.pos_to_string(pos))) + return 0 + end upgrade_autocrafter(pos) local inv = minetest.get_meta(pos):get_inventory() if listname == "recipe" then @@ -319,6 +325,7 @@ minetest.register_node("pipeworks:autocrafter", { 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 upgrade_autocrafter(pos) local inv = minetest.get_meta(pos):get_inventory() local stack = inv:get_stack(from_list, from_index) |