Initial commit (version 0.1-test)

This commit is contained in:
2022-11-21 16:12:22 -05:00
commit e4e2a9116d
2062 changed files with 52261 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
streetsmod
building_blocks?

View File

@@ -0,0 +1,27 @@
--[[
Streets Mod: All kinds of asphalt
]]
minetest.register_node(":streets:asphalt",{
description = streets.S("Asphalt"),
tiles = {"streets_asphalt.png"},
groups = {cracky=3}
})
if minetest.get_modpath("building_blocks") then
minetest.register_craft({
type = "shapeless",
output = "streets:asphalt 3",
recipe = {
"default:sand",
"default:gravel",
"building_blocks:Tar"
},
})
else
minetest.register_craft({
type = "cooking",
output = "streets:asphalt",
recipe = "default:gravel",
cooktime = 2
})
end

View File

@@ -0,0 +1,2 @@
streetsmod
wool?

View File

@@ -0,0 +1,70 @@
minetest.register_node(":streets:constructionfence_bottom",{
description = streets.S("Construction fence"),
tiles = {"streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_bottom.png","streets_fence_bottom.png"},
groups = {cracky = 2, disable_jump = 1},
paramtype = "light",
inventory_image = "streets_fence_inv.png",
wield_image = "streets_fence_inv.png",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.1,0.5,0.0,0.1}, -- lower part
{-0.2,-0.0,-0.1,0.2,0.5,0.1} -- thing in the middle
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.1,0.5,1.0,0.1}
}
},
after_dig_node = function(pos,node,digger)
pos.y = pos.y + 1
minetest.remove_node(pos)
end,
after_place_node = function(pos,placer,itemstack)
pos.y = pos.y + 1
if minetest.get_node(pos).name == "air" then
minetest.add_node(pos,{name = "streets:constructionfence_top", param2 = minetest.dir_to_facedir(placer:get_look_dir())})
else
minetest.chat_send_player(placer:get_player_name(),"Not enough free space! A construction fence has a height of 2 blocks!")
end
end
})
minetest.register_node(":streets:constructionfence_top",{
description = streets.S("Construction fence"),
tiles = {"streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_fromtop.png","streets_fence_top.png","streets_fence_top.png"},
groups = {cracky = 2, not_in_creative_inventory = 1, disable_jump = 1},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
drop = "streets:constructionfence_bottom",
node_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.1,0.5,0.0,0.1} -- upper part
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-1.5,-0.1,0.5,0.0,0.1}
}
},
after_dig_node = function(pos,node,digger)
pos.y = pos.y - 1
minetest.remove_node(pos)
end
})
minetest.register_craft({
output = "streets:constructionfence_bottom 8",
recipe = {
{"","",""},
{"","streets:sign_construction",""},
{"wool:red","wool:white","wool:red"}
}
})

View File

@@ -0,0 +1,2 @@
default
streetsmod

View File

@@ -0,0 +1,27 @@
--[[
StreetsMod: Delineator
]]
minetest.register_node(":streets:delineator", {
description = streets.S("Delineator"),
tiles = {"streets_delineator_top.png","streets_delineator.png"},
drawtype = "nodebox",
paramtype = "light",
groups = {cracky=3, oddly_breakable_by_hand=2},
light_source = 8,
sunlight_propagates = true,
node_box = {
type = "fixed",
fixed = {
{-0.1, -0.5, -0.1, 0.1, 0.5, 0.1},
},
}
})
minetest.register_craft({
output = "streets:delineator 4",
recipe = {
{"","",""},
{"","default:torch",""},
{"","default:fence_wood",""}
}
})

View File

@@ -0,0 +1 @@
webdesigner97's "streets" and ragnarok's "infrastructure" put together, then some changes on top of that...

View File

@@ -0,0 +1 @@
streetsmod

View File

@@ -0,0 +1,25 @@
--[[
StreetsMod: Emergency Phone
]]
minetest.register_node(":streets:emergencyphone",{
description = streets.S("Emergency Phone"),
tiles = {"streets_sos_top.png","streets_sos_bottom.png","streets_sos_side.png","streets_sos_side.png","streets_sos_side.png","streets_sos_front.png"},
groups = {cracky = 3},
paramtype2 = "facedir",
light_source = 5,
on_rightclick = function(pos,node,clicker)
if clicker:is_player() and clicker:get_hp() < 6 then
clicker:set_hp(6)
minetest.log("action",clicker:get_player_name() .. " healed by emergency phone at pos " .. minetest.pos_to_string(pos) .. "")
end
end
})
minetest.register_alias("streets:emergency_phone","streets:emergencyphone")
minetest.register_craft({
output = "streets:emergencyphone",
recipe = {
{"wool:orange","default:torch","wool:orange"},
{"wool:orange","default:apple","wool:orange"},
{"default:steel_ingot","default:diamondblock","default:steel_ingot"}
}
})

View File

@@ -0,0 +1,55 @@
-- Aircraft warning light
minetest.register_node("infrastructure:aircraft_warning_light", {
description = "Aircraft warning light",
tiles = {
{name="infrastructure_aircraft_warning_light_top_anim.png",animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=4}},
"infrastructure_traffic_lights_side.png",
{name="infrastructure_aircraft_warning_light_side_anim.png",animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=4}},
{name="infrastructure_aircraft_warning_light_side_anim.png",animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=4}},
{name="infrastructure_aircraft_warning_light_side_anim.png",animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=4}},
{name="infrastructure_aircraft_warning_light_side_anim.png",animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=4}}
},
drawtype = "nodebox",
paramtype = "light",
groups = {cracky = 1},
light_source = AIRCRAFT_WARNING_LIGHT_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-1/128, 1/4, -1/128, 1/128, 3/8, 1/128},
{-1/4, -1/8, 0, 1/4, 1/4, 0},
{0, -1/8, -1/4, 0, 1/4, 1/4},
{-1/16, -1/8, -1/16, 1/16, 1/16, 1/16},
{-1/4, -1/4, -1/8, 1/4, -1/8, 1/8},
{-1/8, -1/4, -1/4, 1/8, -1/8, 1/4},
{-1/8, -3/8, -1/8, 1/8, -1/4, 1/8},
{-3/16, -1/2, -3/16, 3/16, -3/8, 3/16}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/128, 1/4, -1/128, 1/128, 3/8, 1/128},
{-1/4, -1/8, 0, 1/4, 1/4, 0},
{0, -1/8, -1/4, 0, 1/4, 1/4},
{-1/16, -1/8, -1/16, 1/16, 1/16, 1/16},
{-1/4, -1/4, -1/8, 1/4, -1/8, 1/8},
{-1/8, -1/4, -1/4, 1/8, -1/8, 1/4},
{-1/8, -3/8, -1/8, 1/8, -1/4, 1/8},
{-3/16, -1/2, -3/16, 3/16, -3/8, 3/16}
}
}
})
minetest.register_alias("infrastructure:aircraft_warning_light_bright", "infrastructure:aircraft_warning_light")
minetest.register_alias("infrastructure:aircraft_warning_light_dark", "infrastructure:aircraft_warning_light")

View File

