minetest.register_node("electricity:lamp_broken", {description = "Lamp (broken)", groups = {cracky = 3}, paramtype2 = "facedir", tiles = {"electricity_lamp_broken.png", "electricity_lamp_broken.png", "electricity_lamp_broken.png", "electricity_lamp_broken.png", "electricity_lamp_broken_connect_side.png", "electricity_lamp_broken_connect_side.png"}})
minetest.register_node("electricity:lamp_off", {description = "Lamp", groups = {conductor = 1, cracky = 3}, on_construct = set_resis(10, 0.10000000000000001), on_destruct = reset_current, paramtype2 = "facedir", tiles = {"electricity_lamp.png", "electricity_lamp.png", "electricity_lamp.png", "electricity_lamp.png", "electricity_lamp_connect_side.png", "electricity_lamp_connect_side.png"}})
minetest.register_node("electricity:lamp_on", {description = "Lamp (active)", groups = {conductor = 1, cracky = 3}, light_source = 14, on_destruct = reset_current, on_timer = reset_consumer("electricity:lamp_on"), paramtype2 = "facedir", tiles = {"electricity_lamp.png", "electricity_lamp.png", "electricity_lamp.png", "electricity_lamp.png", "electricity_lamp_connect_side.png", "electricity_lamp_connect_side.png"}})
local P_e2_82_98_e1_b5_a2_e2_82_99 = 0.29999999999999999
local I_e2_82_98_e2_82_90_e2_82_93 = 1
local function get_sparks_amount()
  return math.random(4, 10)
end
local function spawn_sparks(pos)
  return minetest.add_particlespawner({amount = get_sparks_amount(), collisiondetection = true, glow = 14, maxacc = {x = -1, y = -1, z = -1}, maxexptime = 3, maxpos = pos, maxsize = 0.29999999999999999, maxvel = {x = 5, y = 5, z = 5}, minacc = {x = -2, y = -2, z = -2}, minexptime = 0.5, minpos = pos, minsize = 0.10000000000000001, minvel = {x = -5, y = -5, z = -5}, texture = "electricity_spark.png", time = 0.20000000000000001})
end
local function lamp_burn(pos)
  swap_node(pos, "electricity:lamp_broken")
  return spawn_sparks(pos)
end
local function _0_(pos)
  return swap_node(pos, "electricity:lamp_on")
end
consumers["electricity:lamp_off"] = {["I\226\130\152\226\130\144\226\130\147"] = I_e2_82_98_e2_82_90_e2_82_93, ["P\226\130\152\225\181\162\226\130\153"] = P_e2_82_98_e1_b5_a2_e2_82_99, burn = lamp_burn, on_activate = _0_}
local function _1_(pos)
  return swap_node(pos, "electricity:lamp_off")
end
consumers["electricity:lamp_on"] = {["I\226\130\152\226\130\144\226\130\147"] = I_e2_82_98_e2_82_90_e2_82_93, ["P\226\130\152\225\181\162\226\130\153"] = P_e2_82_98_e1_b5_a2_e2_82_99, burn = lamp_burn, on_deactivate = _1_}
model["electricity:lamp_off"] = consumer
model["electricity:lamp_on"] = consumer
return nil
