@@ -237,8 +237,9 @@ minetest.register_node("digtron:auto_controller", {
237
237
inv :set_size (" stop" , 1 )
238
238
end ,
239
239
240
- allow_metadata_inventory_put = function (pos , listname , index , stack )
241
- if minetest .get_item_group (stack :get_name (), " digtron" ) ~= 0 then
240
+ allow_metadata_inventory_put = function (pos , listname , index , stack , player )
241
+ if digtron .check_protected_and_record (pos , player )
242
+ or minetest .get_item_group (stack :get_name (), " digtron" ) ~= 0 then
242
243
return 0 -- pointless setting a Digtron node as a stop block
243
244
end
244
245
node_inventory_table .pos = pos
@@ -247,10 +248,12 @@ minetest.register_node("digtron:auto_controller", {
247
248
return 0
248
249
end ,
249
250
250
- allow_metadata_inventory_take = function (pos , listname , index )
251
- node_inventory_table .pos = pos
252
- local inv = minetest .get_inventory (node_inventory_table )
253
- inv :set_stack (listname , index , ItemStack (" " ))
251
+ allow_metadata_inventory_take = function (pos , listname , index , _ , player )
252
+ if not digtron .check_protected_and_record (pos , player ) then
253
+ node_inventory_table .pos = pos
254
+ local inv = minetest .get_inventory (node_inventory_table )
255
+ inv :set_stack (listname , index , ItemStack (" " ))
256
+ end
254
257
return 0
255
258
end ,
256
259
0 commit comments