summaryrefslogtreecommitdiff
path: root/streetlamps
diff options
context:
space:
mode:
authorChristian Danscheid <Christian_D_97@gmx.de>2013-08-16 19:39:31 +0200
committerChristian Danscheid <Christian_D_97@gmx.de>2013-08-16 19:39:31 +0200
commit3d2362b30b0a22cbfa5b6f49f9cd64028855613d (patch)
tree826af7a5023f9efad175fc5707810d3c4489e6b2 /streetlamps
parent812c480227f759e5ae14988651fefc3068175925 (diff)
downloadroads-3d2362b30b0a22cbfa5b6f49f9cd64028855613d.tar
roads-3d2362b30b0a22cbfa5b6f49f9cd64028855613d.tar.gz
roads-3d2362b30b0a22cbfa5b6f49f9cd64028855613d.tar.bz2
roads-3d2362b30b0a22cbfa5b6f49f9cd64028855613d.tar.xz
roads-3d2362b30b0a22cbfa5b6f49f9cd64028855613d.zip
started development of a streetlamp
Diffstat (limited to 'streetlamps')
-rw-r--r--streetlamps/depends.txt3
-rw-r--r--streetlamps/init.lua72
2 files changed, 75 insertions, 0 deletions
diff --git a/streetlamps/depends.txt b/streetlamps/depends.txt
new file mode 100644
index 0000000..f507470
--- /dev/null
+++ b/streetlamps/depends.txt
@@ -0,0 +1,3 @@
+default
+streetsmod
+mesecons? \ No newline at end of file
diff --git a/streetlamps/init.lua b/streetlamps/init.lua
new file mode 100644
index 0000000..1cc9973
--- /dev/null
+++ b/streetlamps/init.lua
@@ -0,0 +1,72 @@
+--[[
+ StreetsMod: Streetlamps
+]]
+minetest.register_node(":streets:streetlamp_basic_bottom",{
+ description = "Street lamp",
+ groups = {cracky = 1},
+ paramtype = "light",
+ drawtype = "nodebox",
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.15,-0.5,-0.15,0.15,0.4,0.15},
+ {-0.1,0.4,-0.1,0.1,0.5,0.1}
+ }
+ },
+ after_place_node = function(pos,placer,itemstack)
+ minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z},{name = "streets:streetlamp_basic_middle"})
+ minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_off"})
+ end,
+ mesecons = {
+ effector = {
+ action_on = function(pos,node)
+ minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_on"})
+ end,
+ action_off = function(pos,node)
+ minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_off"})
+ end
+ }
+ }
+})
+minetest.register_node(":streets:streetlamp_basic_middle",{
+ description = "U cheater U",
+ groups = {cracky = 1, not_in_creative_inventory = 1},
+ paramtype = "light",
+ drawtype = "nodebox",
+ pointable = false,
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.1,-0.5,-0.1,0.1,0.5,0.1}
+ }
+ }
+})
+minetest.register_node(":streets:streetlamp_basic_top_off",{
+ description = "U cheater U",
+ groups = {cracky = 1, not_in_creative_inventory = 1},
+ paramtype = "light",
+ drawtype = "nodebox",
+ pointable = false,
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.1,-0.5,-0.1,0.1,-0.4,0.1},
+ {-0.3,-0.4,-0.3,0.3,0.5,0.3}
+ }
+ }
+})
+minetest.register_node(":streets:streetlamp_basic_top_on",{
+ description = "U cheater U",
+ groups = {cracky = 1, not_in_creative_inventory = 1},
+ paramtype = "light",
+ drawtype = "nodebox",
+ pointable = false,
+ light_source = 10,
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.1,-0.5,-0.1,0.1,-0.4,0.1},
+ {-0.3,-0.4,-0.3,0.3,0.5,0.3}
+ }
+ }
+}) \ No newline at end of file