forked from nalc/homedecor_modpack
switch over to using xcompats function
This commit is contained in:
parent
8f796e43af
commit
b2e5c81e4d
|
@ -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]"..
|
||||||
|
|
Loading…
Reference in New Issue
Block a user