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:
parent
28b78f7dce
commit
5dc95a91c4
@ -13,3 +13,4 @@ include('burnup')
|
||||
include('pulverize')
|
||||
include('throw_inertia')
|
||||
include('hints')
|
||||
include('protect')
|
||||
|
15
mods/nc_items/protect.lua
Normal file
15
mods/nc_items/protect.lua
Normal 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)
|
Loading…
x
Reference in New Issue
Block a user