diff options
author | Christian Danscheid <Christian_D_97@gmx.de> | 2013-08-12 10:01:46 +0200 |
---|---|---|
committer | Christian Danscheid <Christian_D_97@gmx.de> | 2013-08-12 10:01:46 +0200 |
commit | 8f7101f92c4412159bf93b529dd449bfe9552e11 (patch) | |
tree | e9ce968d8f1296980e6303d1a2c694732874c40a | |
parent | e2057c2292f3265be20216dab0d1e9803219185d (diff) | |
download | roads-8f7101f92c4412159bf93b529dd449bfe9552e11.tar roads-8f7101f92c4412159bf93b529dd449bfe9552e11.tar.gz roads-8f7101f92c4412159bf93b529dd449bfe9552e11.tar.bz2 roads-8f7101f92c4412159bf93b529dd449bfe9552e11.tar.xz roads-8f7101f92c4412159bf93b529dd449bfe9552e11.zip |
Started development of a trafficlight
-rw-r--r-- | trafficlight/depends.txt | 3 | ||||
-rw-r--r-- | trafficlight/init.lua | 67 | ||||
-rw-r--r-- | trafficlight/textures/textures.txt | 1 |
3 files changed, 71 insertions, 0 deletions
diff --git a/trafficlight/depends.txt b/trafficlight/depends.txt new file mode 100644 index 0000000..e0e13a6 --- /dev/null +++ b/trafficlight/depends.txt @@ -0,0 +1,3 @@ +default +streetsmod +digilines?
\ No newline at end of file diff --git a/trafficlight/init.lua b/trafficlight/init.lua new file mode 100644 index 0000000..d7b093b --- /dev/null +++ b/trafficlight/init.lua @@ -0,0 +1,67 @@ +--[[ + StreetsMod: inDev Trafficlights +]] +minetest.register_node(":streets:trafficlight_bottom",{ + description = "Trafficlight", + groups = {cracky = 1}, + paramtype = "light", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.25,-0.5,-0.25,0.25,0.25,0.25}, + {-0.2,0.25,-0.2,0.2,0.5,0.2} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.25,-0.5,-0.25,0.25,2.5,0.25} + } + }, + after_place_node = function(pos,placer,itemstack) + if minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" and minetest.get_node({x = pos.x, y = pos.y + 2, z = pos.z}).name == "air" then + pos.y = pos.y + 1 + minetest.set_node(pos,{name="streets:trafficlight_middle"}) + pos.y = pos.y + 1 + minetest.set_node(pos,{name="streets:trafficlight_top"}) + else + minetest.chat_send_player(placer:get_player_name(),"Not enough vertical space! The traffic light has a height of 3 blocks.") + minetest.remove_node(pos) + end + end, + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y + 1 + minetest.remove_node(pos) + pos.y = pos.y + 1 + minetest.remove_node(pos) + end +}) + +minetest.register_node(":streets:trafficlight_middle",{ + description = "U cheater U", + groups = {cracky = 1, not_in_creative_inventory = 1}, + paramtype = "light", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.2,-0.5,-0.2,0.2,0.5,0.2} + } + }, + pointable = false, +}) + +minetest.register_node(":streets:trafficlight_top",{ + description = "U cheater U", + groups = {cracky = 1, not_in_creative_inventory = 1}, + paramtype = "light", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.25,-0.5,-0.25,0.25,0.5,0.25} + } + }, + pointable = false, +})
\ No newline at end of file diff --git a/trafficlight/textures/textures.txt b/trafficlight/textures/textures.txt new file mode 100644 index 0000000..cbf90fa --- /dev/null +++ b/trafficlight/textures/textures.txt @@ -0,0 +1 @@ +no textures yet
\ No newline at end of file |