Add a traffic barrier and a blinking light. (#68)
* Add a traffic barrier. Requires #67 for crafting recipe. Closes #61 * Add a blinking light.
This commit is contained in:
parent
2f8bf5644c
commit
8b79e4a713
1
init.lua
1
init.lua
@ -40,6 +40,7 @@ streets.load_submod("streets_rrxing")
|
||||
streets.load_submod("streets_signs")
|
||||
streets.load_submod("streets_signworkshop")
|
||||
streets.load_submod("streets_steelsupport")
|
||||
streets.load_submod("streets_roadwork")
|
||||
|
||||
if minetest.get_modpath("digilines") then
|
||||
streets.load_submod("streets_trafficlight")
|
||||
|
103
streets_roadwork/init.lua
Normal file
103
streets_roadwork/init.lua
Normal file
@ -0,0 +1,103 @@
|
||||
--[[
|
||||
## StreetsMod 2.0 ##
|
||||
Submod: roadwork
|
||||
Optional: true
|
||||
]]
|
||||
|
||||
minetest.register_node("streets:roadwork_traffic_barrier", {
|
||||
description = "Traffic Barrier",
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"streets_concrete.png", "streets_concrete.png", "streets_concrete.png^streets_roadwork_traffic_barrier.png"},
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 1, level = 2, wall = 1},
|
||||
node_box = {
|
||||
type = "connected",
|
||||
fixed = {{-0.3, -0.5, -0.3, 0.3, -0.4, 0.3}, {-0.1, -0.5, -0.1, 0.1, 0.5, 0.1}},
|
||||
connect_front = {{-0.3, -0.5, -0.5, 0.3, -0.4, 0.3}, {-0.1, -0.5, -0.5, 0.1, 0.5, 0.1}}, -- z-
|
||||
connect_back = {{-0.3, -0.5, -0.3, 0.3, -0.4, 0.5}, {-0.1, -0.5, -0.1, 0.1, 0.5, 0.5}}, -- z+
|
||||
connect_left = {{-0.5, -0.5, -0.3, 0.3, -0.4, 0.3}, {-0.5, -0.5, -0.1, 0.1, 0.5, 0.1}}, -- x-
|
||||
connect_right = {{-0.3, -0.5, -0.3, 0.5, -0.4, 0.3}, {-0.1, -0.5, -0.1, 0.5, 0.5, 0.1}}, -- x+
|
||||
},
|
||||
connects_to = {"group:wall", "group:stone", "group:wood", "group:tree", "group:sign", "group:concrete"},
|
||||
sound = default.node_sound_stone_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "streets:roadwork_traffic_barrier 3",
|
||||
recipe = {
|
||||
{"dye:red", "dye:white", "dye:red"},
|
||||
{"streets:concrete_wall", "streets:concrete_wall", "streets:concrete_wall"},
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("streets:roadwork_blinking_light_off", {
|
||||
description = "Blinking Light",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_off.png"},
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.125, 0.1875, -0.3125, 0.125}, -- Base
|
||||
{-0.1875, -0.3125, 0, 0.1875, 0.0625, 0}, -- Light
|
||||
}
|
||||
},
|
||||
on_timer = function(pos, elapsed)
|
||||
minetest.set_node(pos, {name = "streets:roadwork_blinking_light_on", param2 = minetest.get_node(pos).param2 })
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
timer = minetest.get_node_timer(pos)
|
||||
timer:start(1)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("streets:roadwork_blinking_light_on", {
|
||||
description = "Blinking Light",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_on.png"},
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky = 1, not_in_creative_inventory = 1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.125, 0.1875, -0.3125, 0.125}, -- Base
|
||||
{-0.1875, -0.3125, 0, 0.1875, 0.0625, 0}, -- Light
|
||||
}
|
||||
},
|
||||
light_source = 12,
|
||||
on_timer = function(pos, elapsed)
|
||||
minetest.set_node(pos, {name = "streets:roadwork_blinking_light_off", param2 = minetest.get_node(pos).param2 })
|
||||
end,
|
||||
on_construct = function(pos)
|
||||
timer = minetest.get_node_timer(pos)
|
||||
timer:start(1)
|
||||
end,
|
||||
drop = "streets:roadwork_blinking_light_off",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "streets:roadwork_blinking_light_off 2",
|
||||
recipe = {
|
||||
{"dye:red", "default:torch", "dye:red"},
|
||||
{"dye:yellow", "default:steel_ingot", "dye:yellow"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"streets:roadwork_blinking_light_on", "streets:roadwork_blinking_light_off"},
|
||||
interval = 10,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
timer = minetest.get_node_timer(pos)
|
||||
if not timer:is_started() then
|
||||
timer:start(1)
|
||||
end
|
||||
end,
|
||||
})
|
BIN
textures/streets_roadwork_blinking_light_off.png
Normal file
BIN
textures/streets_roadwork_blinking_light_off.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 373 B |
BIN
textures/streets_roadwork_blinking_light_on.png
Normal file
BIN
textures/streets_roadwork_blinking_light_on.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 382 B |
BIN
textures/streets_roadwork_blinking_light_top.png
Normal file
BIN
textures/streets_roadwork_blinking_light_top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 381 B |
BIN
textures/streets_roadwork_traffic_barrier.png
Normal file
BIN
textures/streets_roadwork_traffic_barrier.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 952 B |
Loading…
x
Reference in New Issue
Block a user