@@ -0,0 +1,463 @@
-- Automatic warning device
infrastructure.sound_handles = {}
function infrastructure.play_bell(pos)
local pos_hash = minetest.hash_node_position(pos)
if not infrastructure.sound_handles[pos_hash] then
infrastructure.sound_handles[pos_hash] = minetest.sound_play("infrastructure_ebell",
{pos = pos, gain = AUTOMATIC_WARNING_DEVICE_VOLUME, loop = true, max_hear_distance = 30,})
end
end
function infrastructure.stop_bell(pos)
local pos_hash = minetest.hash_node_position(pos)
local sound_handle = infrastructure.sound_handles[pos_hash]
if sound_handle then
minetest.sound_stop(sound_handle)
infrastructure.sound_handles[pos_hash] = nil
end
end
function infrastructure.left_light_direction(pos, param2)
if param2 == 0 then
pos.x = pos.x - 1
elseif param2 == 1 then
pos.z = pos.z + 1
elseif param2 == 2 then
pos.x = pos.x + 1
elseif param2 == 3 then
pos.z = pos.z - 1
end
end
function infrastructure.right_light_direction(pos, param2)
if param2 == 0 then
pos.x = pos.x + 2
elseif param2 == 1 then
pos.z = pos.z - 2
elseif param2 == 2 then
pos.x = pos.x - 2
elseif param2 == 3 then
pos.z = pos.z + 2
end
end
function infrastructure.lights_enabled(pos)
local node = minetest.get_node(pos)
local param2 = node.param2
minetest.swap_node(pos, {name = "infrastructure:automatic_warning_device_middle_center_on", param2 = node.param2})
infrastructure.left_light_direction(pos, param2)
minetest.swap_node(pos, {name = "infrastructure:automatic_warning_device_middle_left_on", param2 = node.param2})
infrastructure.right_light_direction(pos, param2)
minetest.swap_node(pos, {name = "infrastructure:automatic_warning_device_middle_right_on", param2 = node.param2})
end
function infrastructure.lights_disabled(pos)
local node = minetest.get_node(pos)
local param2 = node.param2
minetest.swap_node(pos, {name = "infrastructure:automatic_warning_device_middle_center_off", param2 = node.param2})
infrastructure.left_light_direction(pos, param2)
minetest.swap_node(pos, {name = "infrastructure:automatic_warning_device_middle_left_off", param2 = node.param2})
infrastructure.right_light_direction(pos, param2)
minetest.swap_node(pos, {name = "infrastructure:automatic_warning_device_middle_right_off", param2 = node.param2})
end
function infrastructure.activate_lights(pos)
pos.y = pos.y + 2
local node = minetest.get_node(pos)
if node.name == "infrastructure:automatic_warning_device_middle_center_off" then
infrastructure.play_bell(pos)
infrastructure.lights_enabled(pos)
elseif (node.name == "infrastructure:automatic_warning_device_middle_center_on") then
infrastructure.stop_bell(pos,node)
infrastructure.lights_disabled(pos, node)
end
end
minetest.register_node("infrastructure:automatic_warning_device_top", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_top_side.png",
"infrastructure_automatic_warning_device_top_side.png",
"infrastructure_automatic_warning_device_top_side.png",
"infrastructure_automatic_warning_device_top.png"
},
on_destruct = stop_bell,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3, not_in_creative_inventory = 1},
node_box = {
type = "fixed",
fixed = {
{-1/16, -1/2, -1/16, 1/16, 0, 1/16},
{-1/8, 0, -1/8, 1/8, 3/8, 1/8},
{-1/4, 1/8, -1/4, 1/4, 1/4, 1/4},
{-1/2, -1/2, -1/16, 1/2, 0, -1/16},
{-1/8, -1/2, -1/16, 1/8, -1/4, 1/8}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:automatic_warning_device_middle_right_on", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_middle_right_side.png",
{name="infrastructure_automatic_warning_device_middle_right_anim.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.5}}
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
light_source = AUTOMATIC_WARNING_DEVICE_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, -1/16, -1/4, 1/2, -1/16},
{-1/2, -5/16, -1/16, -7/16, 1/16, 3/16},
{-1/2, 1/32, -5/16, -15/32, 3/32, -1/16},
{-15/32, -1/8, -3/16, -13/32, 1/32, -1/16}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:automatic_warning_device_middle_right_off", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_middle_right_side.png",
"infrastructure_automatic_warning_device_middle_right_off.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, -1/16, -1/4, 1/2, -1/16},
{-1/2, -5/16, -1/16, -7/16, 1/16, 3/16},
{-1/2, 1/32, -5/16, -15/32, 3/32, -1/16},
{-15/32, -1/8, -3/16, -13/32, 1/32, -1/16}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:automatic_warning_device_middle_left_on", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_middle_left_side.png",
{name="infrastructure_automatic_warning_device_middle_left_anim.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.5}}
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
light_source = AUTOMATIC_WARNING_DEVICE_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{1/4, -1/2, -1/16, 1/2, 1/2, -1/16},
{7/16, -5/16, -1/16, 1/2, 1/16, 3/16},
{15/32, 1/32, -5/16, 1/2, 3/32, -1/16},
{13/32, -1/8, -3/16, 15/32, 1/32, -1/16}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:automatic_warning_device_middle_left_off", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_middle_left_side.png",
"infrastructure_automatic_warning_device_middle_left_off.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{1/4, -1/2, -1/16, 1/2, 1/2, -1/16},
{7/16, -5/16, -1/16, 1/2, 1/16, 3/16},
{15/32, 1/32, -5/16, 1/2, 3/32, -1/16},
{13/32, -1/8, -3/16, 15/32, 1/32, -1/16}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:automatic_warning_device_middle_center_on", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_middle_center_side.png",
"infrastructure_automatic_warning_device_middle_center_side.png",
"infrastructure_automatic_warning_device_middle_center_side.png",
{name="infrastructure_automatic_warning_device_middle_center_anim.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.5}}
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
light_source = AUTOMATIC_WARNING_DEVICE_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
{-1/2, -1/2, -1/16, 1/2, 1/2, -1/16},
{-1/2, -5/16, -1/16, -3/16, 1/16, 3/16},
{3/16, -5/16, -1/16, 1/2, 1/16, 3/16},
{-3/16, -3/16, -1/16, 3/16, -1/16, 1/8},
{-1/2, 1/32, -5/16, -7/32, 3/32, -1/16},
{-7/32, -1/8, -3/16, -5/32, 1/32, -1/16},
{7/32, 1/32, -5/16, 1/2, 3/32, -1/16},
{5/32, -1/8, -3/16, 7/32, 1/32, -1/16}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:automatic_warning_device_middle_center_off", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_middle_center_side.png",
"infrastructure_automatic_warning_device_middle_center_side.png",
"infrastructure_automatic_warning_device_middle_center_side.png",
"infrastructure_automatic_warning_device_middle_center_off.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
{-1/2, -1/2, -1/16, 1/2, 1/2, -1/16},
{-1/2, -5/16, -1/16, -3/16, 1/16, 3/16},
{3/16, -5/16, -1/16, 1/2, 1/16, 3/16},
{-3/16, -3/16, -1/16, 3/16, -1/16, 1/8},
{-1/2, 1/32, -5/16, -7/32, 3/32, -1/16},
{-7/32, -1/8, -3/16, -5/32, 1/32, -1/16},
{7/32, 1/32, -5/16, 1/2, 3/32, -1/16},
{5/32, -1/8, -3/16, 7/32, 1/32, -1/16}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:automatic_warning_device_middle", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_middle_side.png",
"infrastructure_automatic_warning_device_middle_side.png",
"infrastructure_automatic_warning_device_middle_side.png",
"infrastructure_automatic_warning_device_middle.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3, not_in_creative_inventory = 1},
node_box = {
type = "fixed",
fixed = {
{-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
{-3/8, -3/8, -1/8, 3/8, 3/8, -1/16},
{-1/8, -1/8, -1/16, 1/8, 1/8, 1/8}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:automatic_warning_device_bottom", {
description = "Automatic warning device",
inventory_image = "infrastructure_automatic_warning_device.png",
wield_image = "infrastructure_automatic_warning_device.png",
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_bottom.png",
"infrastructure_automatic_warning_device_bottom.png",
"infrastructure_automatic_warning_device_bottom.png",
"infrastructure_automatic_warning_device_bottom.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3},
node_box = {
type = "fixed",
fixed = {
{-1/16, 0, -1/16, 1/16, 1/2, 1/16},
{-1/2, -1/2, -1/4, 1/2, -3/8, 1/4},
{-1/4, -1/2, -1/2, 1/4, -3/8, 1/2},
{-1/8, -3/8, -1/8, 1/8, 0, 1/8}
}
},
selection_box = {
type = "fixed",
fixed = {
-- top
{-1/8, 0 + 3, -1/8, 1/8, 3/8 + 3, 1/8},
{-1/4, 1/8 + 3, -1/4, 1/4, 1/4 + 3, 1/4},
{-1/8, -1/2 + 3, -1/16 + 0.01, 1/8, -1/4 + 3, 1/8},
-- middle center, left and right
{-9/16, -5/16 + 2, -1/16, -3/16, 1/16 + 2, 3/16},
{3/16, -5/16 + 2, -1/16, 9/16, 1/16 + 2, 3/16},
{-3/16, -3/16 + 2, -1/16 + 0.01, 3/16, -1/16 + 2, 1/8},
{-1/2, 1/32 + 2, -5/16, -7/32, 3/32 + 2, -1/16 - 0.01},
{-7/32, -1/8 + 2, -3/16, -5/32, 1/32 + 2, -1/16 - 0.01},
{13/32 - 1, -1/8 + 2, -3/16, 15/32 - 1, 1/32 + 2, -1/16 - 0.01},
{7/32, 1/32 + 2, -5/16, 1/2, 3/32 + 2, -1/16 - 0.01},
{5/32, -1/8 + 2, -3/16, 7/32, 1/32 + 2, -1/16 - 0.01},
{-15/32 + 1, -1/8 + 2, -3/16, -13/32 + 1, 1/32 + 2, -1/16 - 0.01},
-- middle
{-3/8, -3/8 + 1, -1/8, 3/8, 3/8 + 1, -1/16},
{-1/8, -1/8 + 1, -1/16, 1/8, 1/8 + 1, 1/8},
-- bottom
{-1/2, -1/2, -1/4, 1/2, -3/8, 1/4},
{-1/4, -1/2, -1/2, 1/4, -3/8, 1/2},
{-1/8, -3/8, -1/8, 1/8, 0, 1/8},
-- post
{-1/16, 0, -1/16, 1/16, 3, 1/16}
}
},
on_construct = function(pos)
local node = minetest.get_node(pos)
local param2 = node.param2
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "field[channel;Channel;${channel}]")
pos.y = pos.y + 1
node.name = "infrastructure:automatic_warning_device_middle"
minetest.set_node(pos, node)
pos.y = pos.y + 2
node.name = "infrastructure:automatic_warning_device_top"
minetest.set_node(pos, node)
pos.y = pos.y - 1
node.name = "infrastructure:automatic_warning_device_middle_center_1"
minetest.set_node(pos, node)
infrastructure.left_light_direction(pos, param2)
node.name = "infrastructure:automatic_warning_device_middle_left_1"
minetest.set_node(pos, node)
infrastructure.right_light_direction(pos, param2)
node.name = "infrastructure:automatic_warning_device_middle_right_1"
minetest.set_node(pos, node)
end,
on_destruct = function(pos)
local node = minetest.get_node(pos)
local param2 = node.param2
pos.y=pos.y+2
infrastructure.stop_bell(pos, node)
pos.y=pos.y-2
for i = 1, 3 do
pos.y = pos.y + 1
minetest.remove_node(pos)
end
pos.y = pos.y - 1
infrastructure.left_light_direction(pos, param2)
minetest.remove_node(pos)
infrastructure.right_light_direction(pos, param2)
minetest.remove_node(pos)
end,
on_punch = function(pos, node)
infrastructure.activate_lights(pos, node)
end,
on_receive_fields = function(pos, formname, fields, sender)
if (fields.channel) then
minetest.get_meta(pos):set_string("channel", fields.channel)
minetest.get_meta(pos):set_string("state", "Off")
end
end,
digiline = {
receptor = {},
effector = {
action = function(pos, node, channel, msg)
local setchan = minetest.get_meta(pos):get_string("channel")
if setchan ~= channel then
return
end
if (msg=="bell_on") then
infrastructure.play_bell(pos)
elseif (msg=="bell_off") then
infrastructure.stop_bell(pos)
elseif (msg=="lights_on") then
pos.y = pos.y+2
infrastructure.lights_enabled(pos)
elseif (msg=="lights_off") then
pos.y = pos.y+2
infrastructure.lights_disabled(pos)
end
end
}
}
})
minetest.register_alias("infrastructure:automatic_warning_device", "infrastructure:automatic_warning_device_bottom")
minetest.register_alias("awd", "infrastructure:automatic_warning_device_bottom")
minetest.register_alias("infrastructure:automatic_warning_device_middle_left_1","infrastructure:automatic_warning_device_middle_left_off")
minetest.register_alias("infrastructure:automatic_warning_device_middle_left_2","infrastructure:automatic_warning_device_middle_left_off")
minetest.register_alias("infrastructure:automatic_warning_device_middle_right_1","infrastructure:automatic_warning_device_middle_right_off")
minetest.register_alias("infrastructure:automatic_warning_device_middle_right_2","infrastructure:automatic_warning_device_middle_right_off")
minetest.register_alias("infrastructure:automatic_warning_device_middle_center_1","infrastructure:automatic_warning_device_middle_center_off")
minetest.register_alias("infrastructure:automatic_warning_device_middle_center_2","infrastructure:automatic_warning_device_middle_center_off")
minetest.register_alias("infrastructure:automatic_warning_device_middle_center_3","infrastructure:automatic_warning_device_middle_center_off")

View File

@@ -0,0 +1,508 @@
-- Boom barrier
function move_arm(pos, node)
local node = minetest.env:get_node(pos)
local param2 = node.param2
if param2 == 0 then
dir = "z-"
elseif param2 == 1 then
dir = "x-"
elseif param2 == 2 then
dir = "z+"
elseif param2 == 3 then
dir = "x+"
end
minetest.sound_play("infrastructure_boom_barrier", {
pos = pos,
gain = BOOM_BARRIER_VOLUME,
max_hear_distance = 50
})
if node.name == "infrastructure:boom_barrier_top_h" then
minetest.swap_node(pos, {name = "infrastructure:boom_barrier_top_v", param2 = node.param2})
if dir == "x+" then
for i = 1, 10 do
pos.x = pos.x + 1
if (string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_lightfirst")
or string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_end")
or string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_darkfirst")) == nil then
pos.x = pos.x - 1
break
end
minetest.env:remove_node(pos)
node.name = "infrastructure:boom_barrier_arm_v"
minetest.env:add_node({x=pos.x-i, y=pos.y+i, z=pos.z}, node)
end
elseif dir == "x-" then
for i = 1, 10 do
pos.x = pos.x - 1
if (string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_lightfirst")
or string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_end")
or string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_darkfirst")) == nil then
break
end
minetest.env:remove_node(pos)
node.name = "infrastructure:boom_barrier_arm_v"
minetest.env:add_node({x=pos.x+i, y=pos.y+i, z=pos.z}, node)
end
elseif dir == "z+" then
for i = 1, 10 do
pos.z = pos.z + 1
if (string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_lightfirst")
or string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_end")
or string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_darkfirst")) == nil then
break
end
minetest.env:remove_node(pos)
node.name = "infrastructure:boom_barrier_arm_v"
minetest.env:add_node({x=pos.x, y=pos.y+i, z=pos.z-i}, node)
end
elseif dir == "z-" then
for i = 1, 10 do
pos.z = pos.z - 1
if (string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_lightfirst")
or string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_end")
or string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_h_darkfirst")) == nil then
break
end
minetest.env:remove_node(pos)
node.name = "infrastructure:boom_barrier_arm_v"
minetest.env:add_node({x=pos.x, y=pos.y+i, z=pos.z+i}, node)
end
end
elseif node.name == "infrastructure:boom_barrier_top_v" then
minetest.swap_node(pos, {name = "infrastructure:boom_barrier_top_h", param2 = node.param2})
if dir == "x+" then
for i = 1, 10 do
pos.y = pos.y + 1
if string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_v") == nil then
break
end
minetest.env:remove_node(pos)
if i % 2 == 1 then
node.name = "infrastructure:boom_barrier_arm_h_lightfirst"
else
node.name = "infrastructure:boom_barrier_arm_h_darkfirst"
end
if minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name ~= "infrastructure:boom_barrier_arm_v" then
node.name = "infrastructure:boom_barrier_arm_h_end"
end
minetest.env:add_node({x=pos.x+i, y=pos.y-i, z=pos.z}, node)
end
elseif dir == "x-" then
for i = 1, 10 do
pos.y = pos.y + 1
if string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_v") == nil then
break
end
minetest.env:remove_node(pos)
if i % 2 == 1 then
node.name = "infrastructure:boom_barrier_arm_h_lightfirst"
else
node.name = "infrastructure:boom_barrier_arm_h_darkfirst"
end
if minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name ~= "infrastructure:boom_barrier_arm_v" then
node.name = "infrastructure:boom_barrier_arm_h_end"
end
minetest.env:add_node({x=pos.x-i, y=pos.y-i, z=pos.z}, node)
end
elseif dir == "z+" then
for i = 1, 10 do
pos.y = pos.y + 1
if string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_v") == nil then
break
end
minetest.env:remove_node(pos)
if i % 2 == 1 then
node.name = "infrastructure:boom_barrier_arm_h_lightfirst"
else
node.name = "infrastructure:boom_barrier_arm_h_darkfirst"
end
if minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name ~= "infrastructure:boom_barrier_arm_v" then
node.name = "infrastructure:boom_barrier_arm_h_end"
end
minetest.env:add_node({x=pos.x, y=pos.y-i, z=pos.z+i}, node)
end
elseif dir == "z-" then
for i = 1, 10 do
pos.y = pos.y + 1
if string.match(minetest.env:get_node(pos).name, "infrastructure:boom_barrier_arm_v") == nil then
break
end
minetest.env:remove_node(pos)
if i % 2 == 1 then
node.name = "infrastructure:boom_barrier_arm_h_lightfirst"
else
node.name = "infrastructure:boom_barrier_arm_h_darkfirst"
end
if minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name ~= "infrastructure:boom_barrier_arm_v" then
node.name = "infrastructure:boom_barrier_arm_h_end"
end
minetest.env:add_node({x=pos.x, y=pos.y-i, z=pos.z-i}, node)
end
end
end
end
minetest.register_node("infrastructure:boom_barrier_top_h", {
description = "Boom barrier mechanism",
tiles = {
"infrastructure_boom_barrier_h_top.png",
"infrastructure_boom_barrier_h_bottom.png",
"infrastructure_boom_barrier_h_right.png",
"infrastructure_boom_barrier_h_left.png",
"infrastructure_boom_barrier_h_front_back.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1},
node_box = {
type = "fixed",
fixed = {
{-1/4, -1/4, -1/4, 1/4, 1/4, 1/4},
{-1/8, -1/2, -1/8, 1/8, -1/4, 1/8},
{-3/8, -1/2, -1/2, -1/4, -1/4, 1/8},
{-3/8, -1/2, -1/8, -1/4, 1/8, 1/8},
{-3/8, -1/8, -1/8, -1/4, 1/8, 1/2},
{-1/2, -3/16, 1/4, -3/8, 3/16, 1/2},
{-1/2, -1/8, 3/16, -3/8, 1/8, 1/2},
{-1/2, -1/16, 1/8, -3/8, 1/16, 1/2},
{1/4, -1/2, -1/2, 3/8, -1/4, 1/8},
{1/4, -1/2, -1/8, 3/8, 1/8, 1/8},
{1/4, -1/8, -1/8, 3/8, 1/8, 1/2},
{3/8, -3/16, 1/4, 1/2, 3/16, 1/2},
{3/8, -1/8, 3/16, 1/2, 1/8, 1/2},
{3/8, -1/16, 1/8, 1/2, 1/16, 1/2},
{-3/8, -1/2, -1/2, 3/8, -1/4, -3/8},
{-7/16, -1/16, -1/16, 7/16, 1/16, 1/16}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/4, -1/4, -1/4, 1/4, 1/4, 1/4},
{-1/8, -1/2, -1/8, 1/8, -1/4, 1/8},
{-3/8, -1/2, -1/2, -1/4, -1/4, 1/8},
{-3/8, -1/2, -1/8, -1/4, 1/8, 1/8},
{-3/8, -1/8, -1/8, -1/4, 1/8, 1/2},
{-1/2, -3/16, 1/4, -3/8, 3/16, 1/2},
{-1/2, -1/8, 3/16, -3/8, 1/8, 1/2},
{-1/2, -1/16, 1/8, -3/8, 1/16, 1/2},
{1/4, -1/2, -1/2, 3/8, -1/4, 1/8},
{1/4, -1/2, -1/8, 3/8, 1/8, 1/8},
{1/4, -1/8, -1/8, 3/8, 1/8, 1/2},
{3/8, -3/16, 1/4, 1/2, 3/16, 1/2},
{3/8, -1/8, 3/16, 1/2, 1/8, 1/2},
{3/8, -1/16, 1/8, 1/2, 1/16, 1/2},
{-3/8, -1/2, -1/2, 3/8, -1/4, -3/8},
{-7/16, -1/16, -1/16, 7/16, 1/16, 1/16}
}
},
after_place_node = function(pos)
local node = minetest.env:get_node(pos)
node.name = "infrastructure:boom_barrier_bottom"
minetest.env:add_node(pos, node)
pos.y = pos.y + 1
node.name = "infrastructure:boom_barrier_top_h"
minetest.env:add_node(pos, node)
end,
after_dig_node = function(pos)
pos.y = pos.y - 1
minetest.env:remove_node(pos)
end,
on_punch = function(pos, node)
move_arm(pos, node)
end
})
minetest.register_node("infrastructure:boom_barrier_top_v", {
tiles = {
"infrastructure_boom_barrier_h_front_back.png",
"infrastructure_boom_barrier_v_bottom.png",
"infrastructure_boom_barrier_v_right.png",
"infrastructure_boom_barrier_v_left.png",
"infrastructure_boom_barrier_v_front_back.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1},
drop = "infrastructure:boom_barrier_top_h",
node_box = {
type = "fixed",
fixed = {
{-1/4, -1/4, -1/4, 1/4, 1/4, 1/4},
{-1/8, -1/2, -1/8, 1/8, -1/4, 1/8},
{-3/8, -1/8, -1/2, -1/4, 1/2, -1/4},
{-3/8, -1/8, -1/2, -1/4, 1/8, 1/8},
{-3/8, -1/2, -1/8, -1/4, 1/8, 1/8},
{-1/2, -1/2, -3/16, -3/8, -1/4, 3/16},
{-1/2, -1/2, -1/8, -3/8, -3/16, 1/8},
{-1/2, -1/2, -1/16, -3/8, -1/8, 1/16},
{1/4, -1/8, -1/2, 3/8, 1/2, -1/4},
{1/4, -1/8, -1/2, 3/8, 1/8, 1/8},
{1/4, -1/2, -1/8, 3/8, 1/8, 1/8},
{3/8, -1/2, -3/16, 1/2, -1/4, 3/16},
{3/8, -1/2, -1/8, 1/2, -3/16, 1/8},
{3/8, -1/2, -1/16, 1/2, -1/8, 1/16},
{-3/8, 3/8, -1/2, 3/8, 1/2, -1/4},
{-7/16, -1/16, -1/16, 7/16, 1/16, 1/16}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/4, -1/4, -1/4, 1/4, 1/4, 1/4},
{-1/8, -1/2, -1/8, 1/8, -1/4, 1/8},
{-3/8, -1/8, -1/2, -1/4, 1/2, -1/4},
{-3/8, -1/8, -1/2, -1/4, 1/8, 1/8},
{-3/8, -1/2, -1/8, -1/4, 1/8, 1/8},
{-1/2, -1/2, -3/16, -3/8, -1/4, 3/16},
{-1/2, -1/2, -1/8, -3/8, -3/16, 1/8},
{-1/2, -1/2, -1/16, -3/8, -1/8, 1/16},
{1/4, -1/8, -1/2, 3/8, 1/2, -1/4},
{1/4, -1/8, -1/2, 3/8, 1/8, 1/8},
{1/4, -1/2, -1/8, 3/8, 1/8, 1/8},
{3/8, -1/2, -3/16, 1/2, -1/4, 3/16},
{3/8, -1/2, -1/8, 1/2, -3/16, 1/8},
{3/8, -1/2, -1/16, 1/2, -1/8, 1/16},
{-3/8, 3/8, -1/2, 3/8, 1/2, -1/4},
{-7/16, -1/16, -1/16, 7/16, 1/16, 1/16}
}
},
after_dig_node = function(pos)
pos.y = pos.y - 1
minetest.env:remove_node(pos)
end,
on_punch = function(pos, node)
move_arm(pos, node)
end
})
minetest.register_node("infrastructure:boom_barrier_bottom", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_automatic_warning_device_bottom.png",
"infrastructure_automatic_warning_device_bottom.png",
"infrastructure_automatic_warning_device_bottom.png",
"infrastructure_automatic_warning_device_bottom.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1},
drop = "infrastructure:boom_barrier_top_h",
node_box = {
type = "fixed",
fixed = {
{-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
{-1/2, -1/2, -1/4, 1/2, -3/8, 1/4},
{-1/4, -1/2, -1/2, 1/4, -3/8, 1/2},
{-1/8, -1/2, -1/8, 1/8, 0, 1/8}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
{-1/2, -1/2, -1/4, 1/2, -3/8, 1/4},
{-1/4, -1/2, -1/2, 1/4, -3/8, 1/2},
{-1/8, -1/2, -1/8, 1/8, 0, 1/8}
}
},
after_dig_node = function(pos)
pos.y = pos.y + 1
minetest.env:remove_node(pos)
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "field[channel;Channel;${channel}]")
end,
on_receive_fields = function(pos, formname, fields, sender)
if (fields.channel) then
minetest.get_meta(pos):set_string("channel", fields.channel)
minetest.get_meta(pos):set_string("state", "Off")
end
end,
digiline = {
receptor = {},
effector = {
action = function(pos, node, channel, msg)
local setchan = minetest.get_meta(pos):get_string("channel")
if setchan ~= channel then
return
end
pos.y = pos.y + 1
local mechnode = minetest.env:get_node(pos)
if ((msg == "up" and mechnode.name=="infrastructure:boom_barrier_top_h") or (msg == "down" and mechnode.name=="infrastructure:boom_barrier_top_v")) then
move_arm(pos, mechnode)
end
end
}
},
})
minetest.register_node("infrastructure:boom_barrier_arm_h_lightfirst", {
description = "Boom barrier arm",
tiles = {
"infrastructure_boom_barrier_arm_h_top.png",
"infrastructure_boom_barrier_arm_h_bottom_front_back.png",
{name="infrastructure_boom_barrier_arm_h_anim_lightfirst.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.5}},
{name="infrastructure_boom_barrier_arm_h_anim_lightfirst.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.5}},
"infrastructure_boom_barrier_arm_h_bottom_front_back.png",
"infrastructure_boom_barrier_arm_h_bottom_front_back.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1},
light_source = BOOM_BARRIER_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-1/8, -1/2, -1/2, 1/8, -7/16, 1/2},
{-1/8, -5/16, -1/2, 1/8, -1/4, 1/2},
{-1/8, -1/2, -1/2, -1/16, -1/4, 1/2},
{1/16, -1/2, -1/2, 1/8, -1/4, 1/2},
{0, -1/4, -1/8, 0, 0, 1/8}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/8, -1/2, -1/2, 1/8, -1/4, 1/2}
}
}
})
minetest.register_node("infrastructure:boom_barrier_arm_h_darkfirst", {
tiles = {
"infrastructure_boom_barrier_arm_h_top.png",
"infrastructure_boom_barrier_arm_h_bottom_front_back.png",
{name="infrastructure_boom_barrier_arm_h_anim_darkfirst.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.5}},
{name="infrastructure_boom_barrier_arm_h_anim_darkfirst.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.5}},
"infrastructure_boom_barrier_arm_h_bottom_front_back.png",
"infrastructure_boom_barrier_arm_h_bottom_front_back.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1},
drop = "infrastructure:boom_barrier_arm_h_lightfirst",
node_box = {
type = "fixed",
fixed = {
{-1/8, -1/2, -1/2, 1/8, -7/16, 1/2},
{-1/8, -5/16, -1/2, 1/8, -1/4, 1/2},
{-1/8, -1/2, -1/2, -1/16, -1/4, 1/2},
{1/16, -1/2, -1/2, 1/8, -1/4, 1/2},
{0, -1/4, -1/8, 0, 0, 1/8}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/8, -1/2, -1/2, 1/8, -1/4, 1/2}
}
}
})
minetest.register_node("infrastructure:boom_barrier_arm_h_end", {
tiles = {
"infrastructure_boom_barrier_arm_h_top.png",
"infrastructure_boom_barrier_arm_h_bottom_front_back.png",
"infrastructure_boom_barrier_arm_h_left_right_bright.png",
"infrastructure_boom_barrier_arm_h_left_right_bright.png",
"infrastructure_boom_barrier_arm_h_bottom_front_back.png",
"infrastructure_boom_barrier_arm_h_bottom_front_back.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1},
drop = "infrastructure:boom_barrier_arm_h_lightfirst",
node_box = {
type = "fixed",
fixed = {
{-1/8, -1/2, -1/2, 1/8, -7/16, 1/2},
{-1/8, -5/16, -1/2, 1/8, -1/4, 1/2},
{-1/8, -1/2, -1/2, -1/16, -1/4, 1/2},
{1/16, -1/2, -1/2, 1/8, -1/4, 1/2},
{0, -1/4, -1/8, 0, 0, 1/8}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/8, -1/2, -1/2, 1/8, -1/4, 1/2}
}
}
})
minetest.register_alias("infrastructure:boom_barrier_arm_h_dark","infrastructure:boom_barrier_arm_h_darkfirst")
minetest.register_alias("infrastructure:boom_barrier_arm_h_bright","infrastructure:boom_barrier_arm_h_lightfirst")
minetest.register_node("infrastructure:boom_barrier_arm_v", {
tiles = {
"infrastructure_boom_barrier_arm_h_bottom_front_back.png",
"infrastructure_boom_barrier_arm_h_bottom_front_back.png",
"infrastructure_boom_barrier_arm_v_left.png",
"infrastructure_boom_barrier_arm_v_right.png",
"infrastructure_boom_barrier_arm_h_top.png",
"infrastructure_boom_barrier_arm_h_bottom_front_back.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1},
drop = "infrastructure:boom_barrier_arm_h_lightfirst",
node_box = {
type = "fixed",
fixed = {
{-1/8, -1/2, -1/2, 1/8, 1/2, -7/16},
{-1/8, -1/2, -5/16, 1/8, 1/2, -1/4},
{-1/8, -1/2, -1/2, -1/16, 1/2, -1/4},
{1/16, -1/2, -1/2, 1/8, 1/2, -1/4},
{0, -1/8, -1/4, 0, 1/8, 0}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/8, -1/2, -1/2, 1/8, 1/2, -1/4}
}
}
})
minetest.register_alias("infrastructure:boom_barrier_mechanism", "infrastructure:boom_barrier_top_h")
minetest.register_alias("infrastructure:boom_barrier_arm", "infrastructure:boom_barrier_arm_h_lightfirst")

View File

@@ -0,0 +1,85 @@
-- Crosswalk lighting
minetest.register_node("infrastructure:crosswalk_lighting_dark", {
description = "Crosswalk lighting",
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_crosswalk_lighting_bottom.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_crosswalk_lighting_back.png",
"infrastructure_crosswalk_lighting_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3},
node_box = {
type = "fixed",
fixed = {
{-3/8, -1/2, -1/4, 3/8, 1/2, -3/16},
{-3/8, -1/2, 3/16, 3/8, 1/2, 1/4},
{-1/4, 1/4, -3/16, -1/8, 3/8, 3/16},
{1/8, 1/4, -3/16, 1/4, 3/8, 3/16},
{-1/8, -1/2, -3/16, 1/8, -1/4, 3/16},
{-1/2, -1/2, -1/8, 1/2, -3/8, 1/8},
}
},
selection_box = {
type = "fixed",
fixed = {-3/8, -1/2, -1/4, 3/8, 1/2, 1/4}
},
on_punch = function(pos, node)
minetest.swap_node(pos, {name = "infrastructure:crosswalk_lighting_bright", param2 = node.param2})
end,
mesecons = {effector = {
action_on = function (pos, node)
minetest.swap_node(pos, {name = "infrastructure:crosswalk_lighting_bright", param2 = node.param2})
end,
}}
})
minetest.register_node("infrastructure:crosswalk_lighting_bright", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_crosswalk_lighting_bottom.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_crosswalk_lighting_back.png",
"infrastructure_crosswalk_lighting_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3, not_in_creative_inventory = 1},
light_source = CROSSWALK_LIGHTING_LIGHT_RANGE,
drop = "infrastructure:crosswalk_lighting_dark",
node_box = {
type = "fixed",
fixed = {
{-3/8, -1/2, -1/4, 3/8, 1/2, -3/16},
{-3/8, -1/2, 3/16, 3/8, 1/2, 1/4},
{-1/4, 1/4, -3/16, -1/8, 3/8, 3/16},
{1/8, 1/4, -3/16, 1/4, 3/8, 3/16},
{-1/8, -1/2, -3/16, 1/8, -1/4, 3/16},
{-1/2, -1/2, -1/8, 1/2, -3/8, 1/8},
}
},
selection_box = {
type = "fixed",
fixed = {-3/8, -1/2, -1/4, 3/8, 1/2, 1/4}
},
on_punch = function(pos, node)
minetest.swap_node(pos, {name = "infrastructure:crosswalk_lighting_dark", param2 = node.param2})
end,
mesecons = {effector = {
action_off = function (pos, node)
minetest.swap_node(pos, {name = "infrastructure:crosswalk_lighting_dark", param2 = node.param2})
end,
}}
})
minetest.register_alias("infrastructure:crosswalk_lighting", "infrastructure:crosswalk_lighting_dark")

View File

@@ -0,0 +1,85 @@
-- Crosswalk safety sign
minetest.register_node("infrastructure:crosswalk_safety_sign_top", {
tiles = {
"infrastructure_crosswalk_safety_sign_top.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_crosswalk_safety_sign_top_side.png",
"infrastructure_crosswalk_safety_sign_top_side.png",
"infrastructure_crosswalk_safety_sign_top_front_back.png",
"infrastructure_crosswalk_safety_sign_top_front_back.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1, not_in_creative_inventory = 1},
light_source = CROSSWALK_SAFETY_SIGN_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-1/4, -1/2, -1/16, 1/4, 0, -1/16},
{-1/4, -1/2, 1/16, 1/4, 0, 1/16},
{-1/16, -1/2, -1/16, 1/16, -1/4, 1/16}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:crosswalk_safety_sign_bottom", {
description = "Crosswalk safety sign",
inventory_image = "infrastructure_crosswalk_safety_sign.png",
wield_image = "infrastructure_crosswalk_safety_sign.png",
tiles = {
"infrastructure_crosswalk_safety_sign_top.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_crosswalk_safety_sign_bottom_side.png",
"infrastructure_crosswalk_safety_sign_bottom_side.png",
"infrastructure_crosswalk_safety_sign_bottom_front_back.png",
"infrastructure_crosswalk_safety_sign_bottom_front_back.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1},
light_source = CROSSWALK_SAFETY_SIGN_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-1/4, -7/32, -1/16, 1/4, 1/2, -1/16},
{-1/4, -7/32, 1/16, 1/4, 1/2, 1/16},
{-1/16, -5/16, -1/16, 1/16, 1/2, 1/16},
{-1/8, -3/8, -1/8, 1/8, -5/16, 1/8},
{-1/4, -1/2, -1/2, 1/4, -3/8, 1/2}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/4, -7/32, -1/16, 1/4, 1, -1/16},
{-1/4, -7/32, 1/16, 1/4, 1, 1/16},
{-1/16, -5/16, -1/16 + 0.01, 1/16, 3/4, 1/16 - 0.01},
{-1/8, -3/8, -1/8, 1/8, -5/16, 1/8},
{-1/4, -1/2, -1/2, 1/4, -3/8, 1/2}
}
},
after_place_node = function(pos)
local node = minetest.env:get_node(pos)
node.name = "infrastructure:crosswalk_safety_sign_bottom"
minetest.env:add_node(pos, node)
pos.y = pos.y + 1
node.name = "infrastructure:crosswalk_safety_sign_top"
minetest.env:add_node(pos, node)
end,
after_dig_node = function(pos)
pos.y = pos.y + 1
minetest.env:remove_node(pos)
end,
})
minetest.register_alias("infrastructure:crosswalk_safety_sign", "infrastructure:crosswalk_safety_sign_bottom")

View File

@@ -0,0 +1,124 @@
-- Crosswalk warning light
function on_off_light(pos, node)
if node.name == "infrastructure:crosswalk_warning_light_off" then
minetest.swap_node(pos, {name = "infrastructure:crosswalk_warning_light_on", param2 = node.param2})
elseif (node.name == "infrastructure:crosswalk_warning_light_on") then
minetest.swap_node(pos, {name = "infrastructure:crosswalk_warning_light_off", param2 = node.param2})
end
end
minetest.register_node("infrastructure:crosswalk_warning_light_off", {
description = "Crosswalk warning light",
inventory_image = "infrastructure_crosswalk_warning_light_front_bright.png",
wield_image = "infrastructure_crosswalk_warning_light_front_bright.png",
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_crosswalk_warning_light_back.png",
"infrastructure_crosswalk_warning_light_front_dark.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3, not_in_creative_inventory = 0},
node_box = {
type = "fixed",
fixed = {
{-5/16, -5/16, -1/8, 5/16, 3/8, 1/8},
{-1/2, -1/2, -1/8, 1/2, 1/2, -1/8},
{-5/16, 1/4, -5/16, 5/16, 5/16, -1/8},
{-5/16, 0, -1/4, -1/4, 1/4, -1/8},
{1/4, 0, -1/4, 5/16, 1/4, -1/8},
{-1/16, -1/4, 1/8, 1/16, 1/4, 3/8},
{-1/4, -1/16, 1/8, 1/4, 1/16, 3/8},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.001}
}
},
selection_box = {
type = "fixed",
fixed = {
{-5/16, -5/16, -1/8, 5/16, 3/8, 1/8},
{-5/16, 1/4, -5/16, 5/16, 5/16, -1/8},
{-5/16, 0, -1/4, -1/4, 1/4, -1/8},
{1/4, 0, -1/4, 5/16, 1/4, -1/8},
{-1/16, -1/4, 1/8, 1/16, 1/4, 3/8},
{-1/4, -1/16, 1/8, 1/4, 1/16, 3/8},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.01}
}
},
on_punch = function(pos, node)
on_off_light(pos, node)
end,
mesecons = {effector = {
action_on = function(pos, node)
on_off_light(pos, node)
end,
}}
})
minetest.register_node("infrastructure:crosswalk_warning_light_on", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_crosswalk_warning_light_back.png",
{name="infrastructure_crosswalk_warning_light_front_anim.png",animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.5}}
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3, not_in_creative_inventory = 1},
drop = "infrastructure:crosswalk_warning_light_off",
node_box = {
type = "fixed",
fixed = {
{-5/16, -5/16, -1/8, 5/16, 3/8, 1/8},
{-1/2, -1/2, -1/8, 1/2, 1/2, -1/8},
{-5/16, 1/4, -5/16, 5/16, 5/16, -1/8},
{-5/16, 0, -1/4, -1/4, 1/4, -1/8},
{1/4, 0, -1/4, 5/16, 1/4, -1/8},
{-1/16, -1/4, 1/8, 1/16, 1/4, 3/8},
{-1/4, -1/16, 1/8, 1/4, 1/16, 3/8},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.001}
}
},
selection_box = {
type = "fixed",
fixed = {
{-5/16, -5/16, -1/8, 5/16, 3/8, 1/8},
{-5/16, 1/4, -5/16, 5/16, 5/16, -1/8},
{-5/16, 0, -1/4, -1/4, 1/4, -1/8},
{1/4, 0, -1/4, 5/16, 1/4, -1/8},
{-1/16, -1/4, 1/8, 1/16, 1/4, 3/8},
{-1/4, -1/16, 1/8, 1/4, 1/16, 3/8},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.01}
}
},
on_punch = function(pos, node)
on_off_light(pos, node)
end,
mesecons = {effector = {
action_on = function(pos, node)
on_off_light(pos, node)
end,
}}
})
minetest.register_alias("infrastructure:crosswalk_warning_light", "infrastructure:crosswalk_warning_light_off")
minetest.register_alias("infrastructure:crosswalk_warning_bright", "infrastructure:crosswalk_warning_light_on")
minetest.register_alias("infrastructure:crosswalk_warning_dark", "infrastructure:crosswalk_warning_light_on")

