diff --git a/protect.lua b/protect.lua index 9c3a604..50a23d4 100644 --- a/protect.lua +++ b/protect.lua @@ -58,16 +58,17 @@ function minetest.item_place_node(itemstack, placer, pointed_thing, ...) local pos = nodecore.buildable_to(pointed_thing.under) and pointed_thing.under or pointed_thing.above local name = placer and placer:is_player() and placer:get_player_name() - if pos and name and check(pos, itemstack:get_name(), name) then return itemstack end + if pos and name and check(pos, itemstack:get_name(), name) then + minetest.record_protection_violation(pos, name) + return itemstack + end return old_place(itemstack, placer, pointed_thing, ...) end -- Search for special-case nodes like totes that have custom place logic. local function placedone(...) placing = nil return ... end local function checkdef(name, def) - minetest.log(name) if not (def.on_place and match(name)) then return end - minetest.log("MATCH!!!!!") local oldp = def.on_place rawset(def, "on_place", function(...) placing = name