1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-04 17:40:26 +01:00

callback for torches in water

This commit is contained in:
crabman77 2015-03-03 00:19:08 +01:00
parent 3a9f112a0f
commit 639584ec06

View File

@ -426,3 +426,13 @@ minetest.register_abm({
})
end -- Ends: if minetest.setting_getbool("leaf_decay") ~= false
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
if newnode.name ~= "default:torch" or minetest.get_item_group(oldnode.name, "water") == 0 then
return
end
minetest.remove_node(pos, newnode)
minetest.set_node(pos, oldnode)
minetest.add_item(pos, "default:torch")
end)