View File

@@ -0,0 +1,85 @@
-- Curve chevron
minetest.register_node("infrastructure:curve_chevron_dark", {
description = "Flashing curve chevron",
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_curve_chevron_left_dark.png",
"infrastructure_curve_chevron_right_dark.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3},
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, -1/8, 1/2, 1/2, -1/16},
{-1/2, -1/2, 1/16, 1/2, 1/2, 1/8},
{-3/8, 1/4, -1/16, -1/4, 3/8, 1/16},
{1/4, 1/4, -1/16, 3/8, 3/8, 1/16},
{-3/8, -3/8, -1/16, -1/4, -1/4, 1/16},
{1/4, -3/8, -1/16, 3/8, -1/4, 1/16}
}
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/8, 1/2, 1/2, 1/8}
},
on_punch = function(pos, node)
minetest.swap_node(pos, {name = "infrastructure:curve_chevron_bright", param2 = node.param2})
end,
mesecons = {effector = {
action_on = function (pos, node)
minetest.swap_node(pos, {name = "infrastructure:curve_chevron_bright", param2 = node.param2})
end,
}}
})
minetest.register_node("infrastructure:curve_chevron_bright", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_curve_chevron_left_bright.png",
"infrastructure_curve_chevron_right_bright.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3, not_in_creative_inventory = 1},
light_source = CURVE_CHEVRON_LIGHT_RANGE,
drop = "infrastructure:curve_chevron_dark",
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, -1/8, 1/2, 1/2, -1/16},
{-1/2, -1/2, 1/16, 1/2, 1/2, 1/8},
{-3/8, 1/4, -1/16, -1/4, 3/8, 1/16},
{1/4, 1/4, -1/16, 3/8, 3/8, 1/16},
{-3/8, -3/8, -1/16, -1/4, -1/4, 1/16},
{1/4, -3/8, -1/16, 3/8, -1/4, 1/16}
}
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/8, 1/2, 1/2, 1/8}
},
on_punch = function(pos, node)
minetest.swap_node(pos, {name = "infrastructure:curve_chevron_dark", param2 = node.param2})
end,
mesecons = {effector = {
action_off = function (pos, node)
minetest.swap_node(pos, {name = "infrastructure:curve_chevron_dark", param2 = node.param2})
end
}}
})
minetest.register_alias("infrastructure:curve_chevron", "infrastructure:curve_chevron_dark")

