areas icon indicating copy to clipboard operation
areas copied to clipboard

minetest.place_node broken

Open wsor4035 opened this issue 3 years ago • 1 comments

using minetest.place_node in a protected area even when owned by the player does not work at all

wsor4035 avatar Oct 10 '21 20:10 wsor4035

@wsor4035 Does this fix your issue?

diff --git a/api.lua b/api.lua
index e6fe90e..816d687 100644
--- a/api.lua
+++ b/api.lua
@@ -84,6 +84,9 @@ end
 
 -- Checks if the area is unprotected or owned by you
 function areas:canInteract(pos, name)
+       if name == "" then
+               return true -- Mods, namely minetest.item_place_node
+       end
        if minetest.check_player_privs(name, self.adminPrivs) then
                return true
        end

Also keep in mind that minetest.place_node respects buildable_to, whereas minetest.set_node ignores it.

SmallJoker avatar Mar 25 '22 20:03 SmallJoker