diff --git a/lavalamp/README.txt b/lavalamp/README.txt new file mode 100644 index 00000000..c192e25d --- /dev/null +++ b/lavalamp/README.txt @@ -0,0 +1,42 @@ +Lava Lamps (lavalamp) mod for Minetest + + +by thefamilygrog66 + +Description: +Coloured Lava Lamps, loosely based on Tonyka's wall torches from the 3dforniture/homedecor mod. There are 6 colours in all: red, orange, yellow, green, blue, violet. + +After placing a lava lamp, the player can turn it off/on again by right-clicking on it. + +Recipe: + ++---------------+ +| coloured wool | ++---------------+ +| water bucket | ++---------------+ +| black wool | ++---------------+ + +Mod dependencies: wool, bucket + +License: +Sourcecode: WTFPL (see below) +Graphics: WTFPL (see below) + +See also: +http://minetest.net/ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/lavalamp/depends.txt b/lavalamp/depends.txt new file mode 100644 index 00000000..29a8e95c --- /dev/null +++ b/lavalamp/depends.txt @@ -0,0 +1,2 @@ +wool +bucket \ No newline at end of file diff --git a/lavalamp/init.lua b/lavalamp/init.lua new file mode 100644 index 00000000..c1fb485a --- /dev/null +++ b/lavalamp/init.lua @@ -0,0 +1,118 @@ +local lavalamps_list = { + { "Red Lava Lamp", "red"}, + { "Orange Lava Lamp", "orange"}, + { "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, + drawtype = "nodebox", + tiles = { + "lavalamp_lamp_top.png", + "lavalamp_lamp_bottom.png", + { + name="lavalamp_lamp_anim_"..colour..".png", + animation={ + type="vertical_frames", + aspect_w=40, + aspect_h=40, + length=3.0, + }, + }, + }, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + -- base + { -0.1875, -0.5, -0.1875, 0.1875, -0.3125, 0.1875, }, + { -0.125, -0.5, -0.25, 0.125, -0.3125, -0.1875, }, + { -0.25, -0.5, -0.125, -0.1875, -0.3125, 0.125, }, + { 0.1875, -0.5, -0.125, 0.25, -0.3125, 0.125, }, + { -0.125, -0.5, 0.1875, 0.125, -0.3125, 0.25, }, + -- lamp + { -0.125, -0.3125, -0.125, 0.125, 0.5, 0.125, }, + { -0.0625, -0.3125, -0.1875, 0.0625, 0.5, -0.125, }, + { -0.0625, -0.3125, 0.125, 0.0625, 0.5, 0.1875, }, + { -0.1875, -0.3125, -0.0625, 0.125, 0.5, 0.0625, }, + { 0.125, -0.3125, -0.0625, 0.1875, 0.5, 0.0625, }, + }, + }, + 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}, + on_rightclick = function(pos, node, clicker) + node.name = "lavalamp:"..colour.."_off" + minetest.set_node(pos, node) + end, + }) + + minetest.register_node("lavalamp:"..colour.."_off", { + description = lavalampdesc.." off", + drawtype = "nodebox", + tiles = { + "lavalamp_lamp_top.png", + "lavalamp_lamp_bottom.png", + "lavalamp_lamp_off_sides.png", + }, + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + -- base + { -0.1875, -0.5, -0.1875, 0.1875, -0.3125, 0.1875, }, + { -0.125, -0.5, -0.25, 0.125, -0.3125, -0.1875, }, + { -0.25, -0.5, -0.125, -0.1875, -0.3125, 0.125, }, + { 0.1875, -0.5, -0.125, 0.25, -0.3125, 0.125, }, + { -0.125, -0.5, 0.1875, 0.125, -0.3125, 0.25, }, + -- lamp + { -0.125, -0.3125, -0.125, 0.125, 0.5, 0.125, }, + { -0.0625, -0.3125, -0.1875, 0.0625, 0.5, -0.125, }, + { -0.0625, -0.3125, 0.125, 0.0625, 0.5, 0.1875, }, + { -0.1875, -0.3125, -0.0625, 0.125, 0.5, 0.0625, }, + { 0.125, -0.3125, -0.0625, 0.1875, 0.5, 0.0625, }, + }, + }, + sunlight_propagates = true, + walkable = false, + 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}, + drop = "lavalamp:"..colour, + on_rightclick = function(pos, node, clicker) + node.name = "lavalamp:"..colour + minetest.set_node(pos, node) + end, + }) + + minetest.register_craft({ + output = "lavalamp:"..colour, + recipe = { + {"", "wool:"..colour, "", }, + {"", "bucket:bucket_water", "", }, + {"", "wool:black", "", } + } + }) + +end + + + + + diff --git a/lavalamp/textures/lavalamp_lamp_anim_blue.png b/lavalamp/textures/lavalamp_lamp_anim_blue.png new file mode 100644 index 00000000..03f0a657 Binary files /dev/null and b/lavalamp/textures/lavalamp_lamp_anim_blue.png differ diff --git a/lavalamp/textures/lavalamp_lamp_anim_green.png b/lavalamp/textures/lavalamp_lamp_anim_green.png new file mode 100644 index 00000000..80542b73 Binary files /dev/null and b/lavalamp/textures/lavalamp_lamp_anim_green.png differ diff --git a/lavalamp/textures/lavalamp_lamp_anim_orange.png b/lavalamp/textures/lavalamp_lamp_anim_orange.png new file mode 100644 index 00000000..23ebac3e Binary files /dev/null and b/lavalamp/textures/lavalamp_lamp_anim_orange.png differ diff --git a/lavalamp/textures/lavalamp_lamp_anim_red.png b/lavalamp/textures/lavalamp_lamp_anim_red.png new file mode 100644 index 00000000..dc3c25dc Binary files /dev/null and b/lavalamp/textures/lavalamp_lamp_anim_red.png differ diff --git a/lavalamp/textures/lavalamp_lamp_anim_violet.png b/lavalamp/textures/lavalamp_lamp_anim_violet.png new file mode 100644 index 00000000..0ce98768 Binary files /dev/null and b/lavalamp/textures/lavalamp_lamp_anim_violet.png differ diff --git a/lavalamp/textures/lavalamp_lamp_anim_yellow.png b/lavalamp/textures/lavalamp_lamp_anim_yellow.png new file mode 100644 index 00000000..33914f62 Binary files /dev/null and b/lavalamp/textures/lavalamp_lamp_anim_yellow.png differ diff --git a/lavalamp/textures/lavalamp_lamp_bottom.png b/lavalamp/textures/lavalamp_lamp_bottom.png new file mode 100644 index 00000000..48e3d737 Binary files /dev/null and b/lavalamp/textures/lavalamp_lamp_bottom.png differ diff --git a/lavalamp/textures/lavalamp_lamp_off_sides.png b/lavalamp/textures/lavalamp_lamp_off_sides.png new file mode 100644 index 00000000..4afc5285 Binary files /dev/null and b/lavalamp/textures/lavalamp_lamp_off_sides.png differ diff --git a/lavalamp/textures/lavalamp_lamp_top.png b/lavalamp/textures/lavalamp_lamp_top.png new file mode 100644 index 00000000..e50f10c0 Binary files /dev/null and b/lavalamp/textures/lavalamp_lamp_top.png differ