View File

@@ -0,0 +1,107 @@
-- Emergency phone (only if enabled)
if ENABLE_EMERGENCY_PHONE then
minetest.register_node("infrastructure:emergency_phone_top", {
description = "Emergency phone",
tiles = {
"infrastructure_emergency_phone_top.png",
"infrastructure_emergency_phone_bottom.png",
"infrastructure_emergency_phone_side.png",
"infrastructure_emergency_phone_side.png",
"infrastructure_emergency_phone_side.png",
"infrastructure_emergency_phone_front.png"
},
drawtype = "nodebox",
drop = "streets:emergencyphone",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=1,not_in_creative_inventory=1},
light_source = EMERGENCY_PHONE_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
{-0.25, -0.5, -0.3125, -0.1875, 0.5, -0.25},
{0.1875, -0.5, -0.3125, 0.25, 0.5, -0.25},
{-0.1875, 0.4375, -0.3125, 0.1875, 0.5, -0.25}
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, -0.5, -0.25, 0.25, 0.5, 0.25},
{-0.25, -0.5, -0.3125, -0.1875, 0.5, -0.25},
{0.1875, -0.5, -0.3125, 0.25, 0.5, -0.25},
{-0.1875, 0.4375, -0.3125, 0.1875, 0.5, -0.25},
}
},
after_dig_node = function(pos)
pos.y = pos.y - 1
if minetest.get_node(pos).name == "infrastructure:emergency_phone_bottom" then
minetest.remove_node(pos)
end
end,
on_punch = function(pos, node, puncher)
if dial_handler ~= nil then
minetest.sound_stop(dial_handler)
dial_handler = nil
end
dial_handler = minetest.sound_play("infrastructure_emergency_phone", {
pos = pos,
gain = EMERGENCY_PHONE_VOLUME,
max_hear_distance = 50
})
if (puncher:is_player() and puncher:get_hp() < HEALTH_TO_RESTORING and puncher:get_hp() <= HEALTH_TO_TRIGGER) then
puncher:set_hp(HEALTH_TO_RESTORING)
minetest.chat_send_player(puncher:get_player_name(), "You got healed!")
minetest.chat_send_all("Server: -!- "..puncher:get_player_name().." used an emergency phone at "..pos.x..","..pos.y..","..pos.z);
end
end
})
minetest.register_node("infrastructure:emergency_phone_bottom", {
tiles = {"infrastructure_emergency_phone_bottom.png"},
drawtype = "nodebox",
drop = "streets:emergencyphone",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=1,not_in_creative_inventory=1},
node_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25}
},
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.5, 0.25}
},
after_dig_node = function(pos)
pos.y = pos.y+1
if minetest.get_node(pos).name == "infrastructure:emergency_phone_top" then
minetest.remove_node(pos)
end
end,
})
minetest.register_alias("infrastructure:emergency_phone", "infrastructure:emergency_phone_top")
minetest.register_abm({
nodenames = {"streets:emergencyphone"},
interval = 1,
chance = 1,
action = function(pos, node)
local node = minetest.get_node(pos)
local node_above = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z})
if node_above.name == "air" then
node.name = "infrastructure:emergency_phone_bottom"
minetest.set_node(pos, node)
pos.y = pos.y+1
end
node.name = "infrastructure:emergency_phone_top"
minetest.set_node(pos, node)
end,
})
else
print("Infrastructure mod: -!- Emergency-Phone is disabled!")
end

