summaryrefslogtreecommitdiff
path: root/streetlamps
diff options
context:
space:
mode:
authorwebdesigner97 <Christian_D_97@gmx.de>2013-10-14 12:23:07 +0200
committerwebdesigner97 <Christian_D_97@gmx.de>2013-10-14 12:23:07 +0200
commitc72382e0a83cc77acc0bd0590c558dcfa70fb146 (patch)
tree6b430b5981e00e2e665e13dd79d4a20b7ca51a01 /streetlamps
parent52b2ae9334403d49103f38d6007f643b52a131f6 (diff)
downloadroads-c72382e0a83cc77acc0bd0590c558dcfa70fb146.tar
roads-c72382e0a83cc77acc0bd0590c558dcfa70fb146.tar.gz
roads-c72382e0a83cc77acc0bd0590c558dcfa70fb146.tar.bz2
roads-c72382e0a83cc77acc0bd0590c558dcfa70fb146.tar.xz
roads-c72382e0a83cc77acc0bd0590c558dcfa70fb146.zip
Streetlamp controller
Diffstat (limited to 'streetlamps')
-rw-r--r--streetlamps/init.lua55
1 files changed, 39 insertions, 16 deletions
diff --git a/streetlamps/init.lua b/streetlamps/init.lua
index 621c7b1..d813de9 100644
--- a/streetlamps/init.lua
+++ b/streetlamps/init.lua
@@ -1,39 +1,62 @@
--[[
StreetsMod: Streetlamps
]]
-minetest.register_node(":streets:streetlamp_basic_bottom",{
- description = "Street lamp",
- tiles = {"streets_lamps_basic_bottom.png"},
- groups = {cracky = 1},
- paramtype = "light",
+minetest.register_node(":streets:streetlamp_basic_controller",{
+ description = "Trafficlight",
+ tiles = {"streets_lampcontroller_top.png","streets_lampcontroller_bottom.png","streets_lampcontroller_sides.png"},
+ groups = {cracky = 1, not_in_creative_inventory = 1},
drawtype = "nodebox",
+ paramtype = "light",
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}
+ {-0.5,-0.5,-0.5,0.5,0.5,0.5},
+ {-0.05,0.5,-0.05,0.05,1.6,0.05}
}
},
- selection_box = {
+ selection_box = {
type = "fixed",
fixed = {
- {-0.3,-0.5,-0.3,0.3,2.5,0.3}
+ {-0.5,-0.5,-0.5,0.5,0.5,0.5},
+ {-0.3,1.5,-0.3,0.3,4.5,0.3}
}
},
- 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"})
+ minetest.set_node({x = pos.x, y = pos.y + 4, 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"})
+ minetest.set_node({x = pos.x, y = pos.y + 4, z = pos.z},{name = "streets:streetlamp_basic_top_off"})
end
}
- }
+ },
+ after_dig_node = function(pos)
+ minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z})
+ minetest.remove_node({x = pos.x, y = pos.y + 3, z = pos.z})
+ minetest.remove_node({x = pos.x, y = pos.y + 4, z = pos.z})
+ minetest.chat_send_all("!!!")
+ end
+})
+minetest.register_node(":streets:streetlamp_basic_bottom",{
+ description = "Street lamp",
+ tiles = {"streets_lamps_basic_bottom.png"},
+ 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}
+ }
+ },
+ pointable = false,
+ 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"})
+ minetest.set_node({x = pos.x, y = pos.y - 2, z = pos.z},{name = "streets:streetlamp_basic_controller"})
+ end
})
minetest.register_node(":streets:streetlamp_basic_middle",{
description = "U cheater U",