aboutsummaryrefslogtreecommitdiff
path: root/signals.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-09-13 16:11:14 +0200
committerorwell96 <mono96.mml@gmail.com>2016-09-13 16:11:14 +0200
commit173829fe5918cef85999f925f397d14ce36c2cc2 (patch)
treed0113e3137f7bd72ba0cbdd880da9d71e54d5331 /signals.lua
parent1e93892d8ab8492a0f90a4e55806fc06ff6cb437 (diff)
downloadadvtrains-173829fe5918cef85999f925f397d14ce36c2cc2.tar.gz
advtrains-173829fe5918cef85999f925f397d14ce36c2cc2.tar.bz2
advtrains-173829fe5918cef85999f925f397d14ce36c2cc2.zip
add electric signal and rotate signals for better placement
Diffstat (limited to 'signals.lua')
-rw-r--r--signals.lua29
1 files changed, 29 insertions, 0 deletions
diff --git a/signals.lua b/signals.lua
index 118d16e..803b1a7 100644
--- a/signals.lua
+++ b/signals.lua
@@ -15,6 +15,7 @@ for r,f in pairs({on="off", off="on"}) do
tiles = {"advtrains_retrosignal.png"},
description="Lampless Signal ("..r..")",
on_rightclick=switchfunc,
+ sunlight_propagates=true,
groups = {
choppy=3,
not_blocking_trains=1
@@ -28,4 +29,32 @@ for r,f in pairs({on="off", off="on"}) do
minetest.swap_node(pos, {name = "advtrains:retrosignal_"..f, param2 = node.param2})
end,
})
+ minetest.register_node("advtrains:signal_"..r, {
+ drawtype = "mesh",
+ paramtype="light",
+ paramtype2="facedir",
+ walkable = false,
+ selection_box = {
+ type = "fixed",
+ fixed = {-1/4, -1/2, -1/4, 1/4, 2, 1/4},
+ },
+ mesh = "advtrains_signal.b3d",
+ tiles = {"advtrains_signal_"..r..".png"},
+ description="Signal ("..r..")",
+ on_rightclick=switchfunc,
+ groups = {
+ choppy=3,
+ not_blocking_trains=1
+ },
+ light_source = 1,
+ sunlight_propagates=true,
+ mesecons = {effector = {
+ ["action_"..f] = function (pos, node)
+ minetest.swap_node(pos, {name = "advtrains:signal_"..f, param2 = node.param2})
+ end
+ }},
+ on_rightclick=function(pos, node, clicker)
+ minetest.swap_node(pos, {name = "advtrains:signal_"..f, param2 = node.param2})
+ end,
+ })
end