View File

@@ -0,0 +1,91 @@
-- Lane control lights
for i = 1, 6 do
local groups = {}
if i == 1 then
groups = {cracky = 3}
else
groups = {cracky = 3, not_in_creative_inventory = 1}
end
minetest.register_node("infrastructure:lane_control_lights_"..tostring(i), {
description = "Lane control lights",
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_lane_control_lights_"..tostring(i)..".png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "field[channel;Channel;${channel}]")
end,
groups = {cracky = 3, not_in_creative_inventory = (i == 1 and 0 or 1)},
light_source = TRAFFIC_LIGHTS_LIGHT_RANGE,
drop = "infrastructure:lane_control_lights_1",
node_box = {
type = "fixed",
fixed = {
{-7/16, -7/16, -1/8, 7/16, 7/16, 1/8},
{-7/16, 0, -1/4, -3/8, 7/16, -1/8},
{3/8, 0, -1/4, 7/16, 7/16, -1/8},
{-7/16, 3/8, -5/16, 7/16, 7/16, -1/8},
{-1/16, -1/4, 0, 1/16, 1/4, 1/2 - 0.001},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.001},
{-1/4, -1/16, 0, 1/4, 1/16, 1/2 - 0.001}
}
},
selection_box = {
type = "fixed",
fixed = {
{-7/16, -7/16, -1/8, 7/16, 7/16, 1/8},
{-7/16, 0, -1/4, -3/8, 7/16, -1/8},
{3/8, 0, -1/4, 7/16, 7/16, -1/8},
{-7/16, 3/8, -5/16, 7/16, 7/16, -1/8},
{-1/16, -1/4, 0, 1/16, 1/4, 1/2 - 0.001},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.001},
{-1/4, -1/16, 0, 1/4, 1/16, 1/2 - 0.001}
}
},
on_receive_fields = function(pos, formname, fields)
if (fields.channel) then
minetest.get_meta(pos):set_string("channel", fields.channel)
end
end,
digiline = {
receptor = {},
effector = {
action = function(pos, node, channel, msg)
local setchan = minetest.get_meta(pos):get_string("channel")
if setchan ~= channel or type(msg) ~= "string" then
return
end
msg = string.lower(msg)
if (msg=="off") then
node.name = "infrastructure:lane_control_lights_1"
elseif (msg=="green") then
node.name = "infrastructure:lane_control_lights_3"
elseif (msg=="red") then
node.name = "infrastructure:lane_control_lights_2"
elseif (msg=="yellowleft") then
node.name = "infrastructure:lane_control_lights_5"
elseif (msg=="yellowright") then
node.name = "infrastructure:lane_control_lights_4"
elseif (msg=="yellow") then
node.name = "infrastructure:lane_control_lights_6"
end
minetest.set_node(pos,node)
minetest.get_meta(pos):set_string("channel",setchan)
end
}
}
})
end
minetest.register_alias("infrastructure:lane_control_lights", "infrastructure:lane_control_lights_1")

View File

@@ -0,0 +1,237 @@
-- Road signs
local signs = {"stop", "yield", "right_of_way"}
for i, sign_name in ipairs(signs) do
minetest.register_node("infrastructure:road_sign_"..sign_name, {
description = "Road sign "..sign_name,
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_road_sign_"..sign_name.."_back.png",
"infrastructure_road_sign_"..sign_name.."_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2},
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 7/16, 1/2, 1/2, 7/16},
{-3/16, -1/8, 7/16, 3/16, 1/8, 1/2 - 0.001}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 7/16, 1/2, 1/2, 7/16},
{-3/16, -1/8, 7/16 + 0.01, 3/16, 1/8, 1/2 - 0.01}
}
},
after_place_node = function(pos, node)
local node = minetest.env:get_node(pos)
local param2 = node.param2
local sign_pos = {x=pos.x, y=pos.y, z=pos.z}
if param2 == 0 then
pos.z = pos.z + 1
elseif param2 == 1 then
pos.x = pos.x + 1
elseif param2 == 2 then
pos.z = pos.z - 1
elseif param2 == 3 then
pos.x = pos.x - 1
end
local node = minetest.env:get_node(pos)
if minetest.registered_nodes[node.name].drawtype == "fencelike" then
minetest.set_node(sign_pos, {name="infrastructure:road_sign_"..sign_name.."_on_post", param2=param2})
end
end
})
minetest.register_node("infrastructure:road_sign_"..sign_name.."_on_post", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_road_sign_"..sign_name.."_back.png",
"infrastructure_road_sign_"..sign_name.."_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2, not_in_creative_inventory = 1},
drop = "infrastructure:road_sign_"..sign_name,
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 7/16 + 3/8, 1/2, 1/2, 7/16 + 3/8},
{-3/16, 1/16, 7/16 + 3/8, 3/16, 1/8, 13/16 + 3/8 - 0.001},
{-3/16, -1/8, 7/16 + 3/8, 3/16, -1/16, 13/16 + 3/8 - 0.001}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 7/16 + 3/8, 1/2, 1/2, 7/16 + 3/8},
{-3/16, 1/16, 7/16 + 3/8 + 0.01, 3/16, 1/8, 13/16 + 3/8 - 0.01},
{-3/16, -1/8, 7/16 + 3/8 + 0.01, 3/16, -1/16, 13/16 + 3/8 - 0.01}
}
}
})
end
-- Road sign crosswalk
minetest.register_node("infrastructure:road_sign_crosswalk", {
description = "Road sign crosswalk",
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_road_sign_crosswalk_back.png",
"infrastructure_road_sign_crosswalk_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2},
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 7/16, 1/2, 1/2, 7/16},
{-3/16, -1/8, 7/16, 3/16, 1/8, 1/2 - 0.001}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 7/16, 1/2, 1/2, 7/16},
{-3/16, -1/8, 7/16, 3/16, 1/8, 1/2 - 0.001}
}
},
after_place_node = function(pos, node)
local node = minetest.env:get_node(pos)
local param2 = node.param2
local sign_pos = {x=pos.x, y=pos.y, z=pos.z}
if param2 == 0 then
pos.z = pos.z + 1
elseif param2 == 1 then
pos.x = pos.x + 1
elseif param2 == 2 then
pos.z = pos.z - 1
elseif param2 == 3 then
pos.x = pos.x - 1
end
local node = minetest.env:get_node(pos)
if param2 == 0 then
pos.z = pos.z - 2
elseif param2 == 1 then
pos.x = pos.x - 2
elseif param2 == 2 then
pos.z = pos.z + 2
elseif param2 == 3 then
pos.x = pos.x + 2
end
if minetest.registered_nodes[node.name].drawtype == "fencelike" then
minetest.set_node(sign_pos, {name="infrastructure:road_sign_crosswalk_on_post", param2=param2})
minetest.env:add_node(pos, {name="infrastructure:road_sign_retroreflective_surface_on_post", param2=param2})
else
minetest.env:add_node(pos, {name="infrastructure:road_sign_retroreflective_surface", param2=param2})
end
end
})
minetest.register_node("infrastructure:road_sign_crosswalk_on_post", {
description = "Road sign crosswalk",
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_road_sign_crosswalk_back.png",
"infrastructure_road_sign_crosswalk_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2, not_in_creative_inventory = 1},
drop = "infrastructure:road_sign_crosswalk",
node_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 7/16 + 3/8, 1/2, 1/2, 7/16 + 3/8},
{-3/16, 1/16, 7/16 + 3/8, 3/16, 1/8, 13/16 + 3/8 - 0.001},
{-3/16, -1/8, 7/16 + 3/8, 3/16, -1/16, 13/16 + 3/8 - 0.001}
}
},
selection_box = {
type = "fixed",
fixed = {
{-1/2, -1/2, 7/16 + 3/8, 1/2, 1/2, 7/16 + 3/8},
{-3/16, 1/16, 7/16 + 3/8 + 0.01, 3/16, 1/8, 13/16 + 3/8 - 0.01},
{-3/16, -1/8, 7/16 + 3/8 + 0.01, 3/16, -1/16, 13/16 + 3/8 - 0.01}
}
}
})
minetest.register_node("infrastructure:road_sign_retroreflective_surface", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_road_sign_retroreflective_surface.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2, not_in_creative_inventory = 1},
light_source = RETROREFLECTIVE_SURFACE_LIGHT_RANGE,
drop = "",
node_box = {
type = "fixed",
fixed = {-3/4, -3/4, 7/16 + 1 + 0.01, 3/4, 3/4, 7/16 + 1 + 0.01}
},
selection_box = {
type = "fixed",
fixed = {-3/4, -3/4, 7/16 + 1 + 0.01, 3/4, 3/4, 7/16 + 1 + 0.01}
}
})
minetest.register_node("infrastructure:road_sign_retroreflective_surface_on_post", {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_road_sign_retroreflective_surface.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 2, not_in_creative_inventory = 1},
light_source = RETROREFLECTIVE_SURFACE_LIGHT_RANGE,
drop = "",
node_box = {
type = "fixed",
fixed = {-3/4, -3/4, 7/16 + 3/8 + 1 + 0.01, 3/4, 3/4, 7/16 + 3/8 + 1 + 0.01}
},
selection_box = {
type = "fixed",
fixed = {-3/4, -3/4, 7/16 + 3/8 + 1 + 0.01, 3/4, 3/4, 7/16 + 3/8 + 1 + 0.01}
}
})

