mirror of
https://github.com/minetest-mods/digtron.git
synced 2025-01-03 09:37:27 +01:00
prevent digging of immortal nodes
This commit is contained in:
parent
5985788181
commit
d4a03478e2
6
util.lua
6
util.lua
@ -45,12 +45,14 @@ digtron.mark_diggable = function(pos, nodes_dug, player)
|
||||
local target = minetest.get_node(pos)
|
||||
|
||||
-- prevent digtrons from being marked for digging.
|
||||
if minetest.get_item_group(target.name, "digtron") ~= 0 or minetest.get_item_group(target.name, "digtron_protected") ~= 0 then
|
||||
if minetest.get_item_group(target.name, "digtron") ~= 0 or
|
||||
minetest.get_item_group(target.name, "digtron_protected") ~= 0 or
|
||||
minetest.get_item_group(target.name, "immortal") ~= 0 then
|
||||
return 0
|
||||
end
|
||||
|
||||
local targetdef = minetest.registered_nodes[target.name]
|
||||
if targetdef == nil or targetdef.can_dig == nil or targetdef.can_dig(pos, player) then
|
||||
if targetdef == nil or targetdef.can_dig == nil or targetdef.can_dig(pos, player) then
|
||||
nodes_dug:set(pos.x, pos.y, pos.z, true)
|
||||
if target.name ~= "air" then
|
||||
local in_known_group = false
|
||||
|
Loading…
Reference in New Issue
Block a user