2015-04-15 06:12:34 +02:00
|
|
|
local lavalamps_list = {
|
|
|
|
{ "Red Lava Lamp", "red"},
|
2016-12-15 22:23:31 +01:00
|
|
|
{ "Orange Lava Lamp", "orange"},
|
2015-04-15 06:12:34 +02:00
|
|
|
{ "Yellow Lava Lamp", "yellow"},
|
|
|
|
{ "Green Lava Lamp", "green"},
|
|
|
|
{ "Blue Lava Lamp", "blue"},
|
|
|
|
{ "Violet Lava Lamp", "violet"},
|
|
|
|
}
|
|
|
|
|
|
|
|
for i in ipairs(lavalamps_list) do
|
|
|
|
local lavalampdesc = lavalamps_list[i][1]
|
|
|
|
local colour = lavalamps_list[i][2]
|
|
|
|
|
|
|
|
minetest.register_node("lavalamp:"..colour, {
|
|
|
|
description = lavalampdesc,
|
2015-04-15 06:54:27 +02:00
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "lavalamp.obj",
|
2015-04-15 06:12:34 +02:00
|
|
|
tiles = {
|
2015-04-15 06:54:27 +02:00
|
|
|
"lavalamp_metal.png",
|
2015-04-15 06:12:34 +02:00
|
|
|
{
|
|
|
|
name="lavalamp_lamp_anim_"..colour..".png",
|
|
|
|
animation={
|
|
|
|
type="vertical_frames",
|
|
|
|
aspect_w=40,
|
|
|
|
aspect_h=40,
|
2015-04-15 06:54:27 +02:00
|
|
|
length=6.0,
|
2015-04-15 06:12:34 +02:00
|
|
|
},
|
|
|
|
},
|
2015-04-15 09:49:59 +02:00
|
|
|
},
|
|
|
|
inventory_image = "lavalamp_lamp_"..colour.."_inv.png",
|
2015-04-15 06:12:34 +02:00
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
sunlight_propagates = true,
|
|
|
|
walkable = false,
|
|
|
|
light_source = 14,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 },
|
|
|
|
},
|
|
|
|
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
|
2015-04-29 14:14:36 +02:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
2016-07-31 01:17:23 +02:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2015-04-15 06:12:34 +02:00
|
|
|
node.name = "lavalamp:"..colour.."_off"
|
|
|
|
minetest.set_node(pos, node)
|
2016-07-31 01:17:23 +02:00
|
|
|
return itemstack
|
2015-04-15 06:12:34 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("lavalamp:"..colour.."_off", {
|
|
|
|
description = lavalampdesc.." off",
|
2015-04-15 06:54:27 +02:00
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "lavalamp.obj",
|
2015-04-15 06:12:34 +02:00
|
|
|
tiles = {
|
2015-04-15 06:54:27 +02:00
|
|
|
"lavalamp_metal.png",
|
|
|
|
"lavalamp_lamp_off.png",
|
2016-12-15 22:23:31 +01:00
|
|
|
},
|
2015-04-15 06:12:34 +02:00
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
sunlight_propagates = true,
|
|
|
|
walkable = false,
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, -0.5, -0.25, 0.25,0.5, 0.25 },
|
|
|
|
},
|
2015-04-15 09:27:11 +02:00
|
|
|
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3, not_in_creative_inventory=1},
|
2015-04-29 14:14:36 +02:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
drop = "lavalamp:"..colour,
|
2016-07-31 01:17:23 +02:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2015-04-15 06:12:34 +02:00
|
|
|
node.name = "lavalamp:"..colour
|
|
|
|
minetest.set_node(pos, node)
|
2016-07-31 01:17:23 +02:00
|
|
|
return itemstack
|
2015-04-15 06:12:34 +02:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "lavalamp:"..colour,
|
|
|
|
recipe = {
|
|
|
|
{"", "wool:"..colour, "", },
|
|
|
|
{"", "bucket:bucket_water", "", },
|
|
|
|
{"", "wool:black", "", }
|
|
|
|
}
|
|
|
|
})
|
2016-12-15 22:23:31 +01:00
|
|
|
|
2015-04-15 06:12:34 +02:00
|
|
|
end
|