View File

@@ -0,0 +1,252 @@
-- Traffic lights for pedestrians
beep_handler = {}
function semaphores_pedestrians(pos, node)
local p = minetest.hash_node_position(pos)
if node.name == "infrastructure:traffic_lights_pedestrians_bottom_1" then
minetest.swap_node(pos, {name = "infrastructure:traffic_lights_pedestrians_bottom_2", param2 = node.param2})
pos.y = pos.y + 1
minetest.swap_node(pos, {name = "infrastructure:traffic_lights_pedestrians_top_2", param2 = node.param2})
elseif node.name == "infrastructure:traffic_lights_pedestrians_bottom_2" then
minetest.swap_node(pos, {name = "infrastructure:traffic_lights_pedestrians_bottom_3", param2 = node.param2})
pos.y = pos.y + 1
minetest.swap_node(pos, {name = "infrastructure:traffic_lights_pedestrians_top_3", param2 = node.param2})
beep_handler[p] = minetest.sound_play("infrastructure_traffic_lights_1", {
loop = true,
pos = pos,
gain = TRAFFIC_LIGHTS_VOLUME,
max_hear_distance = 50
})
elseif node.name == "infrastructure:traffic_lights_pedestrians_bottom_3" then
minetest.swap_node(pos, {name = "infrastructure:traffic_lights_pedestrians_bottom_4", param2 = node.param2})
if beep_handler[p] ~= nil then
minetest.sound_stop(beep_handler[p])
beep_handler[p] = nil
end
pos.y = pos.y + 1
minetest.swap_node(pos, {name = "infrastructure:traffic_lights_pedestrians_top_4", param2 = node.param2})
beep_handler[p] = minetest.sound_play("infrastructure_traffic_lights_2", {
loop = true,
pos = pos,
gain = TRAFFIC_LIGHTS_VOLUME,
max_hear_distance = 50
})
elseif node.name == "infrastructure:traffic_lights_pedestrians_bottom_4" then
minetest.swap_node(pos, {name = "infrastructure:traffic_lights_pedestrians_bottom_1", param2 = node.param2})
pos.y = pos.y + 1
minetest.swap_node(pos, {name = "infrastructure:traffic_lights_pedestrians_top_1", param2 = node.param2})
if beep_handler[p] ~= nil then
minetest.sound_stop(beep_handler[p])
beep_handler[p] = nil
end
end
end
function quiet(pos)
local p = minetest.hash_node_position(pos)
if beep_handler[p] ~= nil then
minetest.sound_stop(beep_handler[p])
beep_handler[p] = nil
end
end
for i = 1, 4 do
minetest.register_node("infrastructure:traffic_lights_pedestrians_top_"..tostring(i), {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_pedestrians_top_back.png",
"infrastructure_traffic_lights_pedestrians_top_front_"..tostring(i)..".png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=3, not_in_creative_inventory = 1},
light_source = TRAFFIC_LIGHTS_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-5/16, -1/2, -1/8, 5/16, 0, 1/8},
{-1/2, -1/2, -1/8, 1/2, 1/2, -1/8},
{-5/16, -1/8, -5/16, 5/16, -1/16, -1/8},
{-5/16, -3/8, -1/4, -1/4, -1/8, -1/8},
{1/4, -3/8, -1/4, 5/16, -1/8, -1/8},
{-1/8, 1/16, -1/8, 1/8, 5/16, 0},
{-1/16, 1/8, 0, 1/16, 1/4, 1/8},
{-1/16, 0, -1/16, 1/16, 1/8, 1/16}
}
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0}
}
})
minetest.register_node("infrastructure:traffic_lights_pedestrians_bottom_"..tostring(i), {
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_pedestrians_bottom_back.png",
"infrastructure_traffic_lights_pedestrians_bottom_front_"..tostring(i)..".png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3, not_in_creative_inventory = 1},
light_source = TRAFFIC_LIGHTS_LIGHT_RANGE,
drop = "infrastructure:traffic_lights_pedestrians_bottom_1",
node_box = {
type = "fixed",
fixed = {
{-5/16, -5/16, -1/8, 5/16, 1/2, 1/8},
{-1/2, -1/2, -1/8, 1/2, 1/2, -1/8},
{-5/16, 1/4, -5/16, 5/16, 5/16, -1/8},
{-5/16, 0, -1/4, -1/4, 1/4, -1/8},
{1/4, 0, -1/4, 5/16, 1/4, -1/8},
{-1/16, -1/4, 1/8, 1/16, 1/4, 3/8},
{-1/4, -1/16, 1/8, 1/4, 1/16, 3/8},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.001}
}
},
selection_box = {
type = "fixed",
fixed = {
-- box
{-5/16, -5/16, -1/8, 5/16, 1, 1/8},
-- top
{-5/16, -1/8 + 1, -5/16, 5/16, -1/16 + 1, -1/8},
{-5/16, -3/8 + 1, -1/4, -1/4, -1/8 + 1, -1/8},
{1/4, -3/8 + 1, -1/4, 5/16, -1/8 + 1, -1/8},
{-1/8, 1/16 + 1, -1/8, 1/8, 5/16 + 1, 0},
{-1/16, 1/8 + 1, 0, 1/16, 1/4 + 1, 1/8},
{-1/16, 0 + 1, -1/16, 1/16, 1/4 + 1, 1/16},
-- bottom
{-5/16, 1/4, -5/16, 5/16, 5/16, -1/8},
{-5/16, 0, -1/4, -1/4, 1/4, -1/8},
{1/4, 0, -1/4, 5/16, 1/4, -1/8},
{-1/16, -1/4, 1/8, 1/16, 1/4, 3/8},
{-1/4, -1/16, 1/8, 1/4, 1/16, 3/8},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.01}
}
},
after_place_node = function(pos)
local node = minetest.env:get_node(pos)
pos.y = pos.y + 1
node.name = "infrastructure:traffic_lights_pedestrians_top_"..tostring(i)
minetest.env:add_node(pos, node)
end,
after_dig_node = function(pos)
local node = minetest.env:get_node(pos)
quiet(pos)
pos.y = pos.y + 1
node.name = "infrastructure:traffic_lights_pedestrians_top_"..tostring(i)
minetest.env:remove_node(pos)
end,
on_punch = function(pos, node)
semaphores_pedestrians(pos, node)
end,
mesecons = {effector = {
action_on = function(pos, node)
semaphores_pedestrians(pos, node)
end
}}
})
end
minetest.register_node("infrastructure:traffic_lights_pedestrians_bottom_1", {
description = "Traffic lights for pedestrians",
inventory_image = "infrastructure_traffic_lights_pedestrians.png",
wield_image = "infrastructure_traffic_lights_pedestrians.png",
tiles = {
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_side.png",
"infrastructure_traffic_lights_pedestrians_bottom_back.png",
"infrastructure_traffic_lights_pedestrians_bottom_front_1.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 3, not_in_creative_inventory = 0},
light_source = TRAFFIC_LIGHTS_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-5/16, -5/16, -1/8, 5/16, 1/2, 1/8},
{-1/2, -1/2, -1/8, 1/2, 1/2, -1/8},
{-5/16, 1/4, -5/16, 5/16, 5/16, -1/8},
{-5/16, 0, -1/4, -1/4, 1/4, -1/8},
{1/4, 0, -1/4, 5/16, 1/4, -1/8},
{-1/16, -1/4, 1/8, 1/16, 1/4, 3/8},
{-1/4, -1/16, 1/8, 1/4, 1/16, 3/8},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.001}
}
},
selection_box = {
type = "fixed",
fixed = {
-- box
{-5/16, -5/16, -1/8, 5/16, 1, 1/8},
-- top
{-5/16, -1/8 + 1, -5/16, 5/16, -1/16 + 1, -1/8},
{-5/16, -3/8 + 1, -1/4, -1/4, -1/8 + 1, -1/8},
{1/4, -3/8 + 1, -1/4, 5/16, -1/8 + 1, -1/8},
{-1/8, 1/16 + 1, -1/8, 1/8, 5/16 + 1, 0},
{-1/16, 1/8 + 1, 0, 1/16, 1/4 + 1, 1/8},
{-1/16, 0 + 1, -1/16, 1/16, 1/8 + 1, 1/16},
-- bottom
{-5/16, 1/4, -5/16, 5/16, 5/16, -1/8},
{-5/16, 0, -1/4, -1/4, 1/4, -1/8},
{1/4, 0, -1/4, 5/16, 1/4, -1/8},
{-1/16, -1/4, 1/8, 1/16, 1/4, 3/8},
{-1/4, -1/16, 1/8, 1/4, 1/16, 3/8},
{-1/4, -1/4, 3/8, 1/4, 1/4, 1/2 - 0.01}
}
},
after_place_node = function(pos)
local node = minetest.env:get_node(pos)
pos.y = pos.y + 1
node.name = "infrastructure:traffic_lights_pedestrians_top_1"
minetest.env:add_node(pos, node)
end,
after_dig_node = function(pos)
local node = minetest.env:get_node(pos)
quiet(pos)
pos.y = pos.y + 1
node.name = "infrastructure:traffic_lights_pedestrians_top_1"
minetest.env:remove_node(pos)
end,
on_punch = function(pos, node)
semaphores_pedestrians(pos, node)
end,
mesecons = {effector = {
action_on = function(pos, node)
semaphores_pedestrians(pos, node)
end
}}
})
minetest.register_alias("infrastructure:traffic_lights_pedestrians", "infrastructure:traffic_lights_pedestrians_bottom_1")

