switch over to using xcompats function

This commit is contained in:
wsor4035 2024-09-08 19:26:36 -04:00
parent 8f796e43af
commit b2e5c81e4d

View File

@ -12,22 +12,7 @@ local default_can_dig = function(pos,player)
return meta:get_inventory():is_empty("main") return meta:get_inventory():is_empty("main")
end end
local default_can_interact_with_node = function(player, pos) local default_can_interact_with_node = xcompat.functions.can_interact_with_node
--if we have default, use it
if default then return default.can_interact_with_node(player, pos) end
local owner = minetest.get_meta(pos):get_string("owner") or ""
--check that we have a valid player
if not player or not player:is_player() then return false end
--check there privs for compat with areas
if minetest.check_player_privs(player, "protection_bypass") then return true end
--if a normal player, check if they are the owner
if owner == "" or owner == player:get_player_name() then return true end
return false
end
local default_inventory_formspecs = { local default_inventory_formspecs = {
["4"]="size[8,6]".. ["4"]="size[8,6]"..