add protection support

This commit is contained in:
Dirk Sohler 2020-02-09 01:16:19 +01:00
parent d295e5f012
commit a0502007a3
No known key found for this signature in database
GPG Key ID: B9751241BD7D4E1A

@ -49,6 +49,12 @@ uniham.crush_nodes = function (itemstack, player, pointed_thing)
local node_pos = minetest.get_pointed_thing_position(pointed_thing) local node_pos = minetest.get_pointed_thing_position(pointed_thing)
local node_name = minetest.get_node(node_pos).name local node_name = minetest.get_node(node_pos).name
local node_sound = get_sound(minetest.registered_nodes[node_name], 'dug') local node_sound = get_sound(minetest.registered_nodes[node_name], 'dug')
local player_name = player:get_player_name()
if minetest.is_protected(node_pos, player_name) then
minetest.record_protection_violation(node_pos, player_name)
return
end
if not replacements[node_name] then if not replacements[node_name] then
if node_sound then if node_sound then