View File

@@ -0,0 +1,47 @@
-- Warning light
minetest.register_node("infrastructure:warning_light", {
description = "Warning light",
tiles = {
"infrastructure_warning_light_top.png",
"infrastructure_warning_light_bottom.png",
"infrastructure_warning_light_right.png",
"infrastructure_warning_light_left.png",
"infrastructure_warning_light_back.png",
{name="infrastructure_warning_light_front_anim.png",animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=3}},
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky = 1},
light_source = WARNING_LIGHT_LIGHT_RANGE,
node_box = {
type = "fixed",
fixed = {
{-5/16, -3/8, 0, 5/16, 0, 0},
{-1/4, -5/16, 0, 0, -1/16, 1/8},
{1/16, -1/2, -1/8, 5/16, -1/4, 1/8},
{-1/16, -1/2, -1/16, 1/16, -3/8, 1/16}
}
},
selection_box = {
type = "fixed",
fixed = {
{-5/16, -3/8, 0, 5/16, 0, 0},
{-1/4, -5/16, 0 + 0.01, 0, -1/16, 1/8},
{1/16, -1/2, -1/8, 5/16, -1/4, 1/8},
{-1/16, -1/2, -1/16, 1/16, -3/8, 1/16}
}
}
})
minetest.register_alias("infrastructure:warning_light_bright", "infrastructure:warning_light")
minetest.register_alias("infrastructure:warning_light_dark", "infrastructure:warning_light")

View File

@@ -0,0 +1,443 @@
-- **************************************************************************************************** MATERIALS
-- Galvanized steel
if minetest.get_modpath("technic") then
technic.register_alloy_recipe({input = {"default:steel_ingot 6", "technic:zinc_ingot 1"}, output = "infrastructure:galvanized_steel 6", time = 4})
else
minetest.register_craft({
output = '"infrastructure:galvanized_steel" 6',
recipe = {
{'', 'default:copper_ingot', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}
}
})
end
-- Galvanized steel fence
minetest.register_craft({
output = '"infrastructure:fence_galvanized_steel" 6',
recipe = {
{'infrastructure:galvanized_steel', 'infrastructure:galvanized_steel', 'infrastructure:galvanized_steel'},
{'infrastructure:galvanized_steel', 'infrastructure:galvanized_steel', 'infrastructure:galvanized_steel'}
}
})
-- **************************************************************************************************** PRECAST CONCRETE
-- Concrete seperating wall
minetest.register_craft({
output = '"infrastructure:precast_concrete_seperating_wall" 5',
recipe = {
{'', 'infrastructure:concrete', ''},
{'', 'infrastructure:concrete', ''},
{'infrastructure:concrete', 'infrastructure:concrete', 'infrastructure:concrete'}
}
})
-- Concrete cylinder
minetest.register_craft({
output = '"infrastructure:precast_concrete_cylinder" 8',
recipe = {
{'infrastructure:concrete', 'infrastructure:concrete', 'infrastructure:concrete'},
{'infrastructure:concrete', '', 'infrastructure:concrete'},
{'infrastructure:concrete', 'infrastructure:concrete', 'infrastructure:concrete'}
}
})
-- Concrete grid paver
minetest.register_craft({
output = '"infrastructure:precast_concrete_grid_paver" 5',
recipe = {
{'infrastructure:concrete', '', 'infrastructure:concrete'},
{'', 'infrastructure:concrete', ''},
{'infrastructure:concrete', '', 'infrastructure:concrete'}
}
})
-- **************************************************************************************************** STEEL STRUCTURES
-- Truss
minetest.register_craft({
output = '"infrastructure:truss" 5',
recipe = {
{'infrastructure:galvanized_steel', '', 'infrastructure:galvanized_steel'},
{'', 'infrastructure:galvanized_steel', ''},
{'infrastructure:galvanized_steel', '', 'infrastructure:galvanized_steel'}
}
})
-- Wire netting
minetest.register_craft({
output = '"infrastructure:wire_netting" 10',
recipe = {
{'', 'infrastructure:galvanized_steel', ''},
{'infrastructure:galvanized_steel', '', 'infrastructure:galvanized_steel'},
{'', 'infrastructure:galvanized_steel', ''}
}
})
-- Razor wire
minetest.register_craft({
output = '"infrastructure:razor_wire" 5',
recipe = {
{'infrastructure:galvanized_steel'},
{'default:cactus'},
{'infrastructure:galvanized_steel'}
}
})
-- Drainage channel grating
minetest.register_craft({
output = '"infrastructure:drainage_channel_grating" 2',
recipe = {
{'infrastructure:galvanized_steel', '', 'infrastructure:galvanized_steel'}
}
})
-- Louver
minetest.register_craft({
output = '"infrastructure:drainage_channel_grating" 2',
recipe = {
{'infrastructure:galvanized_steel'},
{''},
{'infrastructure:galvanized_steel'}
}
})
-- Riffled sheet
minetest.register_craft({
output = '"infrastructure:riffled_sheet" 4',
recipe = {
{'infrastructure:galvanized_steel', 'infrastructure:fence_galvanized_steel'},
{'infrastructure:fence_galvanized_steel', 'infrastructure:galvanized_steel'}
}
})
-- Corrugated sheet
minetest.register_craft({
output = '"infrastructure:corrugated_sheet" 4',
recipe = {
{"","infrastructure:galvanized_steel",""},
{"infrastructure:galvanized_steel","","infrastructure:galvanized_steel"}
}
})
-- Louvers
minetest.register_craft({
output = "infrastructure:louver_opened",
recipe = {
{"infrastructure:fence_galvanized_steel","infrastructure:galvanized_steel","infrastructure:fence_galvanized_steel"},
{"","",""},
{"infrastructure:fence_galvanized_steel","infrastructure:galvanized_steel","infrastructure:fence_galvanized_steel"}
}
})
-- **************************************************************************************************** ADVANCED ITEMS
-- Raised pavement marker yellow/yellow
minetest.register_craft({
output = '"infrastructure:marker_yellow_yellow" 1',
recipe = {
{'wool:yellow', 'infrastructure:asphalt', 'wool:yellow'},
{'infrastructure:asphalt', 'infrastructure:asphalt', 'infrastructure:asphalt'}
}
})
-- Raised pavement marker red/yellow
minetest.register_craft({
output = '"infrastructure:marker_red_yellow" 1',
recipe = {
{'wool:yellow', 'infrastructure:asphalt', 'wool:red'},
{'infrastructure:asphalt', 'infrastructure:asphalt', 'infrastructure:asphalt'}
}
})
-- Retroreflective delineators
minetest.register_craft({
output = '"infrastructure:delineator" 1',
recipe = {
{'wool:yellow', 'infrastructure:concrete', 'wool:red'},
{'', 'infrastructure:concrete', ''},
{'', 'infrastructure:concrete', ''}
}
})
minetest.register_craft({
output = '"infrastructure:delineator_guardrail" 1',
recipe = {
{'wool:yellow', 'infrastructure:concrete', 'wool:red'},
{'', 'infrastructure:concrete', ''}
}
})
-- Wire rope safety barrier
minetest.register_craft({
output = '"infrastructure:wire_rope_safety_barrier" 1',
recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'},
{'', 'default:steel_ingot', ''},
{'', 'default:steel_ingot', ''}
}
})
-- Cable barrier terminal
minetest.register_craft({
output = '"infrastructure:cable_barrier_terminal" 1',
recipe = {
{'default:steel_ingot', '', ''},
{'', 'default:steel_ingot', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}
}
})
-- Corrugated guide rail
minetest.register_craft({
output = '"infrastructure:corrugated_guide_rail" 1',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', 'default:steel_ingot', ''},
{'', 'default:steel_ingot', ''}
}
})
-- Energy absorbing terminal
minetest.register_craft({
output = '"infrastructure:energy_absorbing_terminal" 1',
recipe = {
{'', 'default:steel_ingot', ''},
{'default:steel_ingot', 'default:steel_ingot', ''},
{'', 'default:steel_ingot', ''}
}
})
minetest.register_craft({
output = '"infrastructure:energy_absorbing_terminal" 1',
recipe = {
{'infrastructure:energy_absorbing_terminal_inversed'}
}
})
minetest.register_craft({
output = '"infrastructure:energy_absorbing_terminal_inversed" 1',
recipe = {
{'infrastructure:energy_absorbing_terminal'}
}
})
-- Fitch barrel
minetest.register_craft({
output = '"infrastructure:fitch_barrel" 1',
recipe = {
{'wool:black', 'wool:black', 'wool:black'},
{'wool:yellow', 'default:sand', 'wool:yellow'},
{'wool:yellow', 'wool:yellow', 'wool:yellow'}
}
})
-- Crowd control barricade
minetest.register_craft({
output = '"infrastructure:crowd_control_barricade" 1',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', '', 'default:steel_ingot'}
}
})
if ENABLE_EMERGENCY_PHONE then
-- Emergency phone
minetest.register_craft({
output = '"infrastructure:emergency_phone" 1',
recipe = {
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'default:mese_crystal', 'default:apple', 'default:mese_crystal'},
{'default:mese_crystal', 'default:stick', 'default:mese_crystal'}
}
})
minetest.register_craft({
output = '"infrastructure:emergency_phone" 1',
recipe = {
{'default:mese', 'default:mese', 'default:mese'},
{'default:mese', 'default:apple', 'default:mese'},
{'default:mese', 'default:stick', 'default:mese'}
}
})
end
-- Manhole cover
minetest.register_craft({
output = '"infrastructure:manhole_cover_closed" 1',
recipe = {
{'infrastructure:concrete', 'infrastructure:concrete', 'infrastructure:concrete'},
{'infrastructure:concrete', 'default:steel_ingot', 'infrastructure:concrete'},
{'infrastructure:concrete', 'infrastructure:concrete', 'infrastructure:concrete'}
}
})
-- Traffic lights for pedestrians
minetest.register_craft({
output = '"infrastructure:traffic_lights_pedestrians" 1',
recipe = {
{'', 'default:steel_ingot', ''},
{'default:steel_ingot', 'wool:red', 'default:steel_ingot'},
{'default:steel_ingot', 'wool:green', 'default:steel_ingot'}
}
})
-- Crosswalk warning light
minetest.register_craft({
output = '"infrastructure:crosswalk_warning_light" 1',
recipe = {
{'', 'default:steel_ingot', ''},
{'default:steel_ingot', 'wool:yellow', 'default:steel_ingot'},
{'', 'wool:green', ''}
}
})
-- Curve chevron
minetest.register_craft({
output = '"infrastructure:curve_chevron" 1',
recipe = {
{'wool:yellow', 'wool:black', 'wool:yellow'},
{'wool:black', 'wool:yellow', 'wool:yellow'},
{'wool:yellow', 'wool:black', 'wool:yellow'}
}
})
-- Crosswalk lighting
minetest.register_craft({
output = '"infrastructure:crosswalk_lighting" 1',
recipe = {
{'wool:white', 'wool:white', 'wool:white'},
{'', 'mesecons_torch:mesecon_torch_on', ''},
{'wool:white', 'wool:white', 'wool:white'}
}
})
-- Crosswalk safety sign
minetest.register_craft({
output = '"infrastructure:crosswalk_safety_sign" 1',
recipe = {
{'', 'wool:green', ''},
{'', 'wool:green', ''},
{'infrastructure:concrete', 'infrastructure:concrete', 'infrastructure:concrete'}
}
})
-- Road sign crosswalk
minetest.register_craft({
output = '"infrastructure:road_sign_crosswalk" 1',
recipe = {
{'wool:green', 'wool:green', 'wool:green'},
{'wool:green', 'wool:blue', 'wool:green'},
{'wool:green', 'wool:green', 'wool:green'}
}
})
-- Road sign right_of_way
minetest.register_craft({
output = '"infrastructure:road_sign_right_of_way" 1',
recipe = {
{"", 'wool:white', ""},
{'wool:white', 'wool:yellow', 'wool:white'},
{"", 'wool:white', ""}
}
})
-- Road sign stop
minetest.register_craft({
output = '"infrastructure:road_sign_stop" 1',
recipe = {
{'wool:red', 'wool:red', 'wool:red'},
{'wool:red', 'wool:white', 'wool:red'},
{'wool:red', 'wool:red', 'wool:red'}
}
})
-- Road sign yield
minetest.register_craft({
output = '"infrastructure:road_sign_yield" 1',
recipe = {
{'wool:orange', 'wool:orange', 'wool:orange'},
{'wool:red', 'wool:orange', 'wool:red'},
{'', 'wool:red', ''}
}
})
-- Automatic warning device
minetest.register_craft({
output = '"infrastructure:automatic_warning_device" 1',
recipe = {
{'wool:red', 'default:steel_ingot', 'wool:red'},
{'', 'default:steel_ingot', ''},
{'infrastructure:concrete', 'infrastructure:concrete', 'infrastructure:concrete'}
}
})
-- Boom barrier
minetest.register_craft({
output = '"infrastructure:boom_barrier_mechanism" 1',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', ''},
{'', 'default:steel_ingot', ''},
{'infrastructure:concrete', 'infrastructure:concrete', 'infrastructure:concrete'}
}
})
minetest.register_craft({
output = '"infrastructure:boom_barrier_arm" 1',
recipe = {
{'', 'wool:red', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}
}
})
-- Aircraft warning light
minetest.register_craft({
output = '"infrastructure:aircraft_warning_light" 1',
recipe = {
{'', 'wool:red', ''},
{'wool:red', 'default:torch', 'wool:red'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}
}
})
-- Warning light
minetest.register_craft({
output = '"infrastructure:warning_light" 1',
recipe = {
{'wool:yellow', 'wool:yellow', ''},
{'wool:yellow', 'default:torch', ''},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}
}
})
-- Anti-dazzling panel
minetest.register_craft({
output = '"infrastructure:anti_dazzling_panel" 1',
recipe = {
{'wool:grey', 'wool:grey'},
{'wool:grey', 'wool:yellow'},
{'wool:grey', 'wool:grey'}
}
})
-- Traffic cone
minetest.register_craft({
output = '"infrastructure:traffic_cone" 1',
recipe = {
{'', 'wool:orange', ''},
{'wool:orange', '', 'wool:orange'},
}
})
-- Noise barrier
minetest.register_craft({
output = '"infrastructure:noise_barrier" 1',
recipe = {
{'default:steel_ingot', 'wool:green', 'default:steel_ingot'},
{'wool:green', 'default:steel_ingot', 'wool:green'},
{'default:steel_ingot', 'wool:green', 'default:steel_ingot'}
}
})

