Skip to content

Commit

Permalink
switch over to using xcompats function
Browse files Browse the repository at this point in the history
  • Loading branch information
wsor4035 committed Sep 8, 2024
1 parent 8f796e4 commit b2e5c81
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions homedecor_common/inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,7 @@ local default_can_dig = function(pos,player)
return meta:get_inventory():is_empty("main")
end

local default_can_interact_with_node = function(player, pos)
--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_can_interact_with_node = xcompat.functions.can_interact_with_node

local default_inventory_formspecs = {
["4"]="size[8,6]"..
Expand Down

0 comments on commit b2e5c81

Please sign in to comment.