Unprotect item stack nodes

This prevents a problem where players
can drop items into other players'
protected areas but cannot dig them.

Other solutions to prevent players from
placing items into protected areas in the
first place may be possible, and may still
be explored, but are not foolproof and so
this acts as a fallback at least.
This commit is contained in:
Aaron Suen 2021-03-20 08:02:33 -04:00
parent 28b78f7dce
commit 5dc95a91c4
2 changed files with 16 additions and 0 deletions

View File

@ -13,3 +13,4 @@ include('burnup')
include('pulverize')
include('throw_inertia')
include('hints')
include('protect')

15
mods/nc_items/protect.lua Normal file
View File

@ -0,0 +1,15 @@
-- LUALOCALS < ---------------------------------------------------------
local minetest
= minetest
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
minetest.after(0, function()
local prot = minetest.is_protected
function minetest.is_protected(pos, name, ...)
local node = minetest.get_node(pos)
if node.name == modname .. ":stack" then return false end
return prot(pos, name, ...)
end
end)