View File

@@ -0,0 +1,6 @@
sounds
moreblocks?
wool?
streetsmod
digilines?
technic?

View File

@@ -0,0 +1,26 @@
infrastructure = {}
-- Load settings
dofile(minetest.get_modpath("infrastructure").."/settings.lua")
-- Register nodes
dofile(minetest.get_modpath("infrastructure").."/nodes.lua")
-- Register special nodes
dofile(minetest.get_modpath("infrastructure").."/nodes_extension.lua")
-- Register advanced devices
dofile(minetest.get_modpath("infrastructure").."/advanced_road_signs.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_emergency_phone.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_traffic_lights_pedestrians.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_crosswalk_warning_light.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_lane_control_lights.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_curve_chevron.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_crosswalk_lighting.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_crosswalk_safety_sign.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_automatic_warning_device.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_boom_barrier.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_aircraft_warning_light.lua")
dofile(minetest.get_modpath("infrastructure").."/advanced_warning_light.lua")
-- Register crafting recipes
dofile(minetest.get_modpath("infrastructure").."/crafts.lua")
print("Infrastructure mod loaded succesfully!")

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,163 @@
--[[-- **************************************************************************************************** MATERIALS
-- Galvanized steel stair, slab, panel and microblock
register_stair_slab_panel_micro("infrastructure", "galvanized_steel", "infrastructure:galvanized_steel",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=2},
{"infrastructure_galvanized_steel.png"},
"Galvanized steel",
"galvanized_steel",
0)
-- **************************************************************************************************** CENTER LINES
-- Asphalt stair, slab, panel and microblock with center solid line
register_stair_slab_panel_micro("infrastructure", "asphalt_center_solid_line", "infrastructure:asphalt_center_solid_line",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{
"streets_asphalt.png^infrastructure_single_yellow_line.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png"
},
"Asphalt with center solid line",
"asphalt_center_solid_line",
0)
-- Asphalt stair, slab, panel and microblock with center solid line on one side
register_stair_slab_panel_micro("infrastructure", "asphalt_center_solid_one_side", "infrastructure:asphalt_center_solid_one_side",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{
"streets_asphalt.png^infrastructure_solid_yellow_line_one_side.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png"
},
"Asphalt with center solid line on one side",
"asphalt_center_solid_one_side",
0)
-- Asphalt stair, slab, panel and microblock with center solid double line
register_stair_slab_panel_micro("infrastructure", "asphalt_center_solid_double", "infrastructure:asphalt_center_solid_double",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{
"streets_asphalt.png^infrastructure_double_yellow_line.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png"
},
"Asphalt with center solid double line",
"asphalt_center_solid_double",
0)
-- Asphalt block with center corner single line
register_stair_slab_panel_micro("infrastructure", "asphalt_center_corner_single", "infrastructure:asphalt_center_corner_single",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{
"streets_asphalt.png^infrastructure_single_yellow_line_corner.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png"
},
"Asphalt with center corner single line",
"asphalt_center_corner_single",
0)
-- Asphalt block with center corner double line
register_stair_slab_panel_micro("infrastructure", "asphalt_center_corner_double", "infrastructure:asphalt_center_corner_double",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{
"streets_asphalt.png^infrastructure_solid_double_yellow_line_corner.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png",
"streets_asphalt.png"
},
"Asphalt with center corner double line",
"asphalt_center_corner_double",
0)
-- **************************************************************************************************** TRAFFIC MARKS
-- Asphalt stair, slab, panel and microblock with arrow straight
register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_straight", "infrastructure:asphalt_arrow_straight",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{"streets_arrow_straight.png", "infrastructure_asphalt.png"},
"Asphalt with arrow straight",
"asphalt_arrow_straight",
0)
-- Asphalt stair, slab, panel and microblock with arrow straight + left
register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_straight_left", "infrastructure:asphalt_arrow_straight_left",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{"streets_asphalt.png^streets_arrow_straight_left.png", "infrastructure_asphalt.png"},
"Asphalt with arrow straight + left",
"asphalt_arrow_straight_left",
0)
-- Asphalt stair, slab, panel and microblock with arrow straight + right
register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_straight_right", "infrastructure:asphalt_arrow_straight_right",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{"streets_asphalt.png^streets_arrow_straight_right.png", "infrastructure_asphalt.png"},
"Asphalt with arrow straight + right",
"asphalt_arrow_straight_right",
0)
-- Asphalt stair, slab, panel and microblock with arrow left
register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_left", "infrastructure:asphalt_arrow_left",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{"streets_asphalt.png^streets_arrow_left.png", "infrastructure_asphalt.png"},
"Asphalt with arrow left",
"asphalt_arrow_left",
0)
-- Asphalt stair, slab, panel and microblock with arrow right
register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_right", "infrastructure:asphalt_arrow_right",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{"streets_asphalt.png^streets_arrow_right.png", "infrastructure_asphalt.png"},
"Asphalt with arrow right",
"asphalt_arrow_right",
0)
-- Asphalt stair, slab, panel and microblock with "P"-sign
register_stair_slab_panel_micro("infrastructure", "asphalt_parking", "infrastructure:asphalt_parking",
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1},
{"streets_asphalt.png^streets_parking.png", "infrastructure_asphalt.png"},
"Asphalt with a parking sign",
"asphalt_parking",
0)
-- Register known infrastructure nodes in circular saw if avaiable
if circular_saw then
for i,v in ipairs({
-- Materials
"asphalt",
"concrete",
"galvanized_steel",
-- Center lines
"asphalt_center_dashed",
"asphalt_center_solid",
"asphalt_center_solid_one_side",
"asphalt_center_solid_double",
"asphalt_center_corner_single",
"asphalt_center_corner_double",
-- Traffic marks
"asphalt_arrow_straight",
"asphalt_arrow_straight_left",
"asphalt_arrow_straight_right",
"asphalt_arrow_left",
"asphalt_arrow_right",
"asphalt_parking"
}) do
table.insert(circular_saw.known_stairs, "infrastructure:"..v);
end
end
]]--

View File

@@ -0,0 +1,49 @@
-- This file stores all settings for the "Infrastructure mod"
-- Stairs, slabs, panels and microblocks
NOT_IN_CREATIVE_INVENTORY = 1 -- an integer 0 or 1 -> default = 1 | Do you want it to be hide in your creative inventory?
-- Raised pavement marker
MARKER_LIGHT_RANGE = 4 -- an integer -> default = 4 | How much light do you want it to give?
-- Retroreflective delineator
DELINEATOR_LIGHT_RANGE = 8 -- an integer -> default = 8 | How much light do you want it to give?
-- Energy absorbing terminal
ENERGY_ABSORBING_TERMINAL_LIGHT_RANGE = 8 -- an integer -> default = 8 | How much light do you want it to give?
-- Emergency phone
ENABLE_EMERGENCY_PHONE = true -- true or false -> default = true | Do you want it to be enabled in your game?
HEALTH_TO_TRIGGER = 5 -- an integer -> default = 5 | When will the player be healed? How low must his health be?
HEALTH_TO_RESTORING = 10 -- an integer -> default = 10 | To what will the health be set?
EMERGENCY_PHONE_LIGHT_RANGE = 12 -- an integer -> default = 12 | How much light do you want it to give?
EMERGENCY_PHONE_VOLUME = 0.1 -- a float -> default = 0.1 | How noisy should be the dialing sound?
-- Traffic lights
TRAFFIC_LIGHTS_LIGHT_RANGE = 12 -- an integer -> default = 12 | How much light do you want it to give?
TRAFFIC_LIGHTS_VOLUME = 0 -- a float -> default = 0.1 | How noisy should be the beep sound?
-- Automatic warning device
AUTOMATIC_WARNING_DEVICE_LIGHT_RANGE = 12 -- an integer -> default = 12 | How much light do you want it to give?
AUTOMATIC_WARNING_DEVICE_VOLUME = 0.5 -- a float -> default = 0.5 | How noisy should be the bell sound?
-- Boom barrier
BOOM_BARRIER_LIGHT_RANGE = 6 -- an integer -> default = 6 | How much light do you want it to give?
BOOM_BARRIER_VOLUME = 0.4 -- a float -> default = 0.1 | How noisy should be the mechanism sound?
-- Curve chevron
CURVE_CHEVRON_LIGHT_RANGE = 12 -- an integer -> default = 12 | How much light do you want it to give?
-- Crosswalk lighting
CROSSWALK_LIGHTING_LIGHT_RANGE = 14 -- an integer -> default = 14 | How much light do you want it to give?
-- Crosswalk safety sign
CROSSWALK_SAFETY_SIGN_LIGHT_RANGE = 8 -- an integer -> default = 8 | How much light do you want it to give?
-- Crosswalk safety sign
RETROREFLECTIVE_SURFACE_LIGHT_RANGE = 8 -- an integer -> default = 8 | How much light do you want it to give?
-- Aircraft warning light
AIRCRAFT_WARNING_LIGHT_LIGHT_RANGE = 14 -- an integer -> default = 14 | How much light do you want it to give?
-- Warning light
WARNING_LIGHT_LIGHT_RANGE = 14 -- an integer -> default = 14 | How much light do you want it to give?

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1019 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1021 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 988 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

Some files were not shown because too many files have changed in this diff Show More