--]]
+local function on_flood(pos, oldnode, newnode)
+ minetest.add_item(pos, ItemStack("default:torch 1"))
+ -- Play flame-extinguish sound if liquid is not an 'igniter'
+ local nodedef = minetest.registered_items[newnode.name]
+ if not (nodedef and nodedef.groups and
+ nodedef.groups.igniter and nodedef.groups.igniter > 0) then
+ minetest.sound_play(
+ "default_cool_lava",
+ {pos = pos, max_hear_distance = 16, gain = 0.1}
+ )
+ end
+ -- Remove the torch node
+ return false
+end
+
minetest.register_node("default:torch", {
description = "Torch",
drawtype = "mesh",
itemstack:set_name("default:torch")
return itemstack
- end
+ end,
+ floodable = true,
+ on_flood = on_flood,
})
minetest.register_node("default:torch_wall", {
wall_side = {-1/2, -1/2, -1/8, -1/8, 1/8, 1/8},
},
sounds = default.node_sound_wood_defaults(),
+ floodable = true,
+ on_flood = on_flood,
})
minetest.register_node("default:torch_ceiling", {
wall_top = {-1/8, -1/16, -5/16, 1/8, 1/2, 1/8},
},
sounds = default.node_sound_wood_defaults(),
+ floodable = true,
+ on_flood = on_flood,
})
minetest.register_lbm({