Add protection support to the sonic screwdriver

This commit is contained in:
ShadowNinja 2013-12-10 19:52:40 -05:00
parent 47b0b59884
commit 818a0e5ff0

View File

@ -41,7 +41,9 @@ minetest.register_tool("technic:sonic_screwdriver", {
p = 0 p = 0
end end
end end
-- hacky_swap_node, unforunatly. if minetest.is_protected(pos, user:get_player_name()) then
minetest.record_protection_violation(pos, user:get_player_name())
else
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local meta0 = meta:to_table() local meta0 = meta:to_table()
node.param2 = p node.param2 = p
@ -53,6 +55,7 @@ minetest.register_tool("technic:sonic_screwdriver", {
itemstack:set_metadata(set_item_meta(meta1)) itemstack:set_metadata(set_item_meta(meta1))
technic.set_RE_wear(itemstack, meta1.charge, sonic_screwdriver_max_charge) technic.set_RE_wear(itemstack, meta1.charge, sonic_screwdriver_max_charge)
end end
end
return itemstack return itemstack
end, end,
}) })