diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua index cc6c201..8cdd678 100644 --- a/mods/default/craftitems.lua +++ b/mods/default/craftitems.lua @@ -1,4 +1,3 @@ - -- -- Crafting items -- @@ -102,6 +101,9 @@ minetest.register_craftitem( on_place = function(itemstack, user, pointed_thing) if pointed_thing.type ~= "node" then return end + local pos_protected = minetest.get_pointed_thing_position(pointed_thing, true) + if minetest.is_protected(pos_protected, user) then return end + itemstack:take_item() local inv=user:get_inventory() @@ -135,6 +137,9 @@ minetest.register_craftitem( on_place = function(itemstack, user, pointed_thing) if pointed_thing.type ~= "node" then return end + local pos_protected = minetest.get_pointed_thing_position(pointed_thing, true) + if minetest.is_protected(pos_protected, user) then return end + itemstack:take_item() local inv=user:get_inventory() @@ -168,6 +173,9 @@ minetest.register_craftitem( on_place = function(itemstack, user, pointed_thing) if pointed_thing.type ~= "node" then return end + local pos_protected = minetest.get_pointed_thing_position(pointed_thing, true) + if minetest.is_protected(pos_protected, user) then return end + itemstack:take_item() local inv=user:get_inventory() @@ -280,4 +288,4 @@ minetest.register_craftitem( end, }) -default.log("craftitems", "loaded") \ No newline at end of file +default.log("craftitems", "loaded")