From 075048dd7a771dafb1511ae2d783d5c729a2df1b Mon Sep 17 00:00:00 2001 From: h-v-smacker Date: Tue, 27 Mar 2018 21:35:49 +0300 Subject: initial release --- README.md | 49 +++- depends.txt | 3 + init.lua | 514 +++++++++++++++++++++++++++++++++ models/limit_post.b3d | Bin 0 -> 37397 bytes models/shunting_signal.b3d | Bin 0 -> 56770 bytes models/switch_arrow_2_off.b3d | Bin 0 -> 28197 bytes models/switch_arrow_2_off_textured.b3d | Bin 0 -> 28206 bytes models/switch_arrow_2_on.b3d | Bin 0 -> 28197 bytes models/switch_arrow_off.b3d | Bin 0 -> 25220 bytes models/switch_arrow_on.b3d | Bin 0 -> 25212 bytes models/switch_ball_off.b3d | Bin 0 -> 112036 bytes models/switch_ball_on.b3d | Bin 0 -> 112036 bytes models/switch_blocker_off.b3d | Bin 0 -> 32187 bytes models/switch_blocker_on.b3d | Bin 0 -> 28707 bytes models/switch_lamp_2_off.b3d | Bin 0 -> 44585 bytes models/switch_lamp_2_on.b3d | Bin 0 -> 44585 bytes models/switch_light_off.b3d | Bin 0 -> 47306 bytes models/switch_light_on.b3d | Bin 0 -> 47416 bytes models/switch_off.b3d | Bin 0 -> 21027 bytes models/switch_on.b3d | Bin 0 -> 20973 bytes src.blend/limit_post.blend | Bin 0 -> 550248 bytes src.blend/shunting_signal.blend | Bin 0 -> 567236 bytes src.blend/switch_arrow_2_off.blend | Bin 0 -> 500332 bytes src.blend/switch_arrow_2_on.blend | Bin 0 -> 501320 bytes src.blend/switch_arrow_off.blend | Bin 0 -> 437852 bytes src.blend/switch_arrow_on.blend | Bin 0 -> 437628 bytes src.blend/switch_ball_off.blend | Bin 0 -> 597496 bytes src.blend/switch_ball_on.blend | Bin 0 -> 501480 bytes src.blend/switch_lamp_2_off.blend | Bin 0 -> 508236 bytes src.blend/switch_lamp_2_on.blend | Bin 0 -> 508828 bytes src.blend/switch_light_off.blend | Bin 0 -> 494044 bytes src.blend/switch_light_on.blend | Bin 0 -> 434572 bytes src.blend/switch_off.blend | Bin 0 -> 449940 bytes src.blend/switch_on.blend | Bin 0 -> 493172 bytes textures/bwarrow.png | Bin 0 -> 629 bytes textures/bwarrow2.png | Bin 0 -> 629 bytes textures/limit_post.png | Bin 0 -> 2001 bytes textures/points_lever_arrow.png | Bin 0 -> 250 bytes textures/points_lever_lamp.png | Bin 0 -> 226 bytes textures/shunting_signal.png | Bin 0 -> 7632 bytes textures/shunting_signal_blue.png | Bin 0 -> 2509 bytes textures/shunting_signal_white.png | Bin 0 -> 2526 bytes textures/switch_arrow_2_off.png | Bin 0 -> 269 bytes textures/switch_arrow_off.png | Bin 0 -> 6629 bytes textures/switch_arrow_on.png | Bin 0 -> 6038 bytes textures/switch_ball_off.png | Bin 0 -> 4913 bytes textures/switch_ball_on.png | Bin 0 -> 4490 bytes textures/switch_light_off.png | Bin 0 -> 6294 bytes textures/switch_light_on.png | Bin 0 -> 6666 bytes textures/switch_off.png | Bin 0 -> 13915 bytes textures/switch_on.png | Bin 0 -> 16589 bytes textures/track_blocker.png | Bin 0 -> 226 bytes 52 files changed, 565 insertions(+), 1 deletion(-) create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 models/limit_post.b3d create mode 100644 models/shunting_signal.b3d create mode 100644 models/switch_arrow_2_off.b3d create mode 100644 models/switch_arrow_2_off_textured.b3d create mode 100644 models/switch_arrow_2_on.b3d create mode 100644 models/switch_arrow_off.b3d create mode 100644 models/switch_arrow_on.b3d create mode 100644 models/switch_ball_off.b3d create mode 100644 models/switch_ball_on.b3d create mode 100644 models/switch_blocker_off.b3d create mode 100644 models/switch_blocker_on.b3d create mode 100644 models/switch_lamp_2_off.b3d create mode 100644 models/switch_lamp_2_on.b3d create mode 100644 models/switch_light_off.b3d create mode 100644 models/switch_light_on.b3d create mode 100644 models/switch_off.b3d create mode 100644 models/switch_on.b3d create mode 100644 src.blend/limit_post.blend create mode 100644 src.blend/shunting_signal.blend create mode 100644 src.blend/switch_arrow_2_off.blend create mode 100644 src.blend/switch_arrow_2_on.blend create mode 100644 src.blend/switch_arrow_off.blend create mode 100644 src.blend/switch_arrow_on.blend create mode 100644 src.blend/switch_ball_off.blend create mode 100644 src.blend/switch_ball_on.blend create mode 100644 src.blend/switch_lamp_2_off.blend create mode 100644 src.blend/switch_lamp_2_on.blend create mode 100644 src.blend/switch_light_off.blend create mode 100644 src.blend/switch_light_on.blend create mode 100644 src.blend/switch_off.blend create mode 100644 src.blend/switch_on.blend create mode 100644 textures/bwarrow.png create mode 100644 textures/bwarrow2.png create mode 100644 textures/limit_post.png create mode 100644 textures/points_lever_arrow.png create mode 100644 textures/points_lever_lamp.png create mode 100644 textures/shunting_signal.png create mode 100644 textures/shunting_signal_blue.png create mode 100644 textures/shunting_signal_white.png create mode 100644 textures/switch_arrow_2_off.png create mode 100644 textures/switch_arrow_off.png create mode 100644 textures/switch_arrow_on.png create mode 100644 textures/switch_ball_off.png create mode 100644 textures/switch_ball_on.png create mode 100644 textures/switch_light_off.png create mode 100644 textures/switch_light_on.png create mode 100644 textures/switch_off.png create mode 100644 textures/switch_on.png create mode 100644 textures/track_blocker.png diff --git a/README.md b/README.md index 9b8accc..264f9ad 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,49 @@ # railroad_paraphernalia -This mod introduces railroad equipment from the 1986 signaling manual for the USSR railways. +This mod introduces railroad equipment, mostly from the 1986 signaling manual for the USSR railways. + +##Point levers +An accessory that makes a railroad switch look professional. Also helps +users of advtrains without train_operator privilege to operate switches in style. + +With black&white arrow: +``` +{'dye:black', 'dye:white', 'dye:black'}, +{'', 'default:stick', 'default:stick'}, +{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, +``` + +With blue&yellow signal lamp: +``` +{'dye:grey', 'dye:yellow', 'dye:white'}, +{'', 'default:stick', 'default:stick'}, +{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, +``` + +While it should be a light source, the details of the model cannot be seen even when it +emits the minimal amount of light. + +##Track Blocker +Prevents a tran from passing a track segment by placing a "block" in its +way. Isn't synced with advtrains ndb, so works only with manned trains for now. +``` +{'dye:white', 'dye:black', 'dye:white'}, +{'', 'default:stick', ''}, +{'dye:red', 'default:steel_ingot', 'default:steel_ingot'}, +``` + +##Shunting signal +A small signal for shunting operations. Blue = shunting prohibited, white = shutung allowed. +``` +{'', 'dye:white', ''}, +{'', 'dye:blue', ''}, +{'', 'default:stone', ''}, +``` + +##Delimiting post: +It is placed near switches to show the point past which the locomotive may +not be parked, since it would collide with the train on the other track. +``` +{'', 'dye:black', ''}, +{'', 'dye:white', ''}, +{'', 'default:stone', ''}, +``` \ No newline at end of file diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..1216ffb --- /dev/null +++ b/depends.txt @@ -0,0 +1,3 @@ +mesecons +advtrains +intllib? diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..75093cd --- /dev/null +++ b/init.lua @@ -0,0 +1,514 @@ +mesecon.rules.flat2 = +{{x = 2, y = 0, z = 0}, + {x =-2, y = 0, z = 0}, + {x = 0, y = 0, z = 2}, + {x = 0, y = 0, z =-2} +} + +mesecon.rules.shunting_signal = +{{x = 1, y = 0, z = 0}, + {x =-1, y = 0, z = 0}, + {x = 0, y = 0, z = 1}, + {x = 0, y = 0, z =-1}, + {x = 0, y = -1, z = 0} +} + +mesecon.rules.switch = { + p0 = {{x = 0, y = 0, z = 1}}, + p1 = {{x = 1, y = 0, z = 0}}, + p2 = {{x = 0, y = 0, z = -1}}, + p3 = {{x = -1, y = 0, z = 0}} +} + +-- param = 2 +-- {{x = 0, y = 0, z = -1}} +-- param = 0 +-- {{x = 0, y = 0, z = 1}} +-- param = 3 +-- {{x = -1, y = 0, z = 0}} +-- param = 1 +-- {{x = 1, y = 0, z = 0}} + + +local function switch_get_rules(orientation) + if orientation == 0 then + return {{x = 0, y = 0, z = 1}} + elseif orientation == 1 then + return {{x = 1, y = 0, z = 0}} + elseif orientation == 2 then + return {{x = 0, y = 0, z = -1}} + elseif orientation == 3 then + return {{x = -1, y = 0, z = 0}} + end + return {{ x = 0, y = 0, z = 0 }} +end + +-- POINT LEVERS WITH ARROW INDICATORS + +minetest.register_node("railroad_paraphernalia:switch_with_arrow", { + description = 'Point lever w/arrow', + drawtype = "mesh", + mesh = "switch_arrow_2_off.b3d", + tiles = { "points_lever_arrow.png" }, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + collisionbox = {-0.5, -0.5, -1.5, 0.5, 1, -0.5}, + walkable = false, + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, + on_place = minetest.rotate_node, + paramtype = "light", + paramtype2 = "facedir", + mesecons = { + receptor = { + state = mesecon.state.off, + rules = mesecon.rules.flat + } + }, + after_place_node = function (pos, placer, itemstack, pointed_thing) + mesecon.receptor_off(pos, switch_get_rules(minetest.get_node(pos).param2)) + end, + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + minetest.set_node(pos, { name = "railroad_paraphernalia:switch_with_arrow_act", param2 = minetest.get_node(pos).param2 } ) + minetest.sound_play("piston_extend", { + pos = pos, + max_hear_distance = 20, + gain = 0.3, + }) + mesecon.receptor_on(pos, switch_get_rules(minetest.get_node(pos).param2)) + end +}) + +minetest.register_node("railroad_paraphernalia:switch_with_arrow_act", { + --description = 'Point lever w/arrow', + drawtype = "mesh", + mesh = "switch_arrow_2_on.b3d", + tiles = { "points_lever_arrow.png" }, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + collisionbox = {-0.5, -0.5, -1.5, 0.5, 1, -0.5}, + walkable = false, + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1}, + on_place = minetest.rotate_node, + paramtype = "light", + paramtype2 = "facedir", + mesecons = { + receptor = { + state = mesecon.state.off, + rules = mesecon.rules.flat2 + } + }, + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + minetest.set_node(pos, { name = "railroad_paraphernalia:switch_with_arrow", param2 = minetest.get_node(pos).param2 } ) + minetest.sound_play("piston_retract", { + pos = pos, + max_hear_distance = 20, + gain = 0.3, + }) + mesecon.receptor_off(pos, switch_get_rules(minetest.get_node(pos).param2)) + end +}) + +minetest.register_craft({ + output = 'railroad_paraphernalia:switch_with_arrow 3', + recipe = { + {'dye:black', 'dye:white', 'dye:black'}, + {'', 'default:stick', 'default:stick'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + } +}) + +-- POINT LEVERS WITH LAMP INDICATORS + +minetest.register_node("railroad_paraphernalia:switch_with_lamp", { + description = 'Point lever w/lamp', + drawtype = "mesh", + mesh = "switch_lamp_2_off.b3d", + tiles = { "points_lever_lamp.png" }, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + collisionbox = {-0.5, -0.5, -1.5, 0.5, 1, -0.5}, + walkable = false, + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, + on_place = minetest.rotate_node, + paramtype = "light", + paramtype2 = "facedir", + mesecons = { + receptor = { + state = mesecon.state.off, + rules = mesecon.rules.flat + } + }, + after_place_node = function (pos, placer, itemstack, pointed_thing) + mesecon.receptor_off(pos, switch_get_rules(minetest.get_node(pos).param2)) + end, + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + minetest.set_node(pos, { name = "railroad_paraphernalia:switch_with_lamp_act", param2 = minetest.get_node(pos).param2 } ) + minetest.sound_play("piston_extend", { + pos = pos, + max_hear_distance = 20, + gain = 0.3, + }) + mesecon.receptor_on(pos, switch_get_rules(minetest.get_node(pos).param2)) + end +}) + + +minetest.register_node("railroad_paraphernalia:switch_with_lamp_act", { + --description = 'Point lever w/lamp', + drawtype = "mesh", + mesh = "switch_lamp_2_on.b3d", + tiles = { "points_lever_lamp.png" }, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + collisionbox = {-0.5, -0.5, -1.5, 0.5, 1, -0.5}, + walkable = false, + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1}, + on_place = minetest.rotate_node, + paramtype = "light", + paramtype2 = "facedir", + mesecons = { + receptor = { + state = mesecon.state.off, + rules = mesecon.rules.flat2 + } + }, + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + minetest.set_node(pos, { name = "railroad_paraphernalia:switch_with_lamp", param2 = minetest.get_node(pos).param2 } ) + minetest.sound_play("piston_retract", { + pos = pos, + max_hear_distance = 20, + gain = 0.3, + }) + mesecon.receptor_off(pos, switch_get_rules(minetest.get_node(pos).param2)) + end +}) + + +minetest.register_craft({ + output = 'railroad_paraphernalia:switch_with_lamp 3', + recipe = { + {'dye:grey', 'dye:yellow', 'dye:white'}, + {'', 'default:stick', 'default:stick'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + } +}) + + +-- POINT LEVERS WITH A RED BALL + +-- minetest.register_node("railroad_paraphernalia:switch_with_ball", { +-- description = 'Point lever w/ball', +-- drawtype = "mesh", +-- mesh = "switch_ball_off.b3d", +-- tiles = { "switch_ball_off.png" }, +-- selection_box = { type = "fixed", +-- fixed = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}} +-- }, +-- collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, +-- groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, +-- on_place = minetest.rotate_node, +-- paramtype = "light", +-- paramtype2 = "facedir", +-- mesecons = { +-- receptor = { +-- state = mesecon.state.off, +-- rules = mesecon.rules.flat +-- } +-- }, +-- after_place_node = function (pos, placer, itemstack, pointed_thing) +-- mesecon.receptor_off(pos, switch_get_rules(minetest.get_node(pos).param2)) +-- end, +-- on_rightclick = function (pos, node, player, itemstack, pointed_thing) +-- minetest.set_node(pos, { name = "railroad_paraphernalia:switch_with_ball_act", param2 = minetest.get_node(pos).param2 } ) +-- minetest.sound_play("piston_extend", { +-- pos = pos, +-- max_hear_distance = 20, +-- gain = 0.3, +-- }) +-- mesecon.receptor_on(pos, switch_get_rules(minetest.get_node(pos).param2)) +-- end +-- }) +-- +-- +-- minetest.register_node("railroad_paraphernalia:switch_with_ball_act", { +-- --description = 'Point lever w/ball', +-- drawtype = "mesh", +-- mesh = "switch_ball_on.b3d", +-- tiles = { "switch_ball_on.png" }, +-- selection_box = { type = "fixed", +-- fixed = {{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}} +-- }, +-- collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, +-- groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1}, +-- on_place = minetest.rotate_node, +-- paramtype = "light", +-- paramtype2 = "facedir", +-- mesecons = { +-- receptor = { +-- state = mesecon.state.off, +-- rules = mesecon.rules.flat2 +-- } +-- }, +-- on_rightclick = function (pos, node, player, itemstack, pointed_thing) +-- minetest.set_node(pos, { name = "railroad_paraphernalia:switch_with_ball", param2 = minetest.get_node(pos).param2 } ) +-- minetest.sound_play("piston_retract", { +-- pos = pos, +-- max_hear_distance = 20, +-- gain = 0.3, +-- }) +-- mesecon.receptor_off(pos, switch_get_rules(minetest.get_node(pos).param2)) +-- end +-- }) + + +-- TRACK BLOCKER + + +minetest.register_node("railroad_paraphernalia:track_blocker", { + description = 'Track Blocker', + drawtype = "mesh", + mesh = "switch_blocker_off.b3d", + tiles = { "track_blocker.png" }, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + collisionbox = {-0.5, -0.5, -1.5, 0.5, 1, -0.5}, + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, + on_place = minetest.rotate_node, + paramtype = "light", + paramtype2 = "facedir", + --light_source = 3, + mesecons = { receptor = { + state = mesecon.state.off, + rules = mesecon.rules.flat + }}, + walkable = false, + after_place_node = function (pos, placer, itemstack, pointed_thing) + mesecon.receptor_off(pos, switch_get_rules(minetest.get_node(pos).param2)) + end, + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + minetest.set_node(pos, { name = "railroad_paraphernalia:track_blocker_act", param2 = minetest.get_node(pos).param2 } ) + minetest.sound_play("piston_extend", { + pos = pos, + max_hear_distance = 20, + gain = 0.3, + }) + mesecon.receptor_on(pos, switch_get_rules(minetest.get_node(pos).param2)) + end +}) + +minetest.register_node("railroad_paraphernalia:track_blocker_act", { + --description = 'Track Blocker', + drawtype = "mesh", + mesh = "switch_blocker_on.b3d", + tiles = { "track_blocker.png" }, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5}, + {-0.5, -0.5, -1.5, 0.5, 1, -0.5} + } + }, + collisionbox = {-0.5, -0.5, -1.5, 0.5, 1, -0.5}, + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1}, + on_place = minetest.rotate_node, + paramtype = "light", + paramtype2 = "facedir", + --light_source = 3, + mesecons = { receptor = { + state = mesecon.state.off, + rules = mesecon.rules.flat2 + }}, + walkable = true, + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + minetest.set_node(pos, { name = "railroad_paraphernalia:track_blocker", param2 = minetest.get_node(pos).param2 } ) + minetest.sound_play("piston_retract", { + pos = pos, + max_hear_distance = 20, + gain = 0.3, + }) + mesecon.receptor_off(pos, switch_get_rules(minetest.get_node(pos).param2)) + end +}) + +minetest.register_craft({ + output = 'railroad_paraphernalia:track_blocker 2', + recipe = { + {'dye:white', 'dye:black', 'dye:white'}, + {'', 'default:stick', ''}, + {'dye:red', 'default:steel_ingot', 'default:steel_ingot'}, + } +}) + +-- ------------------------- + + +minetest.register_node("railroad_paraphernalia:shunting_signal", { + description = "Shunting signal", + drawtype = "mesh", + mesh = "shunting_signal.b3d", + tiles = { "shunting_signal_blue.png" }, + selection_box = { type = "fixed", + fixed = {{-0.33, -0.5, -0.33, 0.33, 0.4, 0.33}} + }, + collisionbox = {-0.33, -0.5, -0.33, 0.33, 0.4, 0.33}, + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, + on_place = minetest.rotate_node, + paramtype = "light", + paramtype2 = "facedir", + light_source = 1, + mesecons = { + effector = { + rules=mesecon.rules.shunting_signal, + action_on = function (pos, node) + minetest.swap_node(pos, {name = "railroad_paraphernalia:shunting_signal_act", param2 = node.param2}, true) + end + } + }, + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + minetest.set_node(pos, { name = "railroad_paraphernalia:shunting_signal_act", param2 = minetest.get_node(pos).param2 } ) + minetest.sound_play("piston_extend", { + pos = pos, + max_hear_distance = 20, + gain = 0.3, + }) + end +}) + + + +minetest.register_node("railroad_paraphernalia:shunting_signal_act", { + --description = "Shunting signal", + drawtype = "mesh", + mesh = "shunting_signal.b3d", + tiles = { "shunting_signal_white.png" }, + selection_box = { type = "fixed", + fixed = {{-0.33, -0.5, -0.33, 0.33, 0.4, 0.33}} + }, + collisionbox = {-0.33, -0.5, -0.33, 0.33, 0.4, 0.33}, + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, not_in_creative_inventory=1}, + on_place = minetest.rotate_node, + paramtype = "light", + paramtype2 = "facedir", + mesecons = { + effector = { + rules=mesecon.rules.shunting_signal, + action_off = function (pos, node) + minetest.swap_node(pos, {name = "railroad_paraphernalia:shunting_signal", param2 = node.param2}) + end + } + }, + on_rightclick = function (pos, node, player, itemstack, pointed_thing) + minetest.set_node(pos, { name = "railroad_paraphernalia:shunting_signal", param2 = minetest.get_node(pos).param2 } ) + minetest.sound_play("piston_extend", { + pos = pos, + max_hear_distance = 20, + gain = 0.3, + }) + end +}) + + +minetest.register_craft({ + output = 'railroad_paraphernalia:shunting_signal', + recipe = { + {'', 'dye:white', ''}, + {'', 'dye:blue', ''}, + {'', 'default:stone', ''}, + } +}) + +-- MISC --------------------- + +minetest.register_node("railroad_paraphernalia:limit_post", { + description = "Delimiting post", + drawtype = "mesh", + mesh = "limit_post.b3d", + tiles = { "limit_post.png" }, + selection_box = { type = "fixed", + fixed = {{-0.33, -0.5, -0.33, 0.33, 0.4, 0.33}} + }, + collisionbox = {-0.33, -0.5, -0.33, 0.33, 0.4, 0.33}, + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3}, + on_place = minetest.rotate_node, + paramtype = "light", + paramtype2 = "facedir" +}) + +minetest.register_craft({ + output = 'railroad_paraphernalia:limit_post', + recipe = { + {'', 'dye:black', ''}, + {'', 'dye:white', ''}, + {'', 'default:stone', ''}, + } +}) + +---- + diff --git a/models/limit_post.b3d b/models/limit_post.b3d new file mode 100644 index 0000000..fb79ba7 Binary files /dev/null and b/models/limit_post.b3d differ diff --git a/models/shunting_signal.b3d b/models/shunting_signal.b3d new file mode 100644 index 0000000..7dd940c Binary files /dev/null and b/models/shunting_signal.b3d differ diff --git a/models/switch_arrow_2_off.b3d b/models/switch_arrow_2_off.b3d new file mode 100644 index 0000000..44ce1c7 Binary files /dev/null and b/models/switch_arrow_2_off.b3d differ diff --git a/models/switch_arrow_2_off_textured.b3d b/models/switch_arrow_2_off_textured.b3d new file mode 100644 index 0000000..2735d5d Binary files /dev/null and b/models/switch_arrow_2_off_textured.b3d differ diff --git a/models/switch_arrow_2_on.b3d b/models/switch_arrow_2_on.b3d new file mode 100644 index 0000000..9b9dfac Binary files /dev/null and b/models/switch_arrow_2_on.b3d differ diff --git a/models/switch_arrow_off.b3d b/models/switch_arrow_off.b3d new file mode 100644 index 0000000..6b8bd9b Binary files /dev/null and b/models/switch_arrow_off.b3d differ diff --git a/models/switch_arrow_on.b3d b/models/switch_arrow_on.b3d new file mode 100644 index 0000000..7dfbad3 Binary files /dev/null and b/models/switch_arrow_on.b3d differ diff --git a/models/switch_ball_off.b3d b/models/switch_ball_off.b3d new file mode 100644 index 0000000..22d07c5 Binary files /dev/null and b/models/switch_ball_off.b3d differ diff --git a/models/switch_ball_on.b3d b/models/switch_ball_on.b3d new file mode 100644 index 0000000..4241159 Binary files /dev/null and b/models/switch_ball_on.b3d differ diff --git a/models/switch_blocker_off.b3d b/models/switch_blocker_off.b3d new file mode 100644 index 0000000..4754c75 Binary files /dev/null and b/models/switch_blocker_off.b3d differ diff --git a/models/switch_blocker_on.b3d b/models/switch_blocker_on.b3d new file mode 100644 index 0000000..a426959 Binary files /dev/null and b/models/switch_blocker_on.b3d differ diff --git a/models/switch_lamp_2_off.b3d b/models/switch_lamp_2_off.b3d new file mode 100644 index 0000000..e2d294a Binary files /dev/null and b/models/switch_lamp_2_off.b3d differ diff --git a/models/switch_lamp_2_on.b3d b/models/switch_lamp_2_on.b3d new file mode 100644 index 0000000..be5df83 Binary files /dev/null and b/models/switch_lamp_2_on.b3d differ diff --git a/models/switch_light_off.b3d b/models/switch_light_off.b3d new file mode 100644 index 0000000..9b9b26f Binary files /dev/null and b/models/switch_light_off.b3d differ diff --git a/models/switch_light_on.b3d b/models/switch_light_on.b3d new file mode 100644 index 0000000..368844b Binary files /dev/null and b/models/switch_light_on.b3d differ diff --git a/models/switch_off.b3d b/models/switch_off.b3d new file mode 100644 index 0000000..6eff541 Binary files /dev/null and b/models/switch_off.b3d differ diff --git a/models/switch_on.b3d b/models/switch_on.b3d new file mode 100644 index 0000000..1fa1330 Binary files /dev/null and b/models/switch_on.b3d differ diff --git a/src.blend/limit_post.blend b/src.blend/limit_post.blend new file mode 100644 index 0000000..fe994fc Binary files /dev/null and b/src.blend/limit_post.blend differ diff --git a/src.blend/shunting_signal.blend b/src.blend/shunting_signal.blend new file mode 100644 index 0000000..2bbeb90 Binary files /dev/null and b/src.blend/shunting_signal.blend differ diff --git a/src.blend/switch_arrow_2_off.blend b/src.blend/switch_arrow_2_off.blend new file mode 100644 index 0000000..079ab21 Binary files /dev/null and b/src.blend/switch_arrow_2_off.blend differ diff --git a/src.blend/switch_arrow_2_on.blend b/src.blend/switch_arrow_2_on.blend new file mode 100644 index 0000000..e2689fe Binary files /dev/null and b/src.blend/switch_arrow_2_on.blend differ diff --git a/src.blend/switch_arrow_off.blend b/src.blend/switch_arrow_off.blend new file mode 100644 index 0000000..183d754 Binary files /dev/null and b/src.blend/switch_arrow_off.blend differ diff --git a/src.blend/switch_arrow_on.blend b/src.blend/switch_arrow_on.blend new file mode 100644 index 0000000..65b750a Binary files /dev/null and b/src.blend/switch_arrow_on.blend differ diff --git a/src.blend/switch_ball_off.blend b/src.blend/switch_ball_off.blend new file mode 100644 index 0000000..6067b36 Binary files /dev/null and b/src.blend/switch_ball_off.blend differ diff --git a/src.blend/switch_ball_on.blend b/src.blend/switch_ball_on.blend new file mode 100644 index 0000000..54b4cd0 Binary files /dev/null and b/src.blend/switch_ball_on.blend differ diff --git a/src.blend/switch_lamp_2_off.blend b/src.blend/switch_lamp_2_off.blend new file mode 100644 index 0000000..4695cbb Binary files /dev/null and b/src.blend/switch_lamp_2_off.blend differ diff --git a/src.blend/switch_lamp_2_on.blend b/src.blend/switch_lamp_2_on.blend new file mode 100644 index 0000000..35e4842 Binary files /dev/null and b/src.blend/switch_lamp_2_on.blend differ diff --git a/src.blend/switch_light_off.blend b/src.blend/switch_light_off.blend new file mode 100644 index 0000000..5f8eb02 Binary files /dev/null and b/src.blend/switch_light_off.blend differ diff --git a/src.blend/switch_light_on.blend b/src.blend/switch_light_on.blend new file mode 100644 index 0000000..312b83f Binary files /dev/null and b/src.blend/switch_light_on.blend differ diff --git a/src.blend/switch_off.blend b/src.blend/switch_off.blend new file mode 100644 index 0000000..6b9727f Binary files /dev/null and b/src.blend/switch_off.blend differ diff --git a/src.blend/switch_on.blend b/src.blend/switch_on.blend new file mode 100644 index 0000000..7569785 Binary files /dev/null and b/src.blend/switch_on.blend differ diff --git a/textures/bwarrow.png b/textures/bwarrow.png new file mode 100644 index 0000000..6d5ea59 Binary files /dev/null and b/textures/bwarrow.png differ diff --git a/textures/bwarrow2.png b/textures/bwarrow2.png new file mode 100644 index 0000000..02f04cc Binary files /dev/null and b/textures/bwarrow2.png differ diff --git a/textures/limit_post.png b/textures/limit_post.png new file mode 100644 index 0000000..6992220 Binary files /dev/null and b/textures/limit_post.png differ diff --git a/textures/points_lever_arrow.png b/textures/points_lever_arrow.png new file mode 100644 index 0000000..f243d37 Binary files /dev/null and b/textures/points_lever_arrow.png differ diff --git a/textures/points_lever_lamp.png b/textures/points_lever_lamp.png new file mode 100644 index 0000000..869f616 Binary files /dev/null and b/textures/points_lever_lamp.png differ diff --git a/textures/shunting_signal.png b/textures/shunting_signal.png new file mode 100644 index 0000000..48f4238 Binary files /dev/null and b/textures/shunting_signal.png differ diff --git a/textures/shunting_signal_blue.png b/textures/shunting_signal_blue.png new file mode 100644 index 0000000..56a27f5 Binary files /dev/null and b/textures/shunting_signal_blue.png differ diff --git a/textures/shunting_signal_white.png b/textures/shunting_signal_white.png new file mode 100644 index 0000000..ede9701 Binary files /dev/null and b/textures/shunting_signal_white.png differ diff --git a/textures/switch_arrow_2_off.png b/textures/switch_arrow_2_off.png new file mode 100644 index 0000000..8e6e33a Binary files /dev/null and b/textures/switch_arrow_2_off.png differ diff --git a/textures/switch_arrow_off.png b/textures/switch_arrow_off.png new file mode 100644 index 0000000..7766f6e Binary files /dev/null and b/textures/switch_arrow_off.png differ diff --git a/textures/switch_arrow_on.png b/textures/switch_arrow_on.png new file mode 100644 index 0000000..0161a29 Binary files /dev/null and b/textures/switch_arrow_on.png differ diff --git a/textures/switch_ball_off.png b/textures/switch_ball_off.png new file mode 100644 index 0000000..4ace153 Binary files /dev/null and b/textures/switch_ball_off.png differ diff --git a/textures/switch_ball_on.png b/textures/switch_ball_on.png new file mode 100644 index 0000000..69237c1 Binary files /dev/null and b/textures/switch_ball_on.png differ diff --git a/textures/switch_light_off.png b/textures/switch_light_off.png new file mode 100644 index 0000000..af2e29f Binary files /dev/null and b/textures/switch_light_off.png differ diff --git a/textures/switch_light_on.png b/textures/switch_light_on.png new file mode 100644 index 0000000..f4d072f Binary files /dev/null and b/textures/switch_light_on.png differ diff --git a/textures/switch_off.png b/textures/switch_off.png new file mode 100644 index 0000000..2f066db Binary files /dev/null and b/textures/switch_off.png differ diff --git a/textures/switch_on.png b/textures/switch_on.png new file mode 100644 index 0000000..55eef7e Binary files /dev/null and b/textures/switch_on.png differ diff --git a/textures/track_blocker.png b/textures/track_blocker.png new file mode 100644 index 0000000..f97f302 Binary files /dev/null and b/textures/track_blocker.png differ -- cgit v1.2.3