diff --git a/init.lua b/init.lua index 42e7005..2711a12 100644 --- a/init.lua +++ b/init.lua @@ -61,7 +61,8 @@ minetest.register_node("industrial_decor:lamp",{ minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_damaged"}) end }) - + +--Damaged minetest.register_node("industrial_decor:lamp_damaged",{ description = "Damaged Industrial Lamp", drawtype = "plantlike", @@ -79,27 +80,82 @@ minetest.register_node("industrial_decor:lamp_damaged",{ type = "fixed", fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, }, + + on_rightclick = function(pos, node, player, pointed_thing) + if player:get_wielded_item():get_name() == "electronics:light_bulb_incandescent" then + minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_bulb"}) + elseif player:get_wielded_item():get_name() == "tapes:ducttape_black" then + minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_tape"}) + end + + end }) - minetest.register_node("industrial_decor:wires_hanging",{ - description = "Hanging Wires", +--Light Bulb Only +minetest.register_node("industrial_decor:lamp_bulb",{ + description = "Damaged Industrial Lamp with Light Bulb", drawtype = "plantlike", - tiles = {"industrial_decor_wires_hanging.png"}, - inventory_image = "industrial_decor_wires_hanging.png", - wield_image = "industrial_decor_wires_hanging.png", + tiles = { + { + name = "industrial_decor_lamp_bulb.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + }, + }, + }, + inventory_image = "industrial_decor_lamp_bulb_single.png", + wield_image = "industrial_decor_lamp_bulb_single.png", light_propagates = true, sunlight_propagates = true, paramtype = "light", is_ground_content = false, walkable = false, - groups = {snappy = 3}, + groups = {cracky = 2}, selection_box = { type = "fixed", fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, }, + + on_rightclick = function(pos, node, player, pointed_thing) + if player:get_wielded_item():get_name() == "tapes:ducttape_black" then + minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_fixed"}) + end + + end }) +--Taped +minetest.register_node("industrial_decor:lamp_tape",{ + description = "Industrial Lamp with Duct Tape", + drawtype = "plantlike", + tiles = {"industrial_decor_lamp_tape.png"}, + inventory_image = "industrial_decor_lamp_tape.png", + wield_image = "industrial_decor_lamp_bulb_tape.png", + light_propagates = true, + sunlight_propagates = true, + paramtype = "light", + is_ground_content = false, + walkable = false, + + groups = {cracky = 2}, + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, + }, + + on_rightclick = function(pos, node, player, pointed_thing) + if player:get_wielded_item():get_name() == "electronics:light_bulb_incandescent" then + minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_fixed"}) + end + + end + }) + +--Fixed minetest.register_node("industrial_decor:lamp_fixed",{ description = "Fixed Industrial Lamp", drawtype = "plantlike", @@ -122,6 +178,26 @@ minetest.register_node("industrial_decor:lamp_fixed",{ minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "industrial_decor:lamp_damaged"}) end }) + --End of Lamps + + minetest.register_node("industrial_decor:wires_hanging",{ + description = "Hanging Wires", + drawtype = "plantlike", + tiles = {"industrial_decor_wires_hanging.png"}, + inventory_image = "industrial_decor_wires_hanging.png", + wield_image = "industrial_decor_wires_hanging.png", + light_propagates = true, + sunlight_propagates = true, + paramtype = "light", + is_ground_content = false, + walkable = false, + + groups = {snappy = 3}, + selection_box = { + type = "fixed", + fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16}, + }, + }) minetest.register_node("industrial_decor:sheet_tin",{ description = "Industrial Tin Sheet", diff --git a/textures/industrial_decor_lamp_bulb.png b/textures/industrial_decor_lamp_bulb.png new file mode 100644 index 0000000..8280139 Binary files /dev/null and b/textures/industrial_decor_lamp_bulb.png differ diff --git a/textures/industrial_decor_lamp_bulb_single.png b/textures/industrial_decor_lamp_bulb_single.png new file mode 100644 index 0000000..90777f5 Binary files /dev/null and b/textures/industrial_decor_lamp_bulb_single.png differ diff --git a/textures/industrial_decor_lamp_tape.png b/textures/industrial_decor_lamp_tape.png new file mode 100644 index 0000000..a043b13 Binary files /dev/null and b/textures/industrial_decor_lamp_tape.png differ