import familygrog's lava lamp mod

This commit is contained in:
Vanessa Ezekowitz 2015-04-15 00:12:34 -04:00
parent 3506ede1f5
commit d1e4b01049
12 changed files with 162 additions and 0 deletions

42
lavalamp/README.txt Normal file
View File

@ -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 <sam@hocevar.net>
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.

2
lavalamp/depends.txt Normal file
View File

@ -0,0 +1,2 @@
wool
bucket

118
lavalamp/init.lua Normal file
View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B