diff options
Diffstat (limited to 'builtin/game/item.lua')
-rw-r--r-- | builtin/game/item.lua | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua index ced28771e..8041d557e 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -206,7 +206,6 @@ function core.get_node_drops(node, toolname) -- Extended drop table local got_items = {} local got_count = 0 - local _, item, tool for _, item in ipairs(drop.items) do local good_rarity = true local good_tool = true @@ -251,11 +250,6 @@ local function user_name(user) return user and user:get_player_name() or "" end -local function is_protected(pos, name) - return core.is_protected(pos, name) and - not minetest.check_player_privs(name, "protection_bypass") -end - -- Returns a logging function. For empty names, does not log. local function make_log(name) return name ~= "" and core.log or function() end @@ -302,7 +296,7 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2, place_to = {x = under.x, y = under.y, z = under.z} end - if is_protected(place_to, playername) then + if core.is_protected(place_to, playername) then log("action", playername .. " tried to place " .. def.name .. " at protected position " @@ -552,7 +546,7 @@ function core.node_dig(pos, node, digger) return end - if is_protected(pos, diggername) then + if core.is_protected(pos, diggername) then log("action", diggername .. " tried to dig " .. node.name .. " at protected position " @@ -619,15 +613,10 @@ function core.node_dig(pos, node, digger) end -- Run script hook - local _, callback for _, callback in ipairs(core.registered_on_dignodes) do local origin = core.callback_origins[callback] if origin then core.set_last_run_mod(origin.mod) - --print("Running " .. tostring(callback) .. - -- " (a " .. origin.name .. " callback in " .. origin.mod .. ")") - else - --print("No data associated with callback") end -- Copy pos and node because callback can modify them |