From f2da2d6f1e3c4361d7ae9414d969a2f20e7dd361 Mon Sep 17 00:00:00 2001 From: Thomas--S Date: Thu, 8 Sep 2016 21:52:24 +0200 Subject: [PATCH] Adding Chainlink Fence and Preparing the mod for release --- api.lua | 10 +- api_register_all.lua | 45 +- global.lua | 6 +- init.lua | 6 +- streets_accessories/init.lua | 137 +++- streets_asphaltworkshop/init.lua | 20 +- streets_bollards/init.lua | 80 ++- streets_concrete/init.lua | 34 +- streets_installations/init.lua | 103 +-- streets_laneuse/init.lua | 64 +- streets_matrix_screen/init.lua | 9 + streets_poles/init.lua | 332 +++++----- streets_roadmarkings/init.lua | 86 +-- streets_roadsurface/init.lua | 34 +- streets_roadwork/init.lua | 206 +++--- streets_rrxing/init.lua | 528 ++++++++-------- streets_signs/init.lua | 6 + streets_signworkshop/init.lua | 121 ++-- streets_steelsupport/init.lua | 14 +- streets_trafficlight/init.lua | 1000 +++++++++++++++--------------- todo.txt | 18 +- 21 files changed, 1539 insertions(+), 1320 deletions(-) diff --git a/api.lua b/api.lua index deb7b43..a622c90 100644 --- a/api.lua +++ b/api.lua @@ -5,15 +5,15 @@ Category: Init ]] -local function copytable(orig) +function streets.copytable(orig) local orig_type = type(orig) local copy if orig_type == 'table' then copy = {} for orig_key, orig_value in next, orig, nil do - copy[copytable(orig_key)] = copytable(orig_value) + copy[streets.copytable(orig_key)] = streets.copytable(orig_value) end - setmetatable(copy, copytable(getmetatable(orig))) + setmetatable(copy, streets.copytable(getmetatable(orig))) else copy = orig end @@ -33,11 +33,11 @@ function streets.load_submod(dirname) end function streets.register_road_surface(data) - streets.surfaces.surfacetypes["streets:"..data.name] = data + streets.surfaces.surfacetypes["streets:" .. data.name] = data end function streets.register_road_sign(data) - streets.signs.signtypes["streets:"..data.name] = data + streets.signs.signtypes["streets:" .. data.name] = data end function streets.register_road_marking(data) diff --git a/api_register_all.lua b/api_register_all.lua index e6e5b4a..dfded8e 100644 --- a/api_register_all.lua +++ b/api_register_all.lua @@ -5,21 +5,6 @@ Category: Init ]] -local function copytable(orig) - local orig_type = type(orig) - local copy - if orig_type == 'table' then - copy = {} - for orig_key, orig_value in next, orig, nil do - copy[copytable(orig_key)] = copytable(orig_value) - end - setmetatable(copy, copytable(getmetatable(orig))) - else - copy = orig - end - return copy -end - local register_surface_nodes = function(friendlyname, name, tiles, groups, sounds, craft) minetest.register_node(":streets:" .. name, { description = friendlyname, @@ -62,20 +47,28 @@ local register_sign_node = function(friendlyname, name, tiles, thickness) behind_pos.x = behind_pos.x - 1 end local behind_node = minetest.get_node(behind_pos) + local behind_nodes = {} + behind_nodes["streets:roadwork_traffic_barrier"] = true + behind_nodes["streets:concrete_wall"] = true + behind_nodes["technic:concrete_post"] = true local under_pos = { x = pos.x, y = pos.y - 1, z = pos.z } local under_node = minetest.get_node(under_pos) + local under_nodes = {} + under_nodes["streets:roadwork_traffic_barrier"] = true + under_nodes["streets:concrete_wall"] = true + under_nodes["technic:concrete_post"] = true local upper_pos = { x = pos.x, y = pos.y + 1, z = pos.z } local upper_node = minetest.get_node(upper_pos) - if minetest.registered_nodes[behind_node.name].groups.bigpole then - if minetest.registered_nodes[behind_node.name].streets_pole_connection[param2][behind_node.param2 + 1] ~= 1 then - node.name = node.name .. "_polemount" - minetest.set_node(pos, node) - end - elseif minetest.registered_nodes[under_node.name].groups.bigpole then - if minetest.registered_nodes[under_node.name].streets_pole_connection["t"][under_node.param2 + 1] == 1 then - node.name = node.name .. "_center" - minetest.set_node(pos, node) - end + if (minetest.registered_nodes[behind_node.name].groups.bigpole + and minetest.registered_nodes[behind_node.name].streets_pole_connection[param2][behind_node.param2 + 1] ~= 1) + or behind_nodes[behind_node.name] == true then + node.name = node.name .. "_polemount" + minetest.set_node(pos, node) + elseif (minetest.registered_nodes[under_node.name].groups.bigpole + and minetest.registered_nodes[under_node.name].streets_pole_connection["t"][under_node.param2 + 1] == 1) + or under_nodes[under_node.name] then + node.name = node.name .. "_center" + minetest.set_node(pos, node) elseif minetest.registered_nodes[upper_node.name].groups.bigpole then if minetest.registered_nodes[upper_node.name].streets_pole_connection["b"][upper_node.param2 + 1] == 1 then node.name = node.name .. "_center" @@ -222,7 +215,7 @@ local register_marking_nodes = function(surface_friendlyname, surface_name, surf tiles[1] = tiles[1] .. "^(" .. tex .. ")" tiles[5] = tiles[5] .. "^(" .. tex .. ")^[transformR180" tiles[6] = tiles[6] .. "^(" .. tex .. ")" - local groups = copytable(surface_groups) + local groups = streets.copytable(surface_groups) groups.not_in_creative_inventory = 1 minetest.register_node(":streets:mark_" .. name:gsub("{color}", colorname:lower()) .. r .. "_on_" .. surface_name, { description = surface_friendlyname .. " with Marking: " .. friendlyname .. rotation_friendly .. " " .. colorname, diff --git a/global.lua b/global.lua index 0f1c0e1..83567ff 100644 --- a/global.lua +++ b/global.lua @@ -8,11 +8,11 @@ streets.nodeboxes = {} streets.nodeboxes.stair = { - {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, - {-0.5, 0, 0, 0.5, 0.5, 0.5} + { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }, + { -0.5, 0, 0, 0.5, 0.5, 0.5 } } streets.nodeboxes.slab = { - {-0.5, -0.5, -0.5, 0.5, 0, 0.5} + { -0.5, -0.5, -0.5, 0.5, 0, 0.5 } } if minetest.get_modpath("concrete") then diff --git a/init.lua b/init.lua index 6205c87..5fcf1d9 100644 --- a/init.lua +++ b/init.lua @@ -18,9 +18,9 @@ streets.conf = { } -- The API collects some data here -streets.surfaces = {surfacetypes = {}} -streets.labels = {labeltypes = {}} -streets.signs = {signtypes = {}} +streets.surfaces = { surfacetypes = {} } +streets.labels = { labeltypes = {} } +streets.signs = { signtypes = {} } -- Load the API file dofile(streets.conf.modpath .. "/api.lua") diff --git a/streets_accessories/init.lua b/streets_accessories/init.lua index 24be4c4..a047eed 100644 --- a/streets_accessories/init.lua +++ b/streets_accessories/init.lua @@ -6,24 +6,151 @@ minetest.register_node(":streets:delineator", { description = "Delineator", - tiles = {"streets_delineator_top.png", "streets_delineator_top.png", "streets_delineator_left.png", "streets_delineator_right.png", "streets_delineator_back.png", "streets_delineator_front.png"}, + tiles = { "streets_delineator_top.png", "streets_delineator_top.png", "streets_delineator_left.png", "streets_delineator_right.png", "streets_delineator_back.png", "streets_delineator_front.png" }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {snappy = 2}, + groups = { snappy = 2 }, light_source = 2, sunlight_propagates = true, node_box = { type = "fixed", fixed = { - {-0.125, -0.5, -0.0625, 0.125, 0.4375, 0.0625}, -- Body - {0, 0.4375, -0.0625, 0.125, 0.5, 0.0625}, -- Top + { -0.125, -0.5, -0.0625, 0.125, 0.4375, 0.0625 }, -- Body + { 0, 0.4375, -0.0625, 0.125, 0.5, 0.0625 }, -- Top } }, selection_box = { type = "fixed", fixed = { - {-0.125, -0.5, -0.0625, 0.125, 0.5, 0.0625}, -- Body + { -0.125, -0.5, -0.0625, 0.125, 0.5, 0.0625 }, -- Body } } }) + +minetest.register_craft({ + output = "streets:delineator 10", + recipe = { + { "dye:orange", "default:steel_ingot", "dye:orange" }, + { "dye:white", "default:steel_ingot", "dye:black" } + } +}) + +minetest.register_node("streets:fence_chainlink", { + description = "Chainlink Fence", + paramtype = "light", + drawtype = "nodebox", + tiles = { "streets_fence_chainlink.png" }, + sunlight_propagates = true, + groups = { snappy = 1, wall = 1 }, + node_box = { + type = "connected", + fixed = { { -1 / 32, -0.5, -1 / 32, 1 / 32, 0.5, 1 / 32 } }, + connect_front = { { 0, -0.5, -0.5, 0, 0.5, 0 } }, -- z- + connect_back = { { 0, -0.5, 0, 0, 0.5, 0.5 } }, -- z+ + connect_left = { { -0.5, -0.5, 0, 0, 0.5, 0 } }, -- x- + connect_right = { { 0, -0.5, 0, 0.5, 0.5, 0 } }, -- x+ + }, + selection_box = { + type = "connected", + fixed = { { -1 / 16, -0.5, -1 / 16, 1 / 16, 0.5, 1 / 16 } }, + connect_front = { { 0, -0.5, -0.5, 0, 0.5, 0 } }, -- z- + connect_back = { { 0, -0.5, 0, 0, 0.5, 0.5 } }, -- z+ + connect_left = { { -0.5, -0.5, 0, 0, 0.5, 0 } }, -- x- + connect_right = { { 0, -0.5, 0, 0.5, 0.5, 0 } }, -- x+ + }, + connects_to = { "group:wall", "group:stone", "group:wood", "group:tree", "group:concrete" }, + sound = default.node_sound_stone_defaults() +}) + +function toggleDoor(pos, node, player, action) + local name = player:get_player_name() + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then + minetest.record_protection_violation(pos, name) + return + end + local newnode = node + if action == "close" then + newnode.name = node.name:gsub("open", "closed") + elseif action == "open" then + newnode.name = node.name:gsub("closed", "open") + end + minetest.swap_node(pos, newnode) + local upper_pos = streets.copytable(pos) + upper_pos.y = upper_pos.y + 1 + local upper_node = minetest.get_node(upper_pos) + if (upper_node.name == "streets:fence_chainlink_door_closed" and action == "open") + or (upper_node.name == "streets:fence_chainlink_door_open" and action == "close") then + toggleDoor(upper_pos, upper_node, player, action) + end + local under_pos = streets.copytable(pos) + under_pos.y = under_pos.y - 1 + local under_node = minetest.get_node(under_pos) + if (under_node.name == "streets:fence_chainlink_door_closed" and action == "open") + or (under_node.name == "streets:fence_chainlink_door_open" and action == "close") then + toggleDoor(under_pos, under_node, player, action) + end +end + +minetest.register_node("streets:fence_chainlink_door_open", { + description = "Chainlink Fence Door (Locked)", + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + tiles = { "streets_fence_chainlink_door.png" }, + sunlight_propagates = true, + groups = { snappy = 1, wall = 1, not_in_creative_inventory = 1 }, + node_box = { + type = "fixed", + fixed = { + { -16 / 32, -0.5, -1 / 32, -14 / 32, 0.5, 1 / 32 }, { 16 / 32, -0.5, -1 / 32, 14 / 32, 0.5, 1 / 32 }, + { -15 / 32, -0.5, 0, -15 / 32, 0.5, 0.5 }, { 15 / 32, -0.5, 0, 15 / 32, 0.5, 0.5 } + }, + }, + sound = default.node_sound_stone_defaults(), + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + toggleDoor(pos, node, player, "close") + end, + drop = "streets:fence_chainlink_door_closed", +}) + +minetest.register_node("streets:fence_chainlink_door_closed", { + description = "Chainlink Fence Door (Locked)", + paramtype = "light", + paramtype2 = "facedir", + drawtype = "nodebox", + tiles = { "streets_fence_chainlink_door.png" }, + sunlight_propagates = true, + groups = { snappy = 1, wall = 1 }, + node_box = { + type = "fixed", + fixed = { + { -16 / 32, -0.5, -1 / 32, -14 / 32, 0.5, 1 / 32 }, { 16 / 32, -0.5, -1 / 32, 14 / 32, 0.5, 1 / 32 }, + { -15 / 32, -0.5, 0, 15 / 32, 0.5, 0 } + }, + }, + sound = default.node_sound_stone_defaults(), + on_rightclick = function(pos, node, player, itemstack, pointed_thing) + toggleDoor(pos, node, player, "open") + end, +}) + + + +minetest.register_craft({ + output = "streets:fence_chainlink 33", + recipe = { + { "", "dye:dark_green", "" }, + { "default:steel_ingot", "default:stick", "default:steel_ingot" }, + { "default:steel_ingot", "default:stick", "default:steel_ingot" } + } +}) + +minetest.register_craft({ + output = "streets:fence_chainlink_door_closed", + recipe = { + { "streets:fence_chainlink", "streets:fence_chainlink", "" }, + { "streets:fence_chainlink", "streets:fence_chainlink", "" }, + { "streets:fence_chainlink", "streets:fence_chainlink", "" } + } +}) \ No newline at end of file diff --git a/streets_asphaltworkshop/init.lua b/streets_asphaltworkshop/init.lua index f72fdaa..305065c 100644 --- a/streets_asphaltworkshop/init.lua +++ b/streets_asphaltworkshop/init.lua @@ -250,7 +250,14 @@ end minetest.register_node(":streets:asphalt_workshop", { description = "Asphalt Workshop", - tiles = { "default_wood.png", }, + tiles = { + "default_steel_block.png^(streets_asphalt.png^[opacity:200)", + "default_steel_block.png^(streets_asphalt.png^[opacity:200)", + "default_steel_block.png^(streets_asphalt.png^[opacity:200)", + "default_steel_block.png^(streets_asphalt.png^[opacity:200)", + "default_steel_block.png^(streets_asphalt.png^[opacity:200)", + "default_steel_block.png^(streets_asphalt.png^[opacity:200)", + }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", @@ -292,8 +299,17 @@ minetest.register_node(":streets:asphalt_workshop", { minetest.register_lbm({ name = "streets:update_asphalt_workshop", - nodenames = {"streets:asphalt_workshop"}, + nodenames = { "streets:asphalt_workshop" }, action = function(pos, node) update_inventory(pos) end, +}) + +minetest.register_craft({ + output = "streets:asphalt_workshop", + recipe = { + { "streets:asphalt", "streets:asphalt", "streets:asphalt" }, + { "streets:asphalt", "default:mese_crystal_fragment", "streets:asphalt" }, + { "streets:asphalt", "streets:asphalt", "streets:asphalt" }, + } }) \ No newline at end of file diff --git a/streets_bollards/init.lua b/streets_bollards/init.lua index 64289fd..23640a4 100644 --- a/streets_bollards/init.lua +++ b/streets_bollards/init.lua @@ -10,7 +10,7 @@ local function toggle_bollard(pos, node, clicker, itemstack, pointed_thing, to_r local ndef = minetest.registered_nodes[n.name] if clicker and ndef.bollard.protection then local name = clicker:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -21,38 +21,47 @@ local function toggle_bollard(pos, node, clicker, itemstack, pointed_thing, to_r return end end - minetest.set_node(pos, {name = ndef.bollard.counterpart, param2 = n.param2}) + minetest.set_node(pos, { name = ndef.bollard.counterpart, param2 = n.param2 }) end end minetest.register_node("streets:bollard_driver", { description = "Driver for Bollards", - tiles = {"streets_bollard_driver_top.png", "default_steel_block.png"}, - groups = {cracky = 1}, + tiles = { "streets_bollard_driver_top.png", "default_steel_block.png" }, + groups = { cracky = 1 }, -- on_rightclick = toggle_bollard, -- Automatic bollards mustn't be toggled manually! mesecons = { - effector = { - rules = mesecon.rules.default, - action_off = function (pos, node) - toggle_bollard(vector.add(pos, vector.new(0, 1, 0)), node, nil, nil, {type = "node", under = vector.add(pos, vector.new(0, -1, 0)), above = vector.add(pos, vector.new(0, 1, 0))},"up") - end, - action_on = function (pos, node) - toggle_bollard(vector.add(pos, vector.new(0, 1, 0)), node, nil, nil, {type = "node", under = vector.add(pos, vector.new(0, -1, 0)), above = vector.add(pos, vector.new(0, 1, 0))},"down") - end - }} + effector = { + rules = mesecon.rules.default, + action_off = function(pos, node) + toggle_bollard(vector.add(pos, vector.new(0, 1, 0)), node, nil, nil, { type = "node", under = vector.add(pos, vector.new(0, -1, 0)), above = vector.add(pos, vector.new(0, 1, 0)) }, "up") + end, + action_on = function(pos, node) + toggle_bollard(vector.add(pos, vector.new(0, 1, 0)), node, nil, nil, { type = "node", under = vector.add(pos, vector.new(0, -1, 0)), above = vector.add(pos, vector.new(0, 1, 0)) }, "down") + end + } + } +}) + +minetest.register_craft({ + output = "streets:bollard_driver", + recipe = { + { "default:steel_ingot", "streets:bollard_steel_automatic_up", "default:steel_ingot" }, + { "default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot" }, + } }) minetest.register_node("streets:bollard_steel_automatic_up", { description = "Steel Bollard", - tiles = {"streets_bollard_driver_top.png", "streets_bollard_driver_top.png", "streets_bollard_automatic_side.png"}, - groups = {cracky = 1}, + tiles = { "streets_bollard_driver_top.png", "streets_bollard_driver_top.png", "streets_bollard_automatic_side.png" }, + groups = { cracky = 1 }, paramtype = "light", drawtype = "nodebox", sunlight_propagates = true, node_box = { type = "fixed", fixed = { - {-0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.3125} + { -0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.3125 } } }, bollard = { @@ -62,8 +71,8 @@ minetest.register_node("streets:bollard_steel_automatic_up", { }) minetest.register_node("streets:bollard_steel_automatic_down", { - tiles = {"streets_bollard_driver_top.png", "streets_bollard_driver_top.png", "streets_bollard_automatic_side.png"}, - groups = {cracky = 1,not_in_creative_inventory = 1}, + tiles = { "streets_bollard_driver_top.png", "streets_bollard_driver_top.png", "streets_bollard_automatic_side.png" }, + groups = { cracky = 1, not_in_creative_inventory = 1 }, drop = "streets:bollard_steel_automatic_up", paramtype = "light", drawtype = "nodebox", @@ -72,7 +81,7 @@ minetest.register_node("streets:bollard_steel_automatic_down", { node_box = { type = "fixed", fixed = { - {-0.3125, -0.5, -0.3125, 0.3125, -0.4375, 0.3125} + { -0.3125, -0.5, -0.3125, 0.3125, -0.4375, 0.3125 } } }, bollard = { @@ -81,10 +90,19 @@ minetest.register_node("streets:bollard_steel_automatic_down", { } }) +minetest.register_craft({ + output = "streets:bollard_steel_automatic_up", + recipe = { + { "dye:red", "dye:white", "dye:red" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, + } +}) + minetest.register_node("streets:bollard_steel_manual_up", { description = "Manual Bollard", - tiles = {"streets_bollard_manual_top.png", "streets_bollard_manual_top.png", "streets_bollard_manual_side.png"}, - groups = {cracky = 1}, + tiles = { "streets_bollard_manual_top.png", "streets_bollard_manual_top.png", "streets_bollard_manual_side.png" }, + groups = { cracky = 1 }, paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", @@ -93,7 +111,7 @@ minetest.register_node("streets:bollard_steel_manual_up", { node_box = { type = "fixed", fixed = { - {-0.125, -0.5, -0.125, 0.125, 0.5, 0.125} + { -0.125, -0.5, -0.125, 0.125, 0.5, 0.125 } } }, bollard = { @@ -104,9 +122,10 @@ minetest.register_node("streets:bollard_steel_manual_up", { }) minetest.register_node("streets:bollard_steel_manual_down", { - tiles = {"streets_bollard_manual_side_down.png", "streets_bollard_manual_side_down.png^[transformR180", "streets_bollard_manual_side_down.png^[transformR270", "streets_bollard_manual_side_down.png^[transformR90", "streets_bollard_manual_top.png", -}, - groups = {cracky = 1,not_in_creative_inventory = 1}, + tiles = { + "streets_bollard_manual_side_down.png", "streets_bollard_manual_side_down.png^[transformR180", "streets_bollard_manual_side_down.png^[transformR270", "streets_bollard_manual_side_down.png^[transformR90", "streets_bollard_manual_top.png", + }, + groups = { cracky = 1, not_in_creative_inventory = 1 }, drop = "streets:bollard_steel_manual_up", paramtype = "light", paramtype2 = "facedir", @@ -117,7 +136,7 @@ minetest.register_node("streets:bollard_steel_manual_down", { node_box = { type = "fixed", fixed = { - {-0.125, -0.5, 0.125, 0.125, -0.25, 1.00} + { -0.125, -0.5, 0.125, 0.125, -0.25, 1.00 } } }, bollard = { @@ -126,3 +145,12 @@ minetest.register_node("streets:bollard_steel_manual_down", { protection = true } }) + +minetest.register_craft({ + output = "streets:bollard_steel_manual_up", + recipe = { + { "dye:red", "dye:white", "dye:red" }, + { "", "default:steel_ingot", "" }, + { "", "default:steel_ingot", "" }, + } +}) diff --git a/streets_concrete/init.lua b/streets_concrete/init.lua index 7fa46a6..bb36271 100644 --- a/streets_concrete/init.lua +++ b/streets_concrete/init.lua @@ -11,17 +11,17 @@ else minetest.register_node("streets:concrete", { description = "Concrete", - tiles = {streets.concrete_texture}, - groups = {cracky = 2, stone = 3}, - sounds = default.node_sound_stone_defaults() + tiles = { streets.concrete_texture }, + groups = { cracky = 2, stone = 3 }, + sounds = default.node_sound_stone_defaults() }) - + if minetest.get_modpath("moreblocks") or minetest.get_modpath("stairsplus") then stairsplus:register_all("streets", "concrete", "streets:concrete", { description = "Concrete", - tiles = {streets.concrete_texture}, - groups = {cracky = 2, stone = 3}, + tiles = { streets.concrete_texture }, + groups = { cracky = 2, stone = 3 }, sounds = default.node_sound_stone_defaults() }) end @@ -31,18 +31,18 @@ minetest.register_node("streets:concrete_wall", { description = "Concrete Wall", paramtype = "light", drawtype = "nodebox", - tiles = {streets.concrete_texture}, + tiles = { streets.concrete_texture }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, wall = 1}, + groups = { cracky = 1, level = 2, wall = 1 }, node_box = { type = "connected", - fixed = {{-0.3, -0.5, -0.3, 0.3, -0.4, 0.3}, {-0.1, -0.5, -0.1, 0.1, 0.5, 0.1}}, - connect_front = {{-0.3, -0.5, -0.5, 0.3, -0.4, 0.3}, {-0.1, -0.5, -0.5, 0.1, 0.5, 0.1}}, -- z- - connect_back = {{-0.3, -0.5, -0.3, 0.3, -0.4, 0.5}, {-0.1, -0.5, -0.1, 0.1, 0.5, 0.5}}, -- z+ - connect_left = {{-0.5, -0.5, -0.3, 0.3, -0.4, 0.3}, {-0.5, -0.5, -0.1, 0.1, 0.5, 0.1}}, -- x- - connect_right = {{-0.3, -0.5, -0.3, 0.5, -0.4, 0.3}, {-0.1, -0.5, -0.1, 0.5, 0.5, 0.1}}, -- x+ + fixed = { { -0.35, -0.5, -0.35, 0.35, -0.4, 0.35 }, { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 } }, + connect_front = { { -0.35, -0.5, -0.5, 0.35, -0.4, 0.35 }, { -0.15, -0.5, -0.5, 0.15, 0.5, 0.15 } }, -- z- + connect_back = { { -0.35, -0.5, -0.35, 0.35, -0.4, 0.5 }, { -0.15, -0.5, -0.15, 0.15, 0.5, 0.5 } }, -- z+ + connect_left = { { -0.5, -0.5, -0.35, 0.35, -0.4, 0.35 }, { -0.5, -0.5, -0.15, 0.15, 0.5, 0.15 } }, -- x- + connect_right = { { -0.35, -0.5, -0.35, 0.5, -0.4, 0.35 }, { -0.15, -0.5, -0.15, 0.5, 0.5, 0.15 } }, -- x+ }, - connects_to = {"group:wall", "group:stone", "group:wood", "group:tree", "group:sign", "group:concrete"}, + connects_to = { "group:wall", "group:stone", "group:wood", "group:tree", "group:concrete" }, sound = default.node_sound_stone_defaults() }) @@ -50,8 +50,8 @@ minetest.register_node("streets:concrete_wall", { minetest.register_craft({ output = "streets:concrete_wall 5", recipe = { - {"", "streets:concrete", ""}, - {"", "streets:concrete", ""}, - {"streets:concrete", "streets:concrete", "streets:concrete"}, + { "", "streets:concrete", "" }, + { "", "streets:concrete", "" }, + { "streets:concrete", "streets:concrete", "streets:concrete" }, } }) diff --git a/streets_installations/init.lua b/streets_installations/init.lua index 3928430..c1e5079 100644 --- a/streets_installations/init.lua +++ b/streets_installations/init.lua @@ -7,88 +7,109 @@ for surface_name, surface_data in pairs(streets.surfaces.surfacetypes) do minetest.register_node(":streets:" .. surface_name:sub(2, -1):split(":")[2] .. "_manhole", { description = "Manhole", - tiles = {surface_data["tiles"][1] .. "^streets_manhole.png", surface_data.tiles[1]}, + tiles = { surface_data["tiles"][1] .. "^streets_manhole.png", surface_data.tiles[1] }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 3}, - on_rightclick = function(pos, node, clicker) - if minetest.is_protected(pos, clicker) and not minetest.check_player_privs(clicker, {protection_bypass=true}) then - minetest.record_protection_violation(pos, clicker) + groups = { cracky = 3 }, + on_rightclick = function(pos, node, name) + local name = name:get_player_name() + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then + minetest.record_protection_violation(pos, name) return end - node.name = node.name.."_open" - minetest.set_node(pos,node) + node.name = node.name .. "_open" + minetest.set_node(pos, node) end, sunlight_propagates = true, node_box = { type = "fixed", fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.5, -0.375}, -- F - {-0.5, -0.5, 0.375, 0.5, 0.5, 0.5}, -- B - {-0.5, -0.5, -0.4375, -0.375, 0.5, 0.4375}, -- L - {0.375, -0.5, -0.4375, 0.5, 0.5, 0.4375}, -- R - {-0.25, 0.4375, -0.25, 0.25, 0.5, 0.25}, -- CenterPlate - {-0.5, 0.4375, -0.0625, 0.5, 0.5, 0.0625}, -- CenterLR - {-0.0625, 0.4375, -0.5, 0.0625, 0.5, 0.5}, -- CenterFR - } + { -0.5, -0.5, -0.5, 0.5, 0.5, -0.375 }, -- F + { -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 }, -- B + { -0.5, -0.5, -0.4375, -0.375, 0.5, 0.4375 }, -- L + { 0.375, -0.5, -0.4375, 0.5, 0.5, 0.4375 }, -- R + { -0.25, 0.4375, -0.25, 0.25, 0.5, 0.25 }, -- CenterPlate + { -0.5, 0.4375, -0.0625, 0.5, 0.5, 0.0625 }, -- CenterLR + { -0.0625, 0.4375, -0.5, 0.0625, 0.5, 0.5 }, -- CenterFR + } }, }) minetest.register_node(":streets:" .. surface_name:sub(2, -1):split(":")[2] .. "_manhole_open", { - tiles = {surface_data["tiles"][1] .. "^streets_manhole.png", surface_data.tiles[1]}, + tiles = { surface_data["tiles"][1] .. "^streets_manhole.png", surface_data.tiles[1] }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", climbable = true, drop = "streets:" .. surface_name:sub(2, -1):split(":")[2] .. "_manhole", - groups = {cracky = 3,not_in_creative_inventory = 1}, - on_rightclick = function(pos, node, clicker) - if minetest.is_protected(pos, clicker) and not minetest.check_player_privs(clicker, {protection_bypass=true}) then - minetest.record_protection_violation(pos, clicker) + groups = { cracky = 3, not_in_creative_inventory = 1 }, + on_rightclick = function(pos, node, name) + local name = name:get_player_name() + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then + minetest.record_protection_violation(pos, name) return end - node.name = string.sub(node.name,1,-6) - minetest.set_node(pos,node) + node.name = string.sub(node.name, 1, -6) + minetest.set_node(pos, node) end, sunlight_propagates = true, node_box = { type = "fixed", fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.5, -0.375}, -- F - {-0.5, -0.5, 0.375, 0.5, 0.5, 0.5}, -- B - {-0.5, -0.5, -0.4375, -0.375, 0.5, 0.4375}, -- L - {0.375, -0.5, -0.4375, 0.5, 0.5, 0.4375}, -- R - } + { -0.5, -0.5, -0.5, 0.5, 0.5, -0.375 }, -- F + { -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 }, -- B + { -0.5, -0.5, -0.4375, -0.375, 0.5, 0.4375 }, -- L + { 0.375, -0.5, -0.4375, 0.5, 0.5, 0.4375 }, -- R + } }, }) + + + minetest.register_craft({ + output = "streets:" .. surface_name:sub(2, -1):split(":")[2] .. "_manhole 4", + recipe = { + { surface_name, surface_name, surface_name }, + { surface_name, "default:steel_ingot", surface_name }, + { surface_name, surface_name, surface_name }, + } + }) + minetest.register_node(":streets:" .. surface_name:sub(2, -1):split(":")[2] .. "_stormdrain", { description = "Stormdrain", - tiles = {surface_data["tiles"][1] .. "^streets_stormdrain.png", surface_data.tiles[1]}, + tiles = { surface_data["tiles"][1] .. "^streets_stormdrain.png", surface_data.tiles[1] }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 3}, + groups = { cracky = 3 }, sunlight_propagates = true, node_box = { type = "fixed", fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.5, -0.4375}, -- F - {-0.5, -0.5, 0.4375, 0.5, 0.5, 0.5}, -- B - {-0.5, -0.5, -0.4375, -0.375, 0.5, 0.4375}, -- L - {0.375, -0.5, -0.4375, 0.5, 0.5, 0.4375}, -- R - {-0.4375, 0.4375, 0, 0.4375, 0.5, 0.4375}, -- T1 - {-0.3125, 0.4375, -0.4375, -0.25, 0.5, 0}, -- S1 - {0.25, 0.4375, -0.4375, 0.3125, 0.5, 0}, -- S2 - {-0.1875, 0.4375, -0.4375, -0.125, 0.5, 0}, -- S3 - {0.125, 0.4375, -0.4375, 0.1875, 0.5, 0}, -- S4 - {-0.0625, 0.4375, -0.3125, 0.0625, 0.5, 0}, -- S5 - {-0.125, 0.4375, -0.375, 0.125, 0.5, -0.3125}, -- S6 - } + { -0.5, -0.5, -0.5, 0.5, 0.5, -0.4375 }, -- F + { -0.5, -0.5, 0.4375, 0.5, 0.5, 0.5 }, -- B + { -0.5, -0.5, -0.4375, -0.375, 0.5, 0.4375 }, -- L + { 0.375, -0.5, -0.4375, 0.5, 0.5, 0.4375 }, -- R + { -0.4375, 0.4375, 0, 0.4375, 0.5, 0.4375 }, -- T1 + { -0.3125, 0.4375, -0.4375, -0.25, 0.5, 0 }, -- S1 + { 0.25, 0.4375, -0.4375, 0.3125, 0.5, 0 }, -- S2 + { -0.1875, 0.4375, -0.4375, -0.125, 0.5, 0 }, -- S3 + { 0.125, 0.4375, -0.4375, 0.1875, 0.5, 0 }, -- S4 + { -0.0625, 0.4375, -0.3125, 0.0625, 0.5, 0 }, -- S5 + { -0.125, 0.4375, -0.375, 0.125, 0.5, -0.3125 }, -- S6 + } }, selection_box = { type = "regular" } }) + + minetest.register_craft({ + output = "streets:" .. surface_name:sub(2, -1):split(":")[2] .. "_stormdrain 3", + recipe = { + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, + { surface_name, surface_name, surface_name }, + } + }) end diff --git a/streets_laneuse/init.lua b/streets_laneuse/init.lua index b5291f2..e1c8ee1 100644 --- a/streets_laneuse/init.lua +++ b/streets_laneuse/init.lua @@ -5,11 +5,11 @@ ]] local nodebox = { - {-7/16, -7/16, -1/8, 7/16, 7/16, 1/8}, --Face - {-7/16, 0, -1/4, -3/8, 7/16, -1/8}, --Visor Left - {3/8, 0, -1/4, 7/16, 7/16, -1/8}, --Visor Right - {-7/16, 3/8, -5/16, 7/16, 7/16, -1/8}, --Visor Top - {-1/4, -1/4, 0.85, 1/4, 1/4, 1/8}, --Mounting Bracket + { -7 / 16, -7 / 16, -1 / 8, 7 / 16, 7 / 16, 1 / 8 }, --Face + { -7 / 16, 0, -1 / 4, -3 / 8, 7 / 16, -1 / 8 }, --Visor Left + { 3 / 8, 0, -1 / 4, 7 / 16, 7 / 16, -1 / 8 }, --Visor Right + { -7 / 16, 3 / 8, -5 / 16, 7 / 16, 7 / 16, -1 / 8 }, --Visor Top + { -1 / 4, -1 / 4, 0.85, 1 / 4, 1 / 4, 1 / 8 }, --Mounting Bracket } minetest.register_node("streets:lane_use_off", { @@ -29,19 +29,18 @@ minetest.register_node("streets:lane_use_off", { local meta = minetest.get_meta(pos) meta:set_string("formspec", "field[channel;Channel;${channel}]") end, - groups = {cracky = 3}, + groups = { cracky = 3 }, node_box = { type = "fixed", - fixed = nodebox + fixed = nodebox }, selection_box = { type = "fixed", - fixed = nodebox - + fixed = nodebox }, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -58,24 +57,24 @@ minetest.register_node("streets:lane_use_off", { return end msg = msg:lower() - if (msg=="off") then + if (msg == "off") then node.name = "streets:lane_use_off" - elseif (msg=="green") then + elseif (msg == "green") then node.name = "streets:lane_use_green" - elseif (msg=="red") then + elseif (msg == "red") then node.name = "streets:lane_use_red" - elseif (msg=="yellow") then + elseif (msg == "yellow") then node.name = "streets:lane_use_yellow" end - minetest.set_node(pos,node) - minetest.get_meta(pos):set_string("channel",setchan) + minetest.set_node(pos, node) + minetest.get_meta(pos):set_string("channel", setchan) end } } }) -for _,v in pairs({"green","yellow","red"}) do - minetest.register_node("streets:lane_use_"..v, { +for _, v in pairs({ "green", "yellow", "red" }) do + minetest.register_node("streets:lane_use_" .. v, { drop = "streets:lane_use_off", tiles = { "streets_tl_bg.png", @@ -83,7 +82,7 @@ for _,v in pairs({"green","yellow","red"}) do "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", - "streets_laneuse_"..v..".png" + "streets_laneuse_" .. v .. ".png" }, drawtype = "nodebox", paramtype = "light", @@ -92,20 +91,19 @@ for _,v in pairs({"green","yellow","red"}) do local meta = minetest.get_meta(pos) meta:set_string("formspec", "field[channel;Channel;${channel}]") end, - groups = {cracky = 3,not_in_creative_inventory = 1}, + groups = { cracky = 3, not_in_creative_inventory = 1 }, light_source = 11, node_box = { type = "fixed", - fixed = nodebox + fixed = nodebox }, selection_box = { type = "fixed", - fixed = nodebox - + fixed = nodebox }, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -122,17 +120,17 @@ for _,v in pairs({"green","yellow","red"}) do return end msg = msg:lower() - if (msg=="off") then + if (msg == "off") then node.name = "streets:lane_use_off" - elseif (msg=="green") then + elseif (msg == "green") then node.name = "streets:lane_use_green" - elseif (msg=="red") then + elseif (msg == "red") then node.name = "streets:lane_use_red" - elseif (msg=="yellow") then + elseif (msg == "yellow") then node.name = "streets:lane_use_yellow" end - minetest.set_node(pos,node) - minetest.get_meta(pos):set_string("channel",setchan) + minetest.set_node(pos, node) + minetest.get_meta(pos):set_string("channel", setchan) end } } @@ -142,8 +140,8 @@ end minetest.register_craft({ output = "streets:lane_use_off", recipe = { - {"default:steel_ingot","default:steel_ingot","default:steel_ingot"}, - {"dye:red","dye:yellow","dye:green"}, - {"default:steel_ingot","default:steel_ingot","default:steel_ingot"} + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, + { "dye:red", "dye:yellow", "dye:green" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } } }) diff --git a/streets_matrix_screen/init.lua b/streets_matrix_screen/init.lua index 8df89ba..49c59da 100644 --- a/streets_matrix_screen/init.lua +++ b/streets_matrix_screen/init.lua @@ -204,3 +204,12 @@ minetest.register_entity("streets:matrix_screen_lights", { end, pos) end, }) + +minetest.register_craft({ + output = "streets:matrix_screen_base", + recipe = { + { "dye:yellow", "default:steel_ingot", "dye:yellow" }, + { "default:steel_ingot", "digilines:lcd", "default:steel_ingot" }, + { "dye:yellow", "default:steel_ingot", "dye:yellow" }, + } +}) diff --git a/streets_poles/init.lua b/streets_poles/init.lua index 9bd7771..e6f6cec 100644 --- a/streets_poles/init.lua +++ b/streets_poles/init.lua @@ -9,44 +9,44 @@ minetest.register_node(":streets:bigpole", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_pole.png"}, + tiles = { "streets_pole.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, bigpole = 1}, + groups = { cracky = 1, level = 2, bigpole = 1 }, node_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15} + { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 } } }, on_place = minetest.rotate_node, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0}, - {x= 0, y=-2, z= 0} + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 }, + { x = 0, y = -2, z = 0 } } } }, streets_pole_connection = { - [0] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - [1] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}, - [2] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - [3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0}, - ["t"] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}, - ["b"] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1} - } + [0] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + [1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0 }, + [2] = { 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + [3] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0 }, + ["t"] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 }, + ["b"] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 } + } }) minetest.register_craft({ output = "streets:bigpole 3", recipe = { - {"default:steel_ingot"}, - {"default:steel_ingot"} + { "default:steel_ingot" }, + { "default:steel_ingot" } } }) @@ -56,42 +56,42 @@ minetest.register_node(":streets:bigpole_short", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_pole.png"}, + tiles = { "streets_pole.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, bigpole = 1}, + groups = { cracky = 1, level = 2, bigpole = 1 }, node_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.15, 0.15} + { -0.15, -0.5, -0.15, 0.15, 0.15, 0.15 } } }, on_place = minetest.rotate_node, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0}, + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 }, } } }, streets_pole_connection = { - [0] = {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - [1] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0}, - [2] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - [3] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0}, - ["t"] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}, - ["b"] = {1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + [0] = { 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + [1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, + [2] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + [3] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 }, + ["t"] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1 }, + ["b"] = { 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } }) minetest.register_craft({ output = "streets:bigpole_short 2", recipe = { - {"streets:bigpole"} + { "streets:bigpole" } } }) @@ -101,52 +101,52 @@ minetest.register_node(":streets:bigpole_edge", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_pole.png"}, + tiles = { "streets_pole.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, bigpole = 1}, + groups = { cracky = 1, level = 2, bigpole = 1 }, node_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.15, 0.15}, - {-0.15, -0.15, -0.15, 0.15, 0.15, -0.5} + { -0.15, -0.5, -0.15, 0.15, 0.15, 0.15 }, + { -0.15, -0.15, -0.15, 0.15, 0.15, -0.5 } } }, on_place = minetest.rotate_node, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0}, + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 }, } } }, streets_pole_connection = { - [0] = {1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, - [1] = {0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1}, - [2] = {0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0}, - [3] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0}, - ["t"] = {0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1}, - ["b"] = {1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0} + [0] = { 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 }, + [1] = { 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1 }, + [2] = { 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0 }, + [3] = { 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0 }, + ["t"] = { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1 }, + ["b"] = { 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0 } } }) minetest.register_craft({ output = "streets:bigpole_edge 3", recipe = { - {"streets:bigpole","streets:bigpole"}, - {"streets:bigpole",""} + { "streets:bigpole", "streets:bigpole" }, + { "streets:bigpole", "" } } }) minetest.register_craft({ output = "streets:bigpole_edge 3", recipe = { - {"streets:bigpole","streets:bigpole"}, - {"","streets:bigpole"} + { "streets:bigpole", "streets:bigpole" }, + { "", "streets:bigpole" } } }) @@ -156,43 +156,43 @@ minetest.register_node(":streets:bigpole_tjunction", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_pole.png"}, + tiles = { "streets_pole.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, bigpole = 1}, + groups = { cracky = 1, level = 2, bigpole = 1 }, node_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.15, 0.15}, - {-0.15, -0.15, -0.5, 0.15, 0.15, 0.5} + { -0.15, -0.5, -0.15, 0.15, 0.15, 0.15 }, + { -0.15, -0.15, -0.5, 0.15, 0.15, 0.5 } } }, on_place = minetest.rotate_node, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0}, + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 }, } } }, streets_pole_connection = { - [0] = {1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}, - [1] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1}, - [2] = {1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}, - [3] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1}, - ["t"] = {0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1}, - ["b"] = {1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0} + [0] = { 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, + [1] = { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1 }, + [2] = { 1, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, + [3] = { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1 }, + ["t"] = { 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1 }, + ["b"] = { 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0 } } }) minetest.register_craft({ output = "streets:bigpole_tjunction", recipe = { - {"streets:bigpole_edge","streets:bigpole_short"}, + { "streets:bigpole_edge", "streets:bigpole_short" }, } }) @@ -202,45 +202,45 @@ minetest.register_node(":streets:bigpole_corner", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_pole.png"}, + tiles = { "streets_pole.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, bigpole = 1}, + groups = { cracky = 1, level = 2, bigpole = 1 }, node_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.15, 0.15}, - {-0.15, -0.15, -0.15, 0.15, 0.15, -0.5}, - {-0.15, -0.15, -0.15, 0.5, 0.15, 0.15} + { -0.15, -0.5, -0.15, 0.15, 0.15, 0.15 }, + { -0.15, -0.15, -0.15, 0.15, 0.15, -0.5 }, + { -0.15, -0.15, -0.15, 0.5, 0.15, 0.15 } } }, on_place = minetest.rotate_node, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0}, + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 }, } } }, streets_pole_connection = { - [0] = {1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, - [1] = {0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1}, - [2] = {0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1}, - [3] = {1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0}, - ["t"] = {0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1}, - ["b"] = {1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0} + [0] = { 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0 }, + [1] = { 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1 }, + [2] = { 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1 }, + [3] = { 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0 }, + ["t"] = { 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1 }, + ["b"] = { 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0 } } }) minetest.register_craft({ output = "streets:bigpole_corner", recipe = { - {"streets:bigpole_edge"}, - {"streets:bigpole_short"} + { "streets:bigpole_edge" }, + { "streets:bigpole_short" } } }) @@ -250,45 +250,45 @@ minetest.register_node(":streets:bigpole_four_side_junction", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_pole.png"}, + tiles = { "streets_pole.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, bigpole = 1}, + groups = { cracky = 1, level = 2, bigpole = 1 }, node_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}, - {-0.15, -0.15, -0.15, 0.15, 0.15, -0.5}, - {-0.15, -0.15, -0.15, 0.5, 0.15, 0.15} + { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }, + { -0.15, -0.15, -0.15, 0.15, 0.15, -0.5 }, + { -0.15, -0.15, -0.15, 0.5, 0.15, 0.15 } } }, on_place = minetest.rotate_node, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0}, + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 }, } } }, streets_pole_connection = { - [0] = {1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, - [1] = {0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1}, - [2] = {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1}, - [3] = {1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0}, - ["t"] = {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1}, - ["b"] = {1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1} + [0] = { 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0 }, + [1] = { 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1 }, + [2] = { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1 }, + [3] = { 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0 }, + ["t"] = { 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1 }, + ["b"] = { 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1 } } }) minetest.register_craft({ output = "streets:bigpole_four_side_junction", recipe = { - {"streets:bigpole_short"}, - {"streets:bigpole_corner"} + { "streets:bigpole_short" }, + { "streets:bigpole_corner" } } }) @@ -298,45 +298,45 @@ minetest.register_node(":streets:bigpole_cross", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_pole.png"}, + tiles = { "streets_pole.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, bigpole = 1}, + groups = { cracky = 1, level = 2, bigpole = 1 }, node_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}, - {-0.15, -0.15, -0.5, 0.15, 0.15, 0.5} + { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }, + { -0.15, -0.15, -0.5, 0.15, 0.15, 0.5 } } }, on_place = minetest.rotate_node, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0}, + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 }, } } }, streets_pole_connection = { - [0] = {1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}, - [1] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1}, - [2] = {1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0}, - [3] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1}, - ["t"] = {1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1}, - ["b"] = {1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1} + [0] = { 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, + [1] = { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1 }, + [2] = { 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }, + [3] = { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1 }, + ["t"] = { 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1 }, + ["b"] = { 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1 } } }) minetest.register_craft({ output = "streets:bigpole_cross", recipe = { - {"", "streets:bigpole_short", ""}, - {"streets:bigpole_short", "", "streets:bigpole_short"}, - {"", "streets:bigpole_short", ""}, + { "", "streets:bigpole_short", "" }, + { "streets:bigpole_short", "", "streets:bigpole_short" }, + { "", "streets:bigpole_short", "" }, } }) @@ -346,44 +346,44 @@ minetest.register_node(":streets:bigpole_five_side_junction", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_pole.png"}, + tiles = { "streets_pole.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, bigpole = 1}, + groups = { cracky = 1, level = 2, bigpole = 1 }, node_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}, - {-0.15, -0.15, -0.5, 0.15, 0.15, 0.5}, - {-0.15,-0.15,-0.15,0.5,0.15,0.15} + { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }, + { -0.15, -0.15, -0.5, 0.15, 0.15, 0.5 }, + { -0.15, -0.15, -0.15, 0.5, 0.15, 0.15 } } }, on_place = minetest.rotate_node, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0}, + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 }, } } }, streets_pole_connection = { - [0] = {1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0}, - [1] = {0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}, - [2] = {1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1}, - [3] = {1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1}, - ["t"] = {1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1}, - ["b"] = {1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1} + [0] = { 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0 }, + [1] = { 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1 }, + [2] = { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1 }, + [3] = { 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1 }, + ["t"] = { 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1 }, + ["b"] = { 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1 } } }) minetest.register_craft({ - output = "streets:bigpole_fice_side_junction", + output = "streets:bigpole_five_side_junction", recipe = { - {"streets:bigpole_cross", "streets:bigpole_short"} + { "streets:bigpole_cross", "streets:bigpole_short" } } }) @@ -393,43 +393,43 @@ minetest.register_node(":streets:bigpole_all_sides", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_pole.png"}, + tiles = { "streets_pole.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, bigpole = 1}, + groups = { cracky = 1, level = 2, bigpole = 1 }, node_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}, - {-0.15, -0.15, -0.5, 0.15, 0.15, 0.5}, - {-0.5, -0.15, -0.15, 0.5, 0.15, 0.15} + { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }, + { -0.15, -0.15, -0.5, 0.15, 0.15, 0.5 }, + { -0.5, -0.15, -0.15, 0.5, 0.15, 0.15 } } }, on_place = minetest.rotate_node, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0}, + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 }, } } }, streets_pole_connection = { - [0] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - [1] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - [2] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - [3] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - ["t"] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, - ["b"] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} + [0] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, + [1] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, + [2] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, + [3] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, + ["t"] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, + ["b"] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } } }) minetest.register_craft({ output = "streets:bigpole_all_sides", recipe = { - {"streets:bigpole_short", "streets:bigpole_cross", "streets:bigpole_short"} + { "streets:bigpole_short", "streets:bigpole_cross", "streets:bigpole_short" } } }) diff --git a/streets_roadmarkings/init.lua b/streets_roadmarkings/init.lua index 009fec6..6585f93 100644 --- a/streets_roadmarkings/init.lua +++ b/streets_roadmarkings/init.lua @@ -7,12 +7,12 @@ --These register the sections in the workshop that these will be placed into streets.labels.sections = { - {name="centerlines",friendlyname="Center Lines"}, - {name="centerlinecorners",friendlyname="Center Line Corners/Junctions"}, - {name="sidelines",friendlyname="Side Lines"}, - {name="arrows",friendlyname="Arrows"}, - {name="symbols",friendlyname="Symbols"}, - {name="other",friendlyname="Other"} + { name = "centerlines", friendlyname = "Center Lines" }, + { name = "centerlinecorners", friendlyname = "Center Line Corners/Junctions" }, + { name = "sidelines", friendlyname = "Side Lines" }, + { name = "arrows", friendlyname = "Arrows" }, + { name = "symbols", friendlyname = "Symbols" }, + { name = "other", friendlyname = "Other" } } @@ -26,7 +26,7 @@ streets.register_road_marking({ tex = "streets_dashed_center_line.png", section = "centerlines", dye_needed = 1, - rotation = {r90 = 1}, + rotation = { r90 = 1 }, }) streets.register_road_marking({ @@ -35,7 +35,7 @@ streets.register_road_marking({ tex = "streets_solid_center_line.png", section = "centerlines", dye_needed = 2, - rotation = {r90 = 1}, + rotation = { r90 = 1 }, }) @@ -47,7 +47,7 @@ streets.register_road_marking({ tex = "streets_dashed_center_line_wide.png", section = "centerlines", dye_needed = 2, - rotation = {r90 = 1}, + rotation = { r90 = 1 }, }) streets.register_road_marking({ @@ -56,7 +56,7 @@ streets.register_road_marking({ tex = "streets_solid_center_line_wide.png", section = "centerlines", dye_needed = 4, - rotation = {r90 = 1}, + rotation = { r90 = 1 }, }) @@ -68,7 +68,7 @@ streets.register_road_marking({ tex = "streets_double_dashed_center_line.png", section = "centerlines", dye_needed = 2, - rotation = {r90 = 1}, + rotation = { r90 = 1 }, }) streets.register_road_marking({ @@ -77,7 +77,7 @@ streets.register_road_marking({ tex = "streets_double_solid_center_line.png", section = "centerlines", dye_needed = 4, - rotation = {r90 = 1}, + rotation = { r90 = 1 }, }) streets.register_road_marking({ @@ -86,7 +86,7 @@ streets.register_road_marking({ tex = "streets_mixed_center_line.png", section = "centerlines", dye_needed = 3, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -95,7 +95,7 @@ streets.register_road_marking({ tex = "streets_solid_line_offset.png", section = "centerlines", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) @@ -109,7 +109,7 @@ streets.register_road_marking({ tex = "streets_solid_center_line_corner.png", section = "centerlinecorners", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -118,7 +118,7 @@ streets.register_road_marking({ tex = "streets_solid_center_line_tjunction.png", section = "centerlinecorners", dye_needed = 3, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -138,7 +138,7 @@ streets.register_road_marking({ tex = "streets_solid_center_line_wide_corner.png", section = "centerlinecorners", dye_needed = 4, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -147,7 +147,7 @@ streets.register_road_marking({ tex = "streets_solid_center_line_wide_tjunction.png", section = "centerlinecorners", dye_needed = 6, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -167,7 +167,7 @@ streets.register_road_marking({ tex = "streets_double_solid_center_line_corner.png", section = "centerlinecorners", dye_needed = 4, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -176,7 +176,7 @@ streets.register_road_marking({ tex = "streets_double_solid_center_line_tjunction.png", section = "centerlinecorners", dye_needed = 6, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -197,7 +197,7 @@ streets.register_road_marking({ tex = "streets_solid_side_line.png", section = "sidelines", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -206,7 +206,7 @@ streets.register_road_marking({ tex = "streets_solid_side_line_corner.png", section = "sidelines", dye_needed = 4, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -215,7 +215,7 @@ streets.register_road_marking({ tex = "streets_dashed_side_line.png", section = "sidelines", dye_needed = 1, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) @@ -227,7 +227,7 @@ streets.register_road_marking({ tex = "streets_solid_side_line_wide.png", section = "sidelines", dye_needed = 4, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -236,7 +236,7 @@ streets.register_road_marking({ tex = "streets_solid_side_line_wide_corner.png", section = "sidelines", dye_needed = 8, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -245,7 +245,7 @@ streets.register_road_marking({ tex = "streets_dashed_side_line_wide.png", section = "sidelines", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) @@ -257,7 +257,7 @@ streets.register_road_marking({ tex = "streets_solid_side_line_combinated_corner.png", section = "sidelines", dye_needed = 6, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -266,7 +266,7 @@ streets.register_road_marking({ tex = "streets_solid_side_line_combinated_corner.png^[transformFX", section = "sidelines", dye_needed = 6, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) @@ -279,7 +279,7 @@ streets.register_road_marking({ tex = "streets_arrow_straight.png", section = "arrows", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -288,7 +288,7 @@ streets.register_road_marking({ tex = "streets_arrow_right.png^[transformFX", section = "arrows", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -297,7 +297,7 @@ streets.register_road_marking({ tex = "streets_arrow_right.png", section = "arrows", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -306,7 +306,7 @@ streets.register_road_marking({ tex = "streets_arrow_right_straight.png^[transformFX", section = "arrows", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -315,7 +315,7 @@ streets.register_road_marking({ tex = "streets_arrow_right_straight.png", section = "arrows", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -324,7 +324,7 @@ streets.register_road_marking({ tex = "streets_arrow_right_straight.png^[transformFX^streets_arrow_right_straight.png", section = "arrows", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -333,7 +333,7 @@ streets.register_road_marking({ tex = "streets_arrow_left_right.png", section = "arrows", dye_needed = 2, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) @@ -345,7 +345,7 @@ streets.register_road_marking({ tex = "streets_parking.png", section = "symbols", dye_needed = 3, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -364,7 +364,7 @@ streets.register_road_marking({ tex = "streets_solid_stripe.png", section = "other", dye_needed = 4, - rotation = {r90 = 1}, + rotation = { r90 = 1 }, }) streets.register_road_marking({ @@ -373,7 +373,7 @@ streets.register_road_marking({ tex = "streets_solid_diagonal_line.png", section = "other", dye_needed = 2, - rotation = {r90 = 1}, + rotation = { r90 = 1 }, }) streets.register_road_marking({ @@ -382,7 +382,7 @@ streets.register_road_marking({ tex = "streets_double_solid_diagonal_line.png", section = "other", dye_needed = 4, - rotation = {r90 = 1}, + rotation = { r90 = 1 }, }) streets.register_road_marking({ @@ -391,7 +391,7 @@ streets.register_road_marking({ tex = "streets_halt_line_center_corner.png", section = "other", dye_needed = 4, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -400,7 +400,7 @@ streets.register_road_marking({ tex = "streets_halt_line_center_corner_wide.png", section = "other", dye_needed = 6, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -409,7 +409,7 @@ streets.register_road_marking({ tex = "streets_halt_line_center_corner.png^[transformFX", section = "other", dye_needed = 4, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) streets.register_road_marking({ @@ -418,5 +418,5 @@ streets.register_road_marking({ tex = "streets_halt_line_center_corner_wide.png^[transformFX", section = "other", dye_needed = 6, - rotation = {r90 = 1, r180 = 1, r270 = 1}, + rotation = { r90 = 1, r180 = 1, r270 = 1 }, }) diff --git a/streets_roadsurface/init.lua b/streets_roadsurface/init.lua index d6d11da..e237f86 100644 --- a/streets_roadsurface/init.lua +++ b/streets_roadsurface/init.lua @@ -6,16 +6,16 @@ ]] streets.register_road_surface({ - name="asphalt", + name = "asphalt", friendlyname = "Asphalt", - tiles = {"streets_asphalt.png"}, - groups = {cracky = 3,asphalt = 1}, + tiles = { "streets_asphalt.png" }, + groups = { cracky = 3, asphalt = 1 }, sounds = default.node_sound_stone_defaults(), register_stairs = true, craft = { output = "streets:asphalt 1", type = "cooking", - recipe = "default:gravel", + recipe = "default:gravel", cooktime = 2 } }) @@ -23,14 +23,14 @@ streets.register_road_surface({ streets.register_road_surface({ name = "asphalt_red", friendlyname = "Red Asphalt", - tiles = {"streets_asphalt_red.png"}, - groups = {cracky = 3,asphalt = 1}, + tiles = { "streets_asphalt_red.png" }, + groups = { cracky = 3, asphalt = 1 }, sounds = default.node_sound_stone_defaults(), register_stairs = true, craft = { output = "streets:asphalt_red 1", type = "shapeless", - recipe = {"streets:asphalt", "dye:red"} + recipe = { "streets:asphalt", "dye:red" } } }) @@ -51,29 +51,29 @@ streets.register_road_surface({ streets.register_road_surface({ name = "asphalt_blue", friendlyname = "Blue Asphalt", - tiles = {"streets_asphalt_blue.png"}, - groups = {cracky = 3,asphalt = 1}, + tiles = { "streets_asphalt_blue.png" }, + groups = { cracky = 3, asphalt = 1 }, sounds = default.node_sound_stone_defaults(), register_stairs = false, craft = { output = "streets:asphalt_blue 1", type = "shapeless", - recipe = {"streets:asphalt", "dye:blue"} + recipe = { "streets:asphalt", "dye:blue" } } }) minetest.register_node("streets:sidewalk", { description = "Sidewalk", - tiles = {"streets_sidewalk.png"}, - groups = {cracky = 3, stone = 1}, - sounds = default.node_sound_stone_defaults() + tiles = { "streets_sidewalk.png" }, + groups = { cracky = 3, stone = 1 }, + sounds = default.node_sound_stone_defaults() }) - + if minetest.get_modpath("moreblocks") or minetest.get_modpath("stairsplus") then stairsplus:register_all("streets", "sidewalk", "streets:sidewalk", { description = "Concrete", - tiles = {"streets_sidewalk.png"}, - groups = {cracky = 3, asphalt = 1}, + tiles = { "streets_sidewalk.png" }, + groups = { cracky = 3, asphalt = 1 }, sounds = default.node_sound_stone_defaults() }) end @@ -81,5 +81,5 @@ end minetest.register_craft({ output = "streets:sidewalk 1", type = "shapeless", - recipe = {"streets:asphalt", "dye:white"} + recipe = { "streets:asphalt", "dye:white" } }) diff --git a/streets_roadwork/init.lua b/streets_roadwork/init.lua index 523b731..7d90aa4 100644 --- a/streets_roadwork/init.lua +++ b/streets_roadwork/init.lua @@ -11,26 +11,26 @@ minetest.register_node("streets:roadwork_traffic_barrier", { description = "Traffic Barrier", paramtype = "light", drawtype = "nodebox", - tiles = {streets.concrete_texture, streets.concrete_texture, streets.concrete_texture .. "^streets_roadwork_traffic_barrier.png"}, + tiles = { streets.concrete_texture, streets.concrete_texture, streets.concrete_texture .. "^streets_roadwork_traffic_barrier.png" }, sunlight_propagates = true, - groups = {cracky = 1, level = 2, wall = 1}, + groups = { cracky = 1, level = 2, wall = 1 }, node_box = { type = "connected", - fixed = {{-0.3, -0.5, -0.3, 0.3, -0.4, 0.3}, {-0.1, -0.5, -0.1, 0.1, 0.5, 0.1}}, - connect_front = {{-0.3, -0.5, -0.5, 0.3, -0.4, 0.3}, {-0.1, -0.5, -0.5, 0.1, 0.5, 0.1}}, -- z- - connect_back = {{-0.3, -0.5, -0.3, 0.3, -0.4, 0.5}, {-0.1, -0.5, -0.1, 0.1, 0.5, 0.5}}, -- z+ - connect_left = {{-0.5, -0.5, -0.3, 0.3, -0.4, 0.3}, {-0.5, -0.5, -0.1, 0.1, 0.5, 0.1}}, -- x- - connect_right = {{-0.3, -0.5, -0.3, 0.5, -0.4, 0.3}, {-0.1, -0.5, -0.1, 0.5, 0.5, 0.1}}, -- x+ + fixed = { { -0.35, -0.5, -0.35, 0.35, -0.4, 0.35 }, { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 } }, + connect_front = { { -0.35, -0.5, -0.5, 0.35, -0.4, 0.35 }, { -0.15, -0.5, -0.5, 0.15, 0.5, 0.15 } }, -- z- + connect_back = { { -0.35, -0.5, -0.35, 0.35, -0.4, 0.5 }, { -0.15, -0.5, -0.15, 0.15, 0.5, 0.5 } }, -- z+ + connect_left = { { -0.5, -0.5, -0.35, 0.35, -0.4, 0.35 }, { -0.5, -0.5, -0.15, 0.15, 0.5, 0.15 } }, -- x- + connect_right = { { -0.35, -0.5, -0.35, 0.5, -0.4, 0.35 }, { -0.15, -0.5, -0.15, 0.5, 0.5, 0.15 } }, -- x+ }, - connects_to = {"group:wall", "group:stone", "group:wood", "group:tree", "group:sign", "group:concrete"}, + connects_to = { "group:wall", "group:stone", "group:wood", "group:tree", "group:concrete" }, sound = default.node_sound_stone_defaults() }) minetest.register_craft({ output = "streets:roadwork_traffic_barrier 3", recipe = { - {"dye:red", "dye:white", "dye:red"}, - {"streets:concrete_wall", "streets:concrete_wall", "streets:concrete_wall"}, + { "dye:red", "dye:white", "dye:red" }, + { "streets:concrete_wall", "streets:concrete_wall", "streets:concrete_wall" }, } }) @@ -41,30 +41,30 @@ minetest.register_node("streets:roadwork_barrier_tape", { description = "Barrier Tape", paramtype = "light", drawtype = "nodebox", - tiles = {"streets_roadwork_barrier_tape.png"}, + tiles = { "streets_roadwork_barrier_tape.png" }, sunlight_propagates = true, - groups = {choppy = 1, dig_immediate = 3, level = 1, wall = 1}, + groups = { choppy = 1, dig_immediate = 3, level = 1, wall = 1 }, node_box = { type = "connected", - fixed = {-1/16, -0.5, -1/16, 1/16, 0.5, 1/16}, - connect_front = {0, 4/16, -0.5, 0, 6/16, 0}, -- z- - connect_back = {0, 4/16, 0, 0, 6/16, 0.5}, -- z+ - connect_left = {-0.5, 4/16, 0, 0, 6/16, 0}, -- x- - connect_right = {0, 4/16, 0, 0.5, 6/16, 0}, -- x+ + fixed = { -1 / 16, -0.5, -1 / 16, 1 / 16, 0.5, 1 / 16 }, + connect_front = { 0, 4 / 16, -0.5, 0, 6 / 16, 0 }, -- z- + connect_back = { 0, 4 / 16, 0, 0, 6 / 16, 0.5 }, -- z+ + connect_left = { -0.5, 4 / 16, 0, 0, 6 / 16, 0 }, -- x- + connect_right = { 0, 4 / 16, 0, 0.5, 6 / 16, 0 }, -- x+ }, selection_box = { type = "fixed", - fixed = {-2/16, -0.5, -2/16, 2/16, 0.5, 2/16}, + fixed = { -2 / 16, -0.5, -2 / 16, 2 / 16, 0.5, 2 / 16 }, }, - connects_to = {"group:wall", "group:stone", "group:wood", "group:tree", "group:sign", "group:concrete"}, + connects_to = { "group:wall", "group:stone", "group:wood", "group:tree", "group:sign", "group:concrete" }, }) minetest.register_craft({ output = "streets:roadwork_barrier_tape 24", recipe = { - {"dye:red", "dye:white", "dye:red"}, - {"farming:cotton", "default:stick", "farming:cotton"}, - {"", "default:stick", ""} + { "dye:red", "dye:white", "dye:red" }, + { "farming:cotton", "default:stick", "farming:cotton" }, + { "", "default:stick", "" } } }) @@ -76,47 +76,47 @@ minetest.register_node("streets:roadwork_traffic_fence", { description = "Traffic Fence", paramtype = "light", drawtype = "nodebox", - tiles = {"streets_roadwork_traffic_fence_top.png", "streets_roadwork_traffic_fence_top.png", "streets_roadwork_traffic_fence.png"}, + tiles = { "streets_roadwork_traffic_fence_top.png", "streets_roadwork_traffic_fence_top.png", "streets_roadwork_traffic_fence.png" }, inventory_image = "streets_roadwork_traffic_fence.png", wield_image = "streets_roadwork_traffic_fence.png", sunlight_propagates = true, - groups = {cracky = 1, wall = 1}, + groups = { cracky = 1, wall = 1 }, node_box = { type = "connected", - fixed = {-1/16, -0.5, -1/16, 1/16, 0.5, 1/16}, - connect_front = { - {-1/16, -0.5, -0.5, 1/16, -0.25, 1/16}, - {-1/16, 0.25, -0.5, 1/16, 0.5, 1/16}, - {-1/16, -0.25, -0.5, 1/16, 0.25, -7/16}, - {-1/16, -0.25, -5/16, 1/16, 0.25, -3/16} + fixed = { -1 / 16, -0.5, -1 / 16, 1 / 16, 0.5, 1 / 16 }, + connect_front = { + { -1 / 16, -0.5, -0.5, 1 / 16, -0.25, 1 / 16 }, + { -1 / 16, 0.25, -0.5, 1 / 16, 0.5, 1 / 16 }, + { -1 / 16, -0.25, -0.5, 1 / 16, 0.25, -7 / 16 }, + { -1 / 16, -0.25, -5 / 16, 1 / 16, 0.25, -3 / 16 } }, -- z- - connect_back = { - {-1/16, -0.5, -1/16, 1/16, -0.25, 0.5}, - {-1/16, 0.25, -1/16, 1/16, 0.5, 0.5}, - {-1/16, -0.25, 7/16, 1/16, 0.25, 0.5}, - {-1/16, -0.25, 3/16, 1/16, 0.25, 5/16} + connect_back = { + { -1 / 16, -0.5, -1 / 16, 1 / 16, -0.25, 0.5 }, + { -1 / 16, 0.25, -1 / 16, 1 / 16, 0.5, 0.5 }, + { -1 / 16, -0.25, 7 / 16, 1 / 16, 0.25, 0.5 }, + { -1 / 16, -0.25, 3 / 16, 1 / 16, 0.25, 5 / 16 } }, -- z+ - connect_left = { - {-0.5, -0.5, -1/16, 1/16, -0.25, 1/16}, - {-0.5, 0.25, -1/16, 1/16, 0.5, 1/16}, - {-0.5, -0.25, -1/16, -7/16, 0.25, 1/16}, - {-5/16, -0.25, -1/16, -3/16, 0.25, 1/16} + connect_left = { + { -0.5, -0.5, -1 / 16, 1 / 16, -0.25, 1 / 16 }, + { -0.5, 0.25, -1 / 16, 1 / 16, 0.5, 1 / 16 }, + { -0.5, -0.25, -1 / 16, -7 / 16, 0.25, 1 / 16 }, + { -5 / 16, -0.25, -1 / 16, -3 / 16, 0.25, 1 / 16 } }, -- x- - connect_right = { - {-1/16, -0.5, -1/16, 0.5, -0.25, 1/16}, - {-1/16, 0.25, -1/16, 0.5, 0.5, 1/16}, - {7/16, -0.25, -1/16, 0.5, 0.25, 1/16}, - {3/16, -0.25, -1/16, 5/16, 0.25, 1/16}, + connect_right = { + { -1 / 16, -0.5, -1 / 16, 0.5, -0.25, 1 / 16 }, + { -1 / 16, 0.25, -1 / 16, 0.5, 0.5, 1 / 16 }, + { 7 / 16, -0.25, -1 / 16, 0.5, 0.25, 1 / 16 }, + { 3 / 16, -0.25, -1 / 16, 5 / 16, 0.25, 1 / 16 }, } -- x+ }, - connects_to = {"group:wall", "group:stone", "group:wood", "group:tree", "group:sign", "group:concrete"}, + connects_to = { "group:wall", "group:stone", "group:wood", "group:tree", "group:sign", "group:concrete" }, }) minetest.register_craft({ output = "streets:roadwork_traffic_fence 3", recipe = { - {"dye:red", "dye:white", "dye:red"}, - {"xpanes:bar", "xpanes:bar", "xpanes:bar"}, + { "dye:red", "dye:white", "dye:red" }, + { "xpanes:bar", "xpanes:bar", "xpanes:bar" }, } }) @@ -128,16 +128,16 @@ minetest.register_node("streets:roadwork_pylon", { description = "Pylon", paramtype = "light", drawtype = "nodebox", - tiles = {"streets_roadwork_pylon_top.png", "streets_roadwork_pylon_top.png", "streets_roadwork_pylon.png"}, + tiles = { "streets_roadwork_pylon_top.png", "streets_roadwork_pylon_top.png", "streets_roadwork_pylon.png" }, sunlight_propagates = true, - groups = {cracky = 1}, + groups = { cracky = 1 }, node_box = { type = "fixed", fixed = { - {-0.375, -0.5, -0.125, 0.375, -0.4375, 0.125}, - {-0.125, -0.5, -0.375, 0.125, -0.4375, 0.375}, - {-0.3125, -0.5, 0, 0.3125, 0.1875, 0}, - {0, -0.5, -0.3125, 0, 0.1875, 0.3125}, + { -0.375, -0.5, -0.125, 0.375, -0.4375, 0.125 }, + { -0.125, -0.5, -0.375, 0.125, -0.4375, 0.375 }, + { -0.3125, -0.5, 0, 0.3125, 0.1875, 0 }, + { 0, -0.5, -0.3125, 0, 0.1875, 0.3125 }, } } }) @@ -145,9 +145,9 @@ minetest.register_node("streets:roadwork_pylon", { minetest.register_craft({ output = "streets:roadwork_pylon 3", recipe = { - {"dye:orange", "", "dye:orange"}, - {"dye:white", "default:stick", "dye:white"}, - {"dye:orange", "default:steel_ingot", "dye:orange"}, + { "dye:orange", "", "dye:orange" }, + { "dye:white", "default:stick", "dye:white" }, + { "dye:orange", "default:steel_ingot", "dye:orange" }, } }) @@ -158,18 +158,18 @@ minetest.register_node("streets:roadwork_blinking_light_off", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_off.png"}, + tiles = { "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_off.png" }, sunlight_propagates = true, - groups = {cracky = 1}, + groups = { cracky = 1 }, node_box = { type = "fixed", fixed = { - {-0.1875, -0.5, -0.125, 0.1875, -0.3125, 0.125}, -- Base - {-0.1875, -0.3125, 0, 0.1875, 0.0625, 0}, -- Light + { -0.1875, -0.5, -0.125, 0.1875, -0.3125, 0.125 }, -- Base + { -0.1875, -0.3125, 0, 0.1875, 0.0625, 0 }, -- Light } }, on_timer = function(pos, elapsed) - minetest.set_node(pos, {name = "streets:roadwork_blinking_light_on", param2 = minetest.get_node(pos).param2 }) + minetest.set_node(pos, { name = "streets:roadwork_blinking_light_on", param2 = minetest.get_node(pos).param2 }) end, on_construct = function(pos) timer = minetest.get_node_timer(pos) @@ -182,19 +182,19 @@ minetest.register_node("streets:roadwork_blinking_light_on", { paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - tiles = {"streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_on.png"}, + tiles = { "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_top.png", "streets_roadwork_blinking_light_on.png" }, sunlight_propagates = true, - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, node_box = { type = "fixed", fixed = { - {-0.1875, -0.5, -0.125, 0.1875, -0.3125, 0.125}, -- Base - {-0.1875, -0.3125, 0, 0.1875, 0.0625, 0}, -- Light + { -0.1875, -0.5, -0.125, 0.1875, -0.3125, 0.125 }, -- Base + { -0.1875, -0.3125, 0, 0.1875, 0.0625, 0 }, -- Light } }, light_source = 12, on_timer = function(pos, elapsed) - minetest.set_node(pos, {name = "streets:roadwork_blinking_light_off", param2 = minetest.get_node(pos).param2 }) + minetest.set_node(pos, { name = "streets:roadwork_blinking_light_off", param2 = minetest.get_node(pos).param2 }) end, on_construct = function(pos) timer = minetest.get_node_timer(pos) @@ -206,8 +206,8 @@ minetest.register_node("streets:roadwork_blinking_light_on", { minetest.register_craft({ output = "streets:roadwork_blinking_light_off 2", recipe = { - {"dye:red", "default:torch", "dye:red"}, - {"dye:yellow", "default:steel_ingot", "dye:yellow"}, + { "dye:red", "default:torch", "dye:red" }, + { "dye:yellow", "default:steel_ingot", "dye:yellow" }, } }) @@ -238,17 +238,17 @@ minetest.register_node("streets:roadwork_delineator_top", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, light_source = 5, node_box = { type = "fixed", fixed = { - {-1/4, -1/2, 0, 1/4, 0, 0} + { -1 / 4, -1 / 2, 0, 1 / 4, 0, 0 } } }, selection_box = { type = "fixed", - fixed = {0, 0, 0, 0, 0, 0} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -267,24 +267,24 @@ minetest.register_node("streets:roadwork_delineator_bottom", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1}, + groups = { cracky = 1 }, light_source = 5, node_box = { type = "fixed", fixed = { - {-1/4, -7/32, 0, 1/4, 1/2, 0}, - {-1/16, -5/16, -1/16, 1/16, -7/32, 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} + { -1 / 4, -7 / 32, 0, 1 / 4, 1 / 2, 0 }, + { -1 / 16, -5 / 16, -1 / 16, 1 / 16, -7 / 32, 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, 0, 1/4, 1, 0}, - {-1/16, -5/16, -1/16, 1/16, -7/32, 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} + { -1 / 4, -7 / 32, 0, 1 / 4, 1, 0 }, + { -1 / 16, -5 / 16, -1 / 16, 1 / 16, -7 / 32, 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 } } }, after_place_node = function(pos) @@ -306,9 +306,9 @@ minetest.register_alias("streets:roadwork_delineator", "streets:roadwork_delinea minetest.register_craft({ output = "streets:roadwork_delineator 5", recipe = { - {"dye:red", "default:steel_ingot", "dye:red"}, - {"dye:white", "default:steel_ingot", "dye:white"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, + { "dye:red", "default:steel_ingot", "dye:red" }, + { "dye:white", "default:steel_ingot", "dye:white" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, } }) @@ -326,10 +326,10 @@ minetest.register_node("streets:roadwork_delineator_light_off_top", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, light_source = 5, on_timer = function(pos, elapsed) - minetest.set_node(pos, {name = "streets:roadwork_delineator_light_on_top", param2 = minetest.get_node(pos).param2 }) + minetest.set_node(pos, { name = "streets:roadwork_delineator_light_on_top", param2 = minetest.get_node(pos).param2 }) end, on_construct = function(pos) timer = minetest.get_node_timer(pos) @@ -338,12 +338,12 @@ minetest.register_node("streets:roadwork_delineator_light_off_top", { node_box = { type = "fixed", fixed = { - {-1/4, -1/2, 0, 1/4, 3/8, 0} + { -1 / 4, -1 / 2, 0, 1 / 4, 3 / 8, 0 } } }, selection_box = { type = "fixed", - fixed = {0, 0, 0, 0, 0, 0} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -359,10 +359,10 @@ minetest.register_node("streets:roadwork_delineator_light_on_top", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, light_source = 12, on_timer = function(pos, elapsed) - minetest.set_node(pos, {name = "streets:roadwork_delineator_light_off_top", param2 = minetest.get_node(pos).param2 }) + minetest.set_node(pos, { name = "streets:roadwork_delineator_light_off_top", param2 = minetest.get_node(pos).param2 }) end, on_construct = function(pos) timer = minetest.get_node_timer(pos) @@ -372,12 +372,12 @@ minetest.register_node("streets:roadwork_delineator_light_on_top", { node_box = { type = "fixed", fixed = { - {-1/4, -1/2, 0, 1/4, 3/8, 0} + { -1 / 4, -1 / 2, 0, 1 / 4, 3 / 8, 0 } } }, selection_box = { type = "fixed", - fixed = {0, 0, 0, 0, 0, 0} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -396,24 +396,24 @@ minetest.register_node("streets:roadwork_delineator_light_bottom", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1}, + groups = { cracky = 1 }, light_source = 5, node_box = { type = "fixed", fixed = { - {-1/4, -7/32, 0, 1/4, 1/2, 0}, - {-1/16, -5/16, -1/16, 1/16, -7/32, 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} + { -1 / 4, -7 / 32, 0, 1 / 4, 1 / 2, 0 }, + { -1 / 16, -5 / 16, -1 / 16, 1 / 16, -7 / 32, 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, 0, 1/4, 11/8, 0}, - {-1/16, -5/16, -1/16, 1/16, -7/32, 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} + { -1 / 4, -7 / 32, 0, 1 / 4, 11 / 8, 0 }, + { -1 / 16, -5 / 16, -1 / 16, 1 / 16, -7 / 32, 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 } } }, after_place_node = function(pos) @@ -435,7 +435,7 @@ minetest.register_alias("streets:roadwork_delineator_light", "streets:roadwork_d minetest.register_craft({ output = "streets:roadwork_delineator_light", recipe = { - {"streets:roadwork_blinking_light_off"}, - {"streets:roadwork_delineator"} + { "streets:roadwork_blinking_light_off" }, + { "streets:roadwork_delineator" } } }) diff --git a/streets_rrxing/init.lua b/streets_rrxing/init.lua index 50eed8d..92ae9b2 100644 --- a/streets_rrxing/init.lua +++ b/streets_rrxing/init.lua @@ -10,7 +10,7 @@ local function play_bell(pos) local pos_hash = minetest.hash_node_position(pos) if not streets.rrxing_sound_handles[pos_hash] then streets.rrxing_sound_handles[pos_hash] = minetest.sound_play("streets_rrxing_bell", - {pos = pos, gain = 0.66, loop = true, max_hear_distance = 20,}) + { pos = pos, gain = 0.66, loop = true, max_hear_distance = 20, }) end end @@ -50,21 +50,21 @@ end local function lights_on(pos) local node = minetest.get_node(pos) local param2 = node.param2 - minetest.swap_node(pos, {name = "streets:rrxing_middle_center_on", param2 = node.param2}) + minetest.swap_node(pos, { name = "streets:rrxing_middle_center_on", param2 = node.param2 }) left_light_direction(pos, param2) - minetest.swap_node(pos, {name = "streets:rrxing_middle_left_on", param2 = node.param2}) + minetest.swap_node(pos, { name = "streets:rrxing_middle_left_on", param2 = node.param2 }) right_light_direction(pos, param2) - minetest.swap_node(pos, {name = "streets:rrxing_middle_right_on", param2 = node.param2}) + minetest.swap_node(pos, { name = "streets:rrxing_middle_right_on", param2 = node.param2 }) end local function lights_off(pos) local node = minetest.get_node(pos) local param2 = node.param2 - minetest.swap_node(pos, {name = "streets:rrxing_middle_center_off", param2 = node.param2}) + minetest.swap_node(pos, { name = "streets:rrxing_middle_center_off", param2 = node.param2 }) left_light_direction(pos, param2) - minetest.swap_node(pos, {name = "streets:rrxing_middle_left_off", param2 = node.param2}) + minetest.swap_node(pos, { name = "streets:rrxing_middle_left_off", param2 = node.param2 }) right_light_direction(pos, param2) - minetest.swap_node(pos, {name = "streets:rrxing_middle_right_off", param2 = node.param2}) + minetest.swap_node(pos, { name = "streets:rrxing_middle_right_off", param2 = node.param2 }) end local function toggle_lights(pos) @@ -92,20 +92,20 @@ minetest.register_node("streets:rrxing_top", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 3, not_in_creative_inventory = 1}, + 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} + { -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} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -116,25 +116,25 @@ minetest.register_node("streets:rrxing_middle_right_on", { "streets_tl_bg.png", "streets_tl_bg.png", "streets_rrxing_middle_right_back.png", - {name="streets_rrxing_middle_right_on.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}} + { name = "streets_rrxing_middle_right_on.png", animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 } } }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {not_in_creative_inventory = 1}, + groups = { not_in_creative_inventory = 1 }, light_source = 12, 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} + { -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} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -150,19 +150,19 @@ minetest.register_node("streets:rrxing_middle_right_off", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {not_in_creative_inventory = 1}, + groups = { not_in_creative_inventory = 1 }, 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} + { -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} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -173,25 +173,25 @@ minetest.register_node("streets:rrxing_middle_left_on", { "streets_tl_bg.png", "streets_tl_bg.png", "streets_rrxing_middle_left_back.png", - {name="streets_rrxing_middle_left_on.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}} + { name = "streets_rrxing_middle_left_on.png", animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 } } }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", light_source = 12, - groups = {not_in_creative_inventory = 1}, + groups = { not_in_creative_inventory = 1 }, 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} + { 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} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -207,19 +207,19 @@ minetest.register_node("streets:rrxing_middle_left_off", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {not_in_creative_inventory = 1}, + groups = { not_in_creative_inventory = 1 }, 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} + { 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} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -230,30 +230,30 @@ minetest.register_node("streets:rrxing_middle_center_on", { "streets_rrxing_middle_center_back.png", "streets_rrxing_middle_center_back.png", "streets_rrxing_middle_center_back.png", - {name="streets_rrxing_middle_center_on.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}} + { name = "streets_rrxing_middle_center_on.png", animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 } } }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", light_source = 12, - groups = {not_in_creative_inventory = 1}, + groups = { not_in_creative_inventory = 1 }, 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} + { -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} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -270,24 +270,24 @@ minetest.register_node("streets:rrxing_middle_center_off", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {not_in_creative_inventory = 1}, + groups = { not_in_creative_inventory = 1 }, 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} + { -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} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -303,18 +303,18 @@ minetest.register_node("streets:rrxing_middle", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 3, not_in_creative_inventory = 1}, + 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} + { -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} + fixed = { 0, 0, 0, 0, 0, 0 } } }) @@ -333,48 +333,47 @@ minetest.register_node("streets:rrxing_bottom", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 3}, + 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} + { -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}, + -- 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}, + { -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}, + { -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} + { 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 @@ -402,13 +401,12 @@ minetest.register_node("streets:rrxing_bottom", { node.name = "streets:rrxing_middle_right_off" 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 + pos.y = pos.y + 2 stop_bell(pos, node) - pos.y=pos.y-2 + pos.y = pos.y - 2 for i = 1, 3 do pos.y = pos.y + 1 @@ -423,17 +421,14 @@ minetest.register_node("streets:rrxing_bottom", { right_light_direction(pos, param2) minetest.remove_node(pos) end, - on_punch = function(pos, node) toggle_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) end end, - digiline = { receptor = {}, effector = { @@ -442,17 +437,17 @@ minetest.register_node("streets:rrxing_bottom", { if setchan ~= channel then return end - if (msg=="bell_on") then - pos.y = pos.y+2 + if (msg == "bell_on") then + pos.y = pos.y + 2 play_bell(pos) - elseif (msg=="bell_off") then - pos.y = pos.y+2 + elseif (msg == "bell_off") then + pos.y = pos.y + 2 stop_bell(pos) - elseif (msg=="lights_on") then - pos.y = pos.y+2 + elseif (msg == "lights_on") then + pos.y = pos.y + 2 lights_on(pos) - elseif (msg=="lights_off") then - pos.y = pos.y+2 + elseif (msg == "lights_off") then + pos.y = pos.y + 2 lights_off(pos) end end @@ -481,76 +476,76 @@ local function move_arm(pos) }) if node.name == "streets:rrgate_mech_down" then - minetest.set_node(pos, {name = "streets:rrgate_mech_up", param2 = node.param2}) + minetest.set_node(pos, { name = "streets:rrgate_mech_up", param2 = node.param2 }) if dir == "x+" then for i = 1, 10 do pos.x = pos.x + 1 if (string.match(minetest.get_node(pos).name, "streets:rrgate_lightfirst") - or string.match(minetest.get_node(pos).name, "streets:rrgate_end") - or string.match(minetest.get_node(pos).name, "streets:rrgate_darkfirst")) == nil then + or string.match(minetest.get_node(pos).name, "streets:rrgate_end") + or string.match(minetest.get_node(pos).name, "streets:rrgate_darkfirst")) == nil then break end - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) node.name = "streets:rrgate_up" - minetest.set_node({x=pos.x-i, y=pos.y+i, z=pos.z}, node) + minetest.set_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.get_node(pos).name, "streets:rrgate_lightfirst") - or string.match(minetest.get_node(pos).name, "streets:rrgate_end") - or string.match(minetest.get_node(pos).name, "streets:rrgate_darkfirst")) == nil then + or string.match(minetest.get_node(pos).name, "streets:rrgate_end") + or string.match(minetest.get_node(pos).name, "streets:rrgate_darkfirst")) == nil then break end - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) node.name = "streets:rrgate_up" - minetest.set_node({x=pos.x+i, y=pos.y+i, z=pos.z}, node) + minetest.set_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.get_node(pos).name, "streets:rrgate_lightfirst") - or string.match(minetest.get_node(pos).name, "streets:rrgate_end") - or string.match(minetest.get_node(pos).name, "streets:rrgate_darkfirst")) == nil then + or string.match(minetest.get_node(pos).name, "streets:rrgate_end") + or string.match(minetest.get_node(pos).name, "streets:rrgate_darkfirst")) == nil then break end - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) node.name = "streets:rrgate_up" - minetest.set_node({x=pos.x, y=pos.y+i, z=pos.z-i}, node) + minetest.set_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.get_node(pos).name, "streets:rrgate_lightfirst") - or string.match(minetest.get_node(pos).name, "streets:rrgate_end") - or string.match(minetest.get_node(pos).name, "streets:rrgate_darkfirst")) == nil then + or string.match(minetest.get_node(pos).name, "streets:rrgate_end") + or string.match(minetest.get_node(pos).name, "streets:rrgate_darkfirst")) == nil then break end - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) node.name = "streets:rrgate_up" - minetest.set_node({x=pos.x, y=pos.y+i, z=pos.z+i}, node) + minetest.set_node({ x = pos.x, y = pos.y + i, z = pos.z + i }, node) end end elseif node.name == "streets:rrgate_mech_up" then - minetest.swap_node(pos, {name = "streets:rrgate_mech_down", param2 = node.param2}) - if dir == "x+" then + minetest.swap_node(pos, { name = "streets:rrgate_mech_down", param2 = node.param2 }) + if dir == "x+" then for i = 1, 10 do pos.y = pos.y + 1 if string.match(minetest.get_node(pos).name, "streets:rrgate_up") == nil then break end - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) if i % 2 == 1 then node.name = "streets:rrgate_lightfirst" else node.name = "streets:rrgate_darkfirst" end - if minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name ~= "streets:rrgate_up" then + if minetest.get_node({ x = pos.x, y = pos.y + 1, z = pos.z }).name ~= "streets:rrgate_up" then node.name = "streets:rrgate_end" end - minetest.set_node({x=pos.x+i, y=pos.y-i, z=pos.z}, node) + minetest.set_node({ x = pos.x + i, y = pos.y - i, z = pos.z }, node) end elseif dir == "x-" then for i = 1, 10 do @@ -558,16 +553,16 @@ local function move_arm(pos) if string.match(minetest.get_node(pos).name, "streets:rrgate_up") == nil then break end - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) if i % 2 == 1 then node.name = "streets:rrgate_lightfirst" else node.name = "streets:rrgate_darkfirst" end - if minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name ~= "streets:rrgate_up" then + if minetest.get_node({ x = pos.x, y = pos.y + 1, z = pos.z }).name ~= "streets:rrgate_up" then node.name = "streets:rrgate_end" end - minetest.set_node({x=pos.x-i, y=pos.y-i, z=pos.z}, node) + minetest.set_node({ x = pos.x - i, y = pos.y - i, z = pos.z }, node) end elseif dir == "z+" then for i = 1, 10 do @@ -575,16 +570,16 @@ local function move_arm(pos) if string.match(minetest.get_node(pos).name, "streets:rrgate_up") == nil then break end - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) if i % 2 == 1 then node.name = "streets:rrgate_lightfirst" else node.name = "streets:rrgate_darkfirst" end - if minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name ~= "streets:rrgate_up" then + if minetest.get_node({ x = pos.x, y = pos.y + 1, z = pos.z }).name ~= "streets:rrgate_up" then node.name = "streets:rrgate_end" end - minetest.set_node({x=pos.x, y=pos.y-i, z=pos.z+i}, node) + minetest.set_node({ x = pos.x, y = pos.y - i, z = pos.z + i }, node) end elseif dir == "z-" then for i = 1, 10 do @@ -592,16 +587,16 @@ local function move_arm(pos) if string.match(minetest.get_node(pos).name, "streets:rrgate_up") == nil then break end - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) if i % 2 == 1 then node.name = "streets:rrgate_lightfirst" else node.name = "streets:rrgate_darkfirst" end - if minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name ~= "streets:rrgate_up" then + if minetest.get_node({ x = pos.x, y = pos.y + 1, z = pos.z }).name ~= "streets:rrgate_up" then node.name = "streets:rrgate_end" end - minetest.set_node({x=pos.x, y=pos.y-i, z=pos.z-i}, node) + minetest.set_node({ x = pos.x, y = pos.y - i, z = pos.z - i }, node) end end end @@ -619,58 +614,57 @@ minetest.register_node("streets:rrgate_mech_down", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1}, + 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}, + { -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}, + { -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}, + { 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}, + { -3 / 8, -1 / 2, -1 / 2, 3 / 8, -1 / 4, -3 / 8 }, - {-7/16, -1/16, -1/16, 7/16, 1/16, 1/16} + { -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}, + { -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}, + { -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}, + { 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}, + { -3 / 8, -1 / 2, -1 / 2, 3 / 8, -1 / 4, -3 / 8 }, - {-7/16, -1/16, -1/16, 7/16, 1/16, 1/16} + { -7 / 16, -1 / 16, -1 / 16, 7 / 16, 1 / 16, 1 / 16 } } }, - after_place_node = function(pos) local node = minetest.get_node(pos) node.name = "streets:rrgate_mech_bottom" @@ -679,12 +673,10 @@ minetest.register_node("streets:rrgate_mech_down", { node.name = "streets:rrgate_mech_down" minetest.set_node(pos, node) end, - after_dig_node = function(pos) pos.y = pos.y - 1 - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) end, - on_punch = function(pos) move_arm(pos) end @@ -701,64 +693,62 @@ minetest.register_node("streets:rrgate_mech_up", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, drop = "streets:rrgate_mech_down", 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}, + { -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}, + { -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}, + { 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}, + { -3 / 8, 3 / 8, -1 / 2, 3 / 8, 1 / 2, -1 / 4 }, - {-7/16, -1/16, -1/16, 7/16, 1/16, 1/16} + { -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}, + { -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}, + { -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}, + { 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}, + { -3 / 8, 3 / 8, -1 / 2, 3 / 8, 1 / 2, -1 / 4 }, - {-7/16, -1/16, -1/16, 7/16, 1/16, 1/16} + { -7 / 16, -1 / 16, -1 / 16, 7 / 16, 1 / 16, 1 / 16 } } }, - after_dig_node = function(pos) pos.y = pos.y - 1 - minetest.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) end, - on_punch = function(pos) move_arm(pos) end @@ -776,43 +766,39 @@ minetest.register_node("streets:rrgate_mech_bottom", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, drop = "streets:rrgate_mech_down", 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} + { -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} + { -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.set_node(pos,{name="air"}) + minetest.set_node(pos, { name = "air" }) 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) if (fields.channel) then minetest.get_meta(pos):set_string("channel", fields.channel) end end, - digiline = { receptor = {}, effector = { @@ -823,7 +809,7 @@ minetest.register_node("streets:rrgate_mech_bottom", { end pos.y = pos.y + 1 local mechnode = minetest.get_node(pos) - if ((msg == "up" and mechnode.name=="streets:rrgate_mech_down") or (msg == "down" and mechnode.name=="streets:rrgate_mech_up")) then + if ((msg == "up" and mechnode.name == "streets:rrgate_mech_down") or (msg == "down" and mechnode.name == "streets:rrgate_mech_up")) then move_arm(pos) end end @@ -836,30 +822,30 @@ minetest.register_node("streets:rrgate_lightfirst", { tiles = { "streets_rrgate_top.png", "streets_rrgate_side.png", - {name="streets_rrgate_lightfirst.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}}, - {name="streets_rrgate_lightfirst.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}}, + { name = "streets_rrgate_lightfirst.png", animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 } }, + { name = "streets_rrgate_lightfirst.png", animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 } }, "streets_rrgate_side.png", "streets_rrgate_side.png" }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1}, + groups = { cracky = 1 }, light_source = 12, 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} + { -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} + { -1 / 8, -1 / 2, -1 / 2, 1 / 8, -1 / 4, 1 / 2 } } } }) @@ -868,30 +854,30 @@ minetest.register_node("streets:rrgate_darkfirst", { tiles = { "streets_rrgate_top.png", "streets_rrgate_side.png", - {name="streets_rrgate_darkfirst.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}}, - {name="streets_rrgate_darkfirst.png",animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}}, + { name = "streets_rrgate_darkfirst.png", animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 } }, + { name = "streets_rrgate_darkfirst.png", animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 } }, "streets_rrgate_side.png", "streets_rrgate_side.png" }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, drop = "streets:rrgate_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} + { -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} + { -1 / 8, -1 / 2, -1 / 2, 1 / 8, -1 / 4, 1 / 2 } } } }) @@ -908,22 +894,22 @@ minetest.register_node("streets:rrgate_end", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, drop = "streets:rrgate_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} + { -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} + { -1 / 8, -1 / 2, -1 / 2, 1 / 8, -1 / 4, 1 / 2 } } } }) @@ -940,22 +926,22 @@ minetest.register_node("streets:rrgate_up", { drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, drop = "streets:rrgate_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} + { -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} + { -1 / 8, -1 / 2, -1 / 2, 1 / 8, 1 / 2, -1 / 4 } } } }) @@ -963,26 +949,26 @@ minetest.register_node("streets:rrgate_up", { minetest.register_craft({ output = "streets:rrxing_bottom", recipe = { - {"","default:copper_ingot",""}, - {"wool:red","default:sign_wall_wood","wool:red"}, - {"default:steel_ingot","default:steel_ingot","default:steel_ingot"} + { "", "default:copper_ingot", "" }, + { "wool:red", "default:sign_wall_wood", "wool:red" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } } }) minetest.register_craft({ output = "streets:rrgate_mech_down", recipe = { - {"","default:copper_ingot","streets:rrgate_lightfirst"}, - {"","default:steel_ingot",""}, - {"default:steel_ingot","default:steel_ingot","default:steel_ingot"} + { "", "default:copper_ingot", "streets:rrgate_lightfirst" }, + { "", "default:steel_ingot", "" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } } }) minetest.register_craft({ output = "streets:rrgate_lightfirst 4", recipe = { - {"default:steel_ingot","default:torch","default:steel_ingot"}, - {"dye:red","dye:white","dye:red"}, - {"default:steel_ingot","default:steel_ingot","default:steel_ingot"} + { "default:steel_ingot", "default:torch", "default:steel_ingot" }, + { "dye:red", "dye:white", "dye:red" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } } }) diff --git a/streets_signs/init.lua b/streets_signs/init.lua index ca32722..c33a68d 100644 --- a/streets_signs/init.lua +++ b/streets_signs/init.lua @@ -36,6 +36,12 @@ streets.register_road_sign({ thickness = 0.05 }) +minetest.register_craft({ + type = "shapeless", + output = "streets:sign_blank", + recipe = { "streets:asphalt", "default:sign_wall_wood" }, +}) + streets.register_road_sign({ name = "sign_curve_chevron_right", friendlyname = "Curve Chevron Sign (Right)", diff --git a/streets_signworkshop/init.lua b/streets_signworkshop/init.lua index e29e8e5..f614ceb 100644 --- a/streets_signworkshop/init.lua +++ b/streets_signworkshop/init.lua @@ -13,11 +13,11 @@ function streets.signworkshop.start(pos) end local meta = minetest.get_meta(pos) local inv = meta:get_inventory() - local template = inv:get_stack("template",1):get_name() + local template = inv:get_stack("template", 1):get_name() if not (template and template ~= "") then return end - local surface = inv:get_stack("surface",1):get_name() + local surface = inv:get_stack("surface", 1):get_name() if not (surface and surface ~= "") then return end @@ -26,20 +26,20 @@ function streets.signworkshop.start(pos) return end local dye_level_ok = true - for k,v in pairs(dyes_needed) do - dye_level_ok = dye_level_ok and inv:contains_item("dye",{name = "dye:"..k,count = v}) + for k, v in pairs(dyes_needed) do + dye_level_ok = dye_level_ok and inv:contains_item("dye", { name = "dye:" .. k, count = v }) end if not dye_level_ok then return end - if not inv:room_for_item("output",{name = template,count = 1}) then + if not inv:room_for_item("output", { name = template, count = 1 }) then return end - meta:set_string("working_on",template) - meta:set_int("progress",0) - inv:remove_item("surface",{name = inv:get_stack("surface",1):get_name(),count = 1}) - for k,v in pairs(dyes_needed) do - inv:remove_item("dye",{name = "dye:"..k,count = v}) + meta:set_string("working_on", template) + meta:set_int("progress", 0) + inv:remove_item("surface", { name = inv:get_stack("surface", 1):get_name(), count = 1 }) + for k, v in pairs(dyes_needed) do + inv:remove_item("dye", { name = "dye:" .. k, count = v }) end streets.signworkshop.step(pos) end @@ -57,16 +57,16 @@ function streets.signworkshop.step(pos) local progress = meta:get_int("progress") progress = progress + 1 if progress < 10 then - minetest.after(0.2,streets.signworkshop.step,pos) + minetest.after(0.2, streets.signworkshop.step, pos) else - meta:set_int("progress",0) + meta:set_int("progress", 0) progress = 0 - inv:add_item("output",meta:get_string("working_on")) - meta:set_string("working_on","") + inv:add_item("output", meta:get_string("working_on")) + meta:set_string("working_on", "") streets.signworkshop.start(pos) end - meta:set_int("progress",progress) - streets.signworkshop.update_formspec(pos) + meta:set_int("progress", progress) + streets.signworkshop.update_formspec(pos) end function streets.signworkshop.update_formspec(pos) @@ -82,7 +82,7 @@ function streets.signworkshop.update_formspec(pos) elseif page > maxpage then page = 1 end - meta:set_int("page",page) + meta:set_int("page", page) local fs = "size[9,9;]" fs = fs .. "tabheader[0,0;tabs;" fs = fs .. minetest.formspec_escape("Dye Storage") .. "," @@ -96,10 +96,10 @@ function streets.signworkshop.update_formspec(pos) elseif meta:get_int("tab") == 2 then local x_pos = 0.5 local y_pos = 0 - for k,v in pairs(streets.signs.sections) do + for k, v in pairs(streets.signs.sections) do fs = fs .. "button[" .. x_pos .. "," .. y_pos .. ";2.5,1;" - fs = fs..minetest.formspec_escape(v.name) .. ";" - fs = fs..minetest.formspec_escape(v.friendlyname) .. "]" + fs = fs .. minetest.formspec_escape(v.name) .. ";" + fs = fs .. minetest.formspec_escape(v.friendlyname) .. "]" y_pos = y_pos + 0.8 if y_pos > 4 then y_pos = 0 @@ -109,18 +109,18 @@ function streets.signworkshop.update_formspec(pos) elseif meta:get_int("tab") == 3 then fs = fs .. "label[0,0;Dyes Needed]" fs = fs .. "list[context;dye_needed;0,0.5;2,3]" - fs = fs .. "list[context;list;2.25,0;4,4;"..tostring((page-1)*16).."]" --Each page is a 4x4 grid (16 items) + fs = fs .. "list[context;list;2.25,0;4,4;" .. tostring((page - 1) * 16) .. "]" --Each page is a 4x4 grid (16 items) fs = fs .. "label[6.5,0.5;Blank Sign]" fs = fs .. "label[7.5,0.5;Template]" fs = fs .. "list[context;surface;6.5,1;1,1]" fs = fs .. "list[context;template;7.5,1;1,1]" - fs = fs .. "image[7,2;1,1;gui_furnace_arrow_bg.png^[lowpart:" .. meta:get_int("progress")*10 .. ":gui_furnace_arrow_fg.png^[transformR180]" + fs = fs .. "image[7,2;1,1;gui_furnace_arrow_bg.png^[lowpart:" .. meta:get_int("progress") * 10 .. ":gui_furnace_arrow_fg.png^[transformR180]" fs = fs .. "list[context;output;7,3;1,1]" fs = fs .. "button[2.25,4;1,1;prevpage;<-]" fs = fs .. "button[5.25,4;1,1;nextpage;->]" - fs = fs .. "label[3.75,4;"..string.format("Page %s of %s",page,maxpage).."]" + fs = fs .. "label[3.75,4;" .. string.format("Page %s of %s", page, maxpage) .. "]" if minetest.setting_getbool("creative_mode") then - fs = fs .."label[0,3.5;CREATIVE MODE\nTaking templates\nis enabled]" + fs = fs .. "label[0,3.5;CREATIVE MODE\nTaking templates\nis enabled]" end end fs = fs .. "list[current_player;main;0.5,5;8,4]" @@ -136,7 +136,7 @@ local function update_inventory(pos) local inv = meta:get_inventory() local section = meta:get_string("section") local itemcount = 0 - for k,v in pairs(streets.signs.signtypes) do + for k, v in pairs(streets.signs.signtypes) do if v.section == section then itemcount = itemcount + 1 end @@ -144,23 +144,23 @@ local function update_inventory(pos) inv:set_size("dye_needed", 0) inv:set_size("list", 0) inv:set_size("dye_needed", 6) - inv:set_size("list", math.ceil(itemcount/16)*16) + inv:set_size("list", math.ceil(itemcount / 16) * 16) inv:set_size("dye", 32) -- 8x4 inv:set_size("surface", 1) inv:set_size("template", 1) inv:set_size("output", 1) - for k,v in pairs(streets.signs.signtypes) do + for k, v in pairs(streets.signs.signtypes) do if v.section == section then - inv:add_item("list","streets:"..v.name) + inv:add_item("list", "streets:" .. v.name) end end - meta:set_int("maxpage", math.ceil(itemcount/16)) - local templatestack = inv:get_stack("template",1) + meta:set_int("maxpage", math.ceil(itemcount / 16)) + local templatestack = inv:get_stack("template", 1) if templatestack and templatestack:to_string() ~= "" then local selectedmarking = templatestack:to_table().name local dyesneeded = streets.signs.signtypes[selectedmarking].dye_needed - for k,v in pairs(dyesneeded) do - inv:add_item("dye_needed", {name = "dye:"..k,count = v}) + for k, v in pairs(dyesneeded) do + inv:add_item("dye_needed", { name = "dye:" .. k, count = v }) end end streets.signworkshop.update_formspec(pos) @@ -169,7 +169,7 @@ local function update_inventory(pos) end end -local function on_receive_fields(pos,formname,fields,sender) +local function on_receive_fields(pos, formname, fields, sender) local meta = minetest.get_meta(pos) if fields.tabs then meta:set_int("tab", fields.tabs) @@ -179,7 +179,7 @@ local function on_receive_fields(pos,formname,fields,sender) elseif fields.nextpage then meta:set_int("page", meta:get_int("page") + 1) else - for k,v in pairs(streets.signs.sections) do + for k, v in pairs(streets.signs.sections) do if fields[v.name] then meta:set_string("section", v.name) meta:set_int("tab", 3) @@ -234,7 +234,7 @@ local function on_metadata_inventory_take(pos, listname, index, stack, player) end local function allow_metadata_inventory_put(pos, listname, index, stack, player) - if listname == "dye" and stack:get_name():sub(1,4) == "dye:" then + if listname == "dye" and stack:get_name():sub(1, 4) == "dye:" then return stack:get_count() elseif (listname == "surface" and stack:get_name() == "streets:sign_blank") or (listname == "list" and minetest.setting_getbool("creative_mode")) then return stack:get_count() @@ -243,7 +243,7 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player) end end -local function can_dig(pos,player) +local function can_dig(pos, player) local inv = minetest.get_meta(pos):get_inventory() if inv:is_empty("dye") and inv:is_empty("surface") and inv:is_empty("output") then return true @@ -254,30 +254,34 @@ end minetest.register_node(":streets:sign_workshop", { description = "Sign Workshop", - tiles = {"default_wood.png",}, + tiles = { + "default_wood.png", "default_wood.png", + "default_wood.png^default_sign_steel.png", "default_wood.png^default_sign_steel.png", + "default_wood.png^default_sign_steel.png", "default_wood.png", + }, drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1}, + groups = { cracky = 1 }, node_box = { type = "fixed", fixed = { - {-0.4375, 0.375, -0.1875, 0.4375, 0.4375, -0.125}, -- rail - {-0.125, 0.3125, -0.25, -0.0625, 0.375, -0.0625}, -- sprayer - {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5}, -- sideL - {0.4375, -0.5, -0.5, 0.5, 0.5, 0.5}, -- sideR - {-0.4375, 0.3125, -0.5, -0.375, 0.375, 0.5}, -- railLB - {-0.4375, 0.4375, -0.5, -0.375, 0.5, 0.5}, -- railLT - {-0.4375, 0.375, -0.5, -0.375, 0.4375, -0.4375}, -- railLF - {-0.4375, -0.5, 0.4375, 0.4375, 0.5, 0.5}, -- sideR - {0.375, 0.3125, -0.5, 0.4375, 0.375, 0.5}, -- railRB - {0.375, 0.4375, -0.5, 0.4375, 0.5, 0.5}, -- railRT - {0.375, 0.375, -0.5, 0.4375, 0.4375, -0.4375}, -- railRF - {-0.4375, 0.375, 0.375, -0.375, 0.4375, 0.4375}, -- railLB - {0.375, 0.3125, 0.375, 0.4375, 0.375, 0.4375}, -- railRB - {-0.5, -0.5, -0.5, -0.375, 0.3125, 0.4375}, -- sideL2 - {0.375, -0.5, -0.5, 0.4375, 0.3125, 0.4375}, -- sideR2 - {-0.4375, -0.5, -0.4375, 0.4375, -0.1875, 0.4375}, -- body + { -0.4375, 0.375, -0.1875, 0.4375, 0.4375, -0.125 }, -- rail + { -0.125, 0.3125, -0.25, -0.0625, 0.375, -0.0625 }, -- sprayer + { -0.5, -0.5, -0.5, -0.4375, 0.5, 0.5 }, -- sideL + { 0.4375, -0.5, -0.5, 0.5, 0.5, 0.5 }, -- sideR + { -0.4375, 0.3125, -0.5, -0.375, 0.375, 0.5 }, -- railLB + { -0.4375, 0.4375, -0.5, -0.375, 0.5, 0.5 }, -- railLT + { -0.4375, 0.375, -0.5, -0.375, 0.4375, -0.4375 }, -- railLF + { -0.4375, -0.5, 0.4375, 0.4375, 0.5, 0.5 }, -- sideR + { 0.375, 0.3125, -0.5, 0.4375, 0.375, 0.5 }, -- railRB + { 0.375, 0.4375, -0.5, 0.4375, 0.5, 0.5 }, -- railRT + { 0.375, 0.375, -0.5, 0.4375, 0.4375, -0.4375 }, -- railRF + { -0.4375, 0.375, 0.375, -0.375, 0.4375, 0.4375 }, -- railLB + { 0.375, 0.3125, 0.375, 0.4375, 0.375, 0.4375 }, -- railRB + { -0.5, -0.5, -0.5, -0.375, 0.3125, 0.4375 }, -- sideL2 + { 0.375, -0.5, -0.5, 0.4375, 0.3125, 0.4375 }, -- sideR2 + { -0.4375, -0.5, -0.4375, 0.4375, -0.1875, 0.4375 }, -- body } }, selection_box = { @@ -293,3 +297,12 @@ minetest.register_node(":streets:sign_workshop", { on_metadata_inventory_take = on_metadata_inventory_take, can_dig = can_dig, }) + +minetest.register_craft({ + output = "streets:sign_workshop", + recipe = { + { "streets:sign_blank", "streets:sign_blank", "streets:sign_blank" }, + { "streets:sign_blank", "default:mese_crystal_fragment", "streets:sign_blank" }, + { "streets:sign_blank", "streets:sign_blank", "streets:sign_blank" }, + } +}) \ No newline at end of file diff --git a/streets_steelsupport/init.lua b/streets_steelsupport/init.lua index 1111578..1fa069d 100644 --- a/streets_steelsupport/init.lua +++ b/streets_steelsupport/init.lua @@ -4,10 +4,10 @@ Optional: true ]] -minetest.register_node(":streets:steel_support",{ +minetest.register_node(":streets:steel_support", { description = "Steel support", - tiles = {"streets_support.png"}, - groups = {cracky = 1}, + tiles = { "streets_support.png" }, + groups = { cracky = 1 }, drawtype = "glasslike_framed", climbable = true, sunlight_propagates = true, @@ -15,7 +15,7 @@ minetest.register_node(":streets:steel_support",{ collision_box = { type = "fixed", fixed = { - {-0.15, -0.5, -0.15, 0.15, 0.5, 0.15}, + { -0.15, -0.5, -0.15, 0.15, 0.5, 0.15 }, }, }, }) @@ -23,8 +23,8 @@ minetest.register_node(":streets:steel_support",{ minetest.register_craft({ output = "streets:steel_support 5", 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", "" }, + { "default:steel_ingot", "", "default:steel_ingot" } } }) diff --git a/streets_trafficlight/init.lua b/streets_trafficlight/init.lua index bebe5e7..d807573 100644 --- a/streets_trafficlight/init.lua +++ b/streets_trafficlight/init.lua @@ -4,92 +4,92 @@ Optional: true ]] -streets.tlBox = { - {-0.1875,-0.5,0.5,0.1875,0.5,0.75}, --Box +streets.tlBox = { + { -0.1875, -0.5, 0.5, 0.1875, 0.5, 0.75 }, --Box - {-0.125, -0.125, 0.85, 0.125, 0.125, 0.75}, -- Pole Mounting Bracket + { -0.125, -0.125, 0.85, 0.125, 0.125, 0.75 }, -- Pole Mounting Bracket - {-0.125,0.3125,0.3125,-0.0625,0.375,0.5}, --Top Visor, Left - {-0.0625,0.375,0.3125,0.0625,0.4375,0.5}, --Top Visor, Center - {0.0625,0.3125,0.3125,0.125,0.38,0.5}, --Top Visor, Right + { -0.125, 0.3125, 0.3125, -0.0625, 0.375, 0.5 }, --Top Visor, Left + { -0.0625, 0.375, 0.3125, 0.0625, 0.4375, 0.5 }, --Top Visor, Center + { 0.0625, 0.3125, 0.3125, 0.125, 0.38, 0.5 }, --Top Visor, Right - {-0.125,0,0.3125,-0.0625,0.0625,0.5}, --Middle Visor, Left - {-0.0625,0.0625,0.3125,0.0625,0.125,0.5}, --Middle Visor, Center - {0.0625,0,0.3125,0.125,0.0625,0.5}, --Middle Visor, Right + { -0.125, 0, 0.3125, -0.0625, 0.0625, 0.5 }, --Middle Visor, Left + { -0.0625, 0.0625, 0.3125, 0.0625, 0.125, 0.5 }, --Middle Visor, Center + { 0.0625, 0, 0.3125, 0.125, 0.0625, 0.5 }, --Middle Visor, Right - {-0.125,-0.3125,0.3125,-0.0625,-0.25,0.5}, --Bottom Visor, Left - {-0.0625,-0.25,0.3125,0.0625,-0.1875,0.5}, --Bottom Visor, Center - {0.0625,-0.3125,0.3125,0.125,-0.25,0.5}, --Bottom Visor, Right + { -0.125, -0.3125, 0.3125, -0.0625, -0.25, 0.5 }, --Bottom Visor, Left + { -0.0625, -0.25, 0.3125, 0.0625, -0.1875, 0.5 }, --Bottom Visor, Center + { 0.0625, -0.3125, 0.3125, 0.125, -0.25, 0.5 }, --Bottom Visor, Right } streets.tleBox = { - {-0.1875,-0.1875,0.5,0.1875,0.5,0.75}, --Box + { -0.1875, -0.1875, 0.5, 0.1875, 0.5, 0.75 }, --Box - {-0.125,0.3125,0.3125,-0.0625,0.375,0.5}, --Top Visor, Left - {-0.0625,0.375,0.3125,0.0625,0.4375,0.5}, --Top Visor, Center - {0.0625,0.3125,0.3125,0.125,0.38,0.5}, --Top Visor, Right + { -0.125, 0.3125, 0.3125, -0.0625, 0.375, 0.5 }, --Top Visor, Left + { -0.0625, 0.375, 0.3125, 0.0625, 0.4375, 0.5 }, --Top Visor, Center + { 0.0625, 0.3125, 0.3125, 0.125, 0.38, 0.5 }, --Top Visor, Right - {-0.125,0,0.3125,-0.0625,0.0625,0.5}, --Middle Visor, Left - {-0.0625,0.0625,0.3125,0.0625,0.125,0.5}, --Middle Visor, Center - {0.0625,0,0.3125,0.125,0.0625,0.5}, --Middle Visor, Right + { -0.125, 0, 0.3125, -0.0625, 0.0625, 0.5 }, --Middle Visor, Left + { -0.0625, 0.0625, 0.3125, 0.0625, 0.125, 0.5 }, --Middle Visor, Center + { 0.0625, 0, 0.3125, 0.125, 0.0625, 0.5 }, --Middle Visor, Right } -streets.plBox = { - {-0.1875,-0.5,0.5,0.1875,0.5,0.75}, --Box +streets.plBox = { + { -0.1875, -0.5, 0.5, 0.1875, 0.5, 0.75 }, --Box - {-0.125, -0.125, 0.85, 0.125, 0.125, 0.75}, -- Pole Mounting Bracket + { -0.125, -0.125, 0.85, 0.125, 0.125, 0.75 }, -- Pole Mounting Bracket - {-0.1875,0.0625,0.3125,-0.1375,0.4375,0.5}, --Top Visor, Left - {-0.1375,0.3875,0.3125,0.1375,0.4375,0.5}, --Top Visor, Center - {0.1875,0.0625,0.3125,0.1375,0.4375,0.5}, --Top Visor, Right + { -0.1875, 0.0625, 0.3125, -0.1375, 0.4375, 0.5 }, --Top Visor, Left + { -0.1375, 0.3875, 0.3125, 0.1375, 0.4375, 0.5 }, --Top Visor, Center + { 0.1875, 0.0625, 0.3125, 0.1375, 0.4375, 0.5 }, --Top Visor, Right - {-0.1875,-0.0625,0.3125,-0.1375,-0.4375,0.5}, --Bottom Visor, Left - {-0.1375,-0.0625,0.3125,0.1375,-0.1125,0.5}, --Bottom Visor, Center - {0.1875,-0.0625,0.3125,0.1375,-0.4375,0.5}, --Bottom Visor, Right + { -0.1875, -0.0625, 0.3125, -0.1375, -0.4375, 0.5 }, --Bottom Visor, Left + { -0.1375, -0.0625, 0.3125, 0.1375, -0.1125, 0.5 }, --Bottom Visor, Center + { 0.1875, -0.0625, 0.3125, 0.1375, -0.4375, 0.5 }, --Bottom Visor, Right } -streets.bBox = { - {-0.1875,-0.1875,0.5,0.1875,0.1875,0.75}, --Box +streets.bBox = { + { -0.1875, -0.1875, 0.5, 0.1875, 0.1875, 0.75 }, --Box - {-0.125, -0.125, 0.85, 0.125, 0.125, 0.75}, -- Pole Mounting Bracket + { -0.125, -0.125, 0.85, 0.125, 0.125, 0.75 }, -- Pole Mounting Bracket - {-0.125,0,0.3125,-0.0625,0.0625,0.5}, --Visor, Left - {-0.0625,0.0625,0.3125,0.0625,0.125,0.5}, --Visor, Center - {0.0625,0,0.3125,0.125,0.0625,0.5}, --Visor, Right + { -0.125, 0, 0.3125, -0.0625, 0.0625, 0.5 }, --Visor, Left + { -0.0625, 0.0625, 0.3125, 0.0625, 0.125, 0.5 }, --Visor, Center + { 0.0625, 0, 0.3125, 0.125, 0.0625, 0.5 }, --Visor, Right } -streets.hbBox = { - {-0.375,-0.25,0.5,0.375,0.25,0.75}, --Box +streets.hbBox = { + { -0.375, -0.25, 0.5, 0.375, 0.25, 0.75 }, --Box - {-0.125, -0.125, 0.85, 0.125, 0.125, 0.75}, -- Pole Mounting Bracket + { -0.125, -0.125, 0.85, 0.125, 0.125, 0.75 }, -- Pole Mounting Bracket - {-0.3,0.0625,0.3125,-0.2375,0.125,0.5}, --Top Left Visor, Left - {-0.2375,0.125,0.3125,-0.1125,0.1875,0.5}, --Top Left Visor, Center - {-0.1125,0.0625,0.3125,-0.05,0.125,0.5}, --Top Left Visor, Right + { -0.3, 0.0625, 0.3125, -0.2375, 0.125, 0.5 }, --Top Left Visor, Left + { -0.2375, 0.125, 0.3125, -0.1125, 0.1875, 0.5 }, --Top Left Visor, Center + { -0.1125, 0.0625, 0.3125, -0.05, 0.125, 0.5 }, --Top Left Visor, Right - {0.1125,0.0625,0.3125,0.05,0.125,0.5}, --Top Right Visor, Left - {0.2375,0.125,0.3125,0.1125,0.1875,0.5}, --Top Right Visor, Center - {0.3,0.0625,0.3125,0.2375,0.125,0.5}, --Top Right Visor, Right + { 0.1125, 0.0625, 0.3125, 0.05, 0.125, 0.5 }, --Top Right Visor, Left + { 0.2375, 0.125, 0.3125, 0.1125, 0.1875, 0.5 }, --Top Right Visor, Center + { 0.3, 0.0625, 0.3125, 0.2375, 0.125, 0.5 }, --Top Right Visor, Right - {-0.125,-0.125,0.3125,-0.0625,-0.0625,0.5}, --Bottom Visor, Left - {-0.0625,-0.0625,0.3125,0.0625,0,0.5}, --Bottom Visor, Center - {0.0625,-0.125,0.3125,0.125,-0.0625,0.5}, --Bottom Visor, Right + { -0.125, -0.125, 0.3125, -0.0625, -0.0625, 0.5 }, --Bottom Visor, Left + { -0.0625, -0.0625, 0.3125, 0.0625, 0, 0.5 }, --Bottom Visor, Center + { 0.0625, -0.125, 0.3125, 0.125, -0.0625, 0.5 }, --Bottom Visor, Right } streets.tlDigilineRules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y=-1, z= 0}, - {x= 0, y= 1, z= 0} - } + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = -1, z = 0 }, + { x = 0, y = 1, z = 0 } +} -streets.tlSwitch = function(pos,to) +streets.tlSwitch = function(pos, to) if not pos or not to then return end - minetest.swap_node(pos, {name = to, param2 = minetest.get_node(pos).param2}) + minetest.swap_node(pos, { name = to, param2 = minetest.get_node(pos).param2 }) end streets.on_digiline_receive = function(pos, node, channel, msg) @@ -105,75 +105,75 @@ streets.on_digiline_receive = function(pos, node, channel, msg) msg = string.upper(msg) if msg == "OFF" then if name:find("pedlight") then - streets.tlSwitch(pos,"streets:pedlight_top_off") + streets.tlSwitch(pos, "streets:pedlight_top_off") elseif name:find("extender_left") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_left_off") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_left_off") elseif name:find("extender_right") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_right_off") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_right_off") elseif name:find("left") then - streets.tlSwitch(pos,"streets:trafficlight_top_left_off") + streets.tlSwitch(pos, "streets:trafficlight_top_left_off") elseif name:find("right") then - streets.tlSwitch(pos,"streets:trafficlight_top_right_off") + streets.tlSwitch(pos, "streets:trafficlight_top_right_off") elseif name:find("beacon_hybrid") then - streets.tlSwitch(pos,"streets:beacon_hybrid_off") + streets.tlSwitch(pos, "streets:beacon_hybrid_off") elseif name:find("beacon") then - streets.tlSwitch(pos,"streets:beacon_off") + streets.tlSwitch(pos, "streets:beacon_off") else - streets.tlSwitch(pos,"streets:trafficlight_top_off") + streets.tlSwitch(pos, "streets:trafficlight_top_off") end elseif msg == "GREEN" then if name:find("pedlight") then - streets.tlSwitch(pos,"streets:pedlight_top_walk") + streets.tlSwitch(pos, "streets:pedlight_top_walk") elseif name:find("extender_left") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_left_green") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_left_green") elseif name:find("extender_right") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_right_green") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_right_green") elseif name:find("left") then - streets.tlSwitch(pos,"streets:trafficlight_top_left_green") + streets.tlSwitch(pos, "streets:trafficlight_top_left_green") elseif name:find("right") then - streets.tlSwitch(pos,"streets:trafficlight_top_right_green") + streets.tlSwitch(pos, "streets:trafficlight_top_right_green") elseif name:find("beacon_hybrid") then --Not Supported elseif name:find("beacon") then --Not Supported else - streets.tlSwitch(pos,"streets:trafficlight_top_green") + streets.tlSwitch(pos, "streets:trafficlight_top_green") end elseif msg == "RED" then if name:find("pedlight") then - streets.tlSwitch(pos,"streets:pedlight_top_dontwalk") + streets.tlSwitch(pos, "streets:pedlight_top_dontwalk") elseif name:find("extender_left") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_left_off") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_left_off") elseif name:find("extender_right") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_right_off") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_right_off") elseif name:find("left") then - streets.tlSwitch(pos,"streets:trafficlight_top_left_red") + streets.tlSwitch(pos, "streets:trafficlight_top_left_red") elseif name:find("right") then - streets.tlSwitch(pos,"streets:trafficlight_top_right_red") + streets.tlSwitch(pos, "streets:trafficlight_top_right_red") elseif name:find("beacon_hybrid") then - streets.tlSwitch(pos,"streets:beacon_hybrid_red") + streets.tlSwitch(pos, "streets:beacon_hybrid_red") elseif name:find("beacon") then --Not Supported else - streets.tlSwitch(pos,"streets:trafficlight_top_red") + streets.tlSwitch(pos, "streets:trafficlight_top_red") end elseif msg == "FLASHGREEN" then if name:find("pedlight") then - streets.tlSwitch(pos,"streets:pedlight_top_flashingwalk") + streets.tlSwitch(pos, "streets:pedlight_top_flashingwalk") elseif name:find("extender_left") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_left_flashgreen") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_left_flashgreen") elseif name:find("extender_right") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_right_flashgreen") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_right_flashgreen") elseif name:find("left") then - streets.tlSwitch(pos,"streets:trafficlight_top_left_flashgreen") + streets.tlSwitch(pos, "streets:trafficlight_top_left_flashgreen") elseif name:find("right") then - streets.tlSwitch(pos,"streets:trafficlight_top_right_flashgreen") + streets.tlSwitch(pos, "streets:trafficlight_top_right_flashgreen") elseif name:find("beacon_hybrid") then --Not Supported elseif name:find("beacon") then --Not Supported else - streets.tlSwitch(pos,"streets:trafficlight_top_flashgreen") + streets.tlSwitch(pos, "streets:trafficlight_top_flashgreen") end elseif msg == "REDYELLOW" then if name:find("pedlight") then @@ -183,105 +183,105 @@ streets.on_digiline_receive = function(pos, node, channel, msg) elseif name:find("extender_right") then --Not Supported elseif name:find("left") then - streets.tlSwitch(pos,"streets:trafficlight_top_left_redyellow") + streets.tlSwitch(pos, "streets:trafficlight_top_left_redyellow") elseif name:find("right") then - streets.tlSwitch(pos,"streets:trafficlight_top_right_redyellow") + streets.tlSwitch(pos, "streets:trafficlight_top_right_redyellow") elseif name:find("beacon_hybrid") then --Not Supported elseif name:find("beacon") then --Not Supported else - streets.tlSwitch(pos,"streets:trafficlight_top_redyellow") + streets.tlSwitch(pos, "streets:trafficlight_top_redyellow") end elseif msg == "FLASHYELLOW" then if name:find("pedlight") then - streets.tlSwitch(pos,"streets:pedlight_top_flashingdontwalk") + streets.tlSwitch(pos, "streets:pedlight_top_flashingdontwalk") elseif name:find("extender_left") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_left_off") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_left_off") elseif name:find("extender_right") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_right_off") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_right_off") elseif name:find("left") then - streets.tlSwitch(pos,"streets:trafficlight_top_left_warn") + streets.tlSwitch(pos, "streets:trafficlight_top_left_warn") elseif name:find("right") then - streets.tlSwitch(pos,"streets:trafficlight_top_right_warn") + streets.tlSwitch(pos, "streets:trafficlight_top_right_warn") elseif name:find("beacon_hybrid") then - streets.tlSwitch(pos,"streets:beacon_hybrid_flashyellow") + streets.tlSwitch(pos, "streets:beacon_hybrid_flashyellow") elseif name:find("beacon") then - streets.tlSwitch(pos,"streets:beacon_flashyellow") + streets.tlSwitch(pos, "streets:beacon_flashyellow") else - streets.tlSwitch(pos,"streets:trafficlight_top_warn") + streets.tlSwitch(pos, "streets:trafficlight_top_warn") end elseif msg == "YELLOW" then if name:find("pedlight") then - streets.tlSwitch(pos,"streets:pedlight_top_flashingdontwalk") + streets.tlSwitch(pos, "streets:pedlight_top_flashingdontwalk") elseif name:find("extender_left") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_left_yellow") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_left_yellow") elseif name:find("extender_right") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_right_yellow") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_right_yellow") elseif name:find("left") then - streets.tlSwitch(pos,"streets:trafficlight_top_left_yellow") + streets.tlSwitch(pos, "streets:trafficlight_top_left_yellow") elseif name:find("right") then - streets.tlSwitch(pos,"streets:trafficlight_top_right_yellow") + streets.tlSwitch(pos, "streets:trafficlight_top_right_yellow") elseif name:find("beacon_hybrid") then - streets.tlSwitch(pos,"streets:beacon_hybrid_yellow") + streets.tlSwitch(pos, "streets:beacon_hybrid_yellow") elseif name:find("beacon") then --Not Supported else - streets.tlSwitch(pos,"streets:trafficlight_top_yellow") + streets.tlSwitch(pos, "streets:trafficlight_top_yellow") end elseif msg == "FLASHRED" then if name:find("pedlight") then - streets.tlSwitch(pos,"streets:pedlight_top_flashingdontwalk") + streets.tlSwitch(pos, "streets:pedlight_top_flashingdontwalk") elseif name:find("extender_left") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_left_off") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_left_off") elseif name:find("extender_right") then - streets.tlSwitch(pos,"streets:trafficlight_top_extender_right_off") + streets.tlSwitch(pos, "streets:trafficlight_top_extender_right_off") elseif name:find("left") then - streets.tlSwitch(pos,"streets:trafficlight_top_left_flashred") + streets.tlSwitch(pos, "streets:trafficlight_top_left_flashred") elseif name:find("right") then - streets.tlSwitch(pos,"streets:trafficlight_top_right_flashred") + streets.tlSwitch(pos, "streets:trafficlight_top_right_flashred") elseif name:find("beacon_hybrid") then - streets.tlSwitch(pos,"streets:beacon_hybrid_flashred") + streets.tlSwitch(pos, "streets:beacon_hybrid_flashred") elseif name:find("beacon") then - streets.tlSwitch(pos,"streets:beacon_flashred") + streets.tlSwitch(pos, "streets:beacon_flashred") else - streets.tlSwitch(pos,"streets:trafficlight_top_flashred") + streets.tlSwitch(pos, "streets:trafficlight_top_flashred") end end end -minetest.register_node(":streets:digiline_distributor",{ +minetest.register_node(":streets:digiline_distributor", { description = "Digiline distributor", - tiles = {"streets_lampcontroller_top.png","streets_lampcontroller_bottom.png","streets_lampcontroller_sides.png"}, - groups = {cracky = 1}, + tiles = { "streets_lampcontroller_top.png", "streets_lampcontroller_bottom.png", "streets_lampcontroller_sides.png" }, + groups = { cracky = 1 }, drawtype = "nodebox", paramtype = "light", node_box = { type = "fixed", fixed = { - {-0.5,-0.5,-0.5,0.5,0.5,0.5}, - {-0.05,0.5,-0.05,0.05,1.6,0.05} + { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }, + { -0.05, 0.5, -0.05, 0.05, 1.6, 0.05 } } }, digiline = { wire = { rules = { - {x= 0, y= 0, z=-1}, - {x= 0, y= 0, z= 1}, - {x= 1, y= 0, z= 0}, - {x=-1, y= 0, z= 0}, - {x= 0, y= 2, z=0} + { x = 0, y = 0, z = -1 }, + { x = 0, y = 0, z = 1 }, + { x = 1, y = 0, z = 0 }, + { x = -1, y = 0, z = 0 }, + { x = 0, y = 2, z = 0 } } } } }) -minetest.register_node(":streets:beacon_hybrid_off",{ +minetest.register_node(":streets:beacon_hybrid_off", { description = "Hybrid Beacon", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2}, + groups = { cracky = 1, level = 2 }, inventory_image = "streets_hybrid_beacon_inv.png", light_source = 11, sunlight_propagates = true, @@ -289,10 +289,10 @@ minetest.register_node(":streets:beacon_hybrid_off",{ type = "fixed", fixed = streets.hbBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_hb_off.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_hb_off.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -305,7 +305,7 @@ minetest.register_node(":streets:beacon_hybrid_off",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -316,22 +316,22 @@ minetest.register_node(":streets:beacon_hybrid_off",{ end, }) -minetest.register_node(":streets:beacon_hybrid_yellow",{ +minetest.register_node(":streets:beacon_hybrid_yellow", { drop = "streets:beacon_hybrid_off", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.hbBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_hb_yellow.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_hb_yellow.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -344,7 +344,7 @@ minetest.register_node(":streets:beacon_hybrid_yellow",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -355,22 +355,22 @@ minetest.register_node(":streets:beacon_hybrid_yellow",{ end, }) -minetest.register_node(":streets:beacon_hybrid_red",{ +minetest.register_node(":streets:beacon_hybrid_red", { drop = "streets:beacon_hybrid_off", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.hbBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_hb_red.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_hb_red.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -383,7 +383,7 @@ minetest.register_node(":streets:beacon_hybrid_red",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -394,25 +394,27 @@ minetest.register_node(":streets:beacon_hybrid_red",{ end, }) -minetest.register_node(":streets:beacon_hybrid_flashyellow",{ +minetest.register_node(":streets:beacon_hybrid_flashyellow", { drop = "streets:beacon_hybrid_off", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.hbBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_hb_flashyellow.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_hb_flashyellow.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -425,7 +427,7 @@ minetest.register_node(":streets:beacon_hybrid_flashyellow",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -436,25 +438,27 @@ minetest.register_node(":streets:beacon_hybrid_flashyellow",{ end, }) -minetest.register_node(":streets:beacon_hybrid_flashred",{ +minetest.register_node(":streets:beacon_hybrid_flashred", { drop = "streets:beacon_hybrid_off", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.hbBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_hb_flashred.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_hb_flashred.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -467,7 +471,7 @@ minetest.register_node(":streets:beacon_hybrid_flashred",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -478,12 +482,12 @@ minetest.register_node(":streets:beacon_hybrid_flashred",{ end, }) -minetest.register_node(":streets:beacon_off",{ +minetest.register_node(":streets:beacon_off", { description = "Beacon", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2}, + groups = { cracky = 1, level = 2 }, inventory_image = "streets_beacon_inv.png", light_source = 11, sunlight_propagates = true, @@ -491,10 +495,10 @@ minetest.register_node(":streets:beacon_off",{ type = "fixed", fixed = streets.bBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_off.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_off.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -507,7 +511,7 @@ minetest.register_node(":streets:beacon_off",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -518,25 +522,27 @@ minetest.register_node(":streets:beacon_off",{ end, }) -minetest.register_node(":streets:beacon_flashred",{ +minetest.register_node(":streets:beacon_flashred", { drop = "streets:beacon_off", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.bBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_b_flashred.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_b_flashred.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -549,7 +555,7 @@ minetest.register_node(":streets:beacon_flashred",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -560,25 +566,27 @@ minetest.register_node(":streets:beacon_flashred",{ end, }) -minetest.register_node(":streets:beacon_flashyellow",{ +minetest.register_node(":streets:beacon_flashyellow", { drop = "streets:beacon_off", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.bBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_tl_warn.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_tl_warn.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -591,7 +599,7 @@ minetest.register_node(":streets:beacon_flashyellow",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -602,12 +610,12 @@ minetest.register_node(":streets:beacon_flashyellow",{ end, }) -minetest.register_node(":streets:trafficlight_top_extender_left_off",{ +minetest.register_node(":streets:trafficlight_top_extender_left_off", { description = "Traffic Light Left-Turn Module", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2}, + groups = { cracky = 1, level = 2 }, inventory_image = "streets_trafficlight_inv_extender_left.png", light_source = 11, sunlight_propagates = true, @@ -615,10 +623,10 @@ minetest.register_node(":streets:trafficlight_top_extender_left_off",{ type = "fixed", fixed = streets.tleBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_left_off.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_left_off.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -631,7 +639,7 @@ minetest.register_node(":streets:trafficlight_top_extender_left_off",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -642,23 +650,23 @@ minetest.register_node(":streets:trafficlight_top_extender_left_off",{ end, }) -minetest.register_node(":streets:trafficlight_top_extender_left_yellow",{ +minetest.register_node(":streets:trafficlight_top_extender_left_yellow", { drop = "streets:trafficlight_top_extender_left_off", description = "Traffic Light Left-Turn Module", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.tleBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tle_left_yellow.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tle_left_yellow.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -671,7 +679,7 @@ minetest.register_node(":streets:trafficlight_top_extender_left_yellow",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -682,23 +690,23 @@ minetest.register_node(":streets:trafficlight_top_extender_left_yellow",{ end, }) -minetest.register_node(":streets:trafficlight_top_extender_left_green",{ +minetest.register_node(":streets:trafficlight_top_extender_left_green", { drop = "streets:trafficlight_top_extender_left_off", description = "Traffic Light Left-Turn Module", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.tleBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tle_left_green.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tle_left_green.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -711,7 +719,7 @@ minetest.register_node(":streets:trafficlight_top_extender_left_green",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -722,26 +730,28 @@ minetest.register_node(":streets:trafficlight_top_extender_left_green",{ end, }) -minetest.register_node(":streets:trafficlight_top_extender_left_flashgreen",{ +minetest.register_node(":streets:trafficlight_top_extender_left_flashgreen", { drop = "streets:trafficlight_top_extender_left_off", description = "Traffic Light Left-Turn Module", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.tleBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_tle_left_flashgreen.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_tle_left_flashgreen.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -754,7 +764,7 @@ minetest.register_node(":streets:trafficlight_top_extender_left_flashgreen",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -765,12 +775,12 @@ minetest.register_node(":streets:trafficlight_top_extender_left_flashgreen",{ end, }) -minetest.register_node(":streets:trafficlight_top_extender_right_off",{ +minetest.register_node(":streets:trafficlight_top_extender_right_off", { description = "Traffic Light Right-Turn Module", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2}, + groups = { cracky = 1, level = 2 }, inventory_image = "streets_trafficlight_inv_extender_right.png", light_source = 11, sunlight_propagates = true, @@ -778,10 +788,10 @@ minetest.register_node(":streets:trafficlight_top_extender_right_off",{ type = "fixed", fixed = streets.tleBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_right_off.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_right_off.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -794,7 +804,7 @@ minetest.register_node(":streets:trafficlight_top_extender_right_off",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -805,23 +815,23 @@ minetest.register_node(":streets:trafficlight_top_extender_right_off",{ end, }) -minetest.register_node(":streets:trafficlight_top_extender_right_yellow",{ +minetest.register_node(":streets:trafficlight_top_extender_right_yellow", { drop = "streets:trafficlight_top_extender_right_off", description = "Traffic Light Right-Turn Module", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.tleBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tle_right_yellow.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tle_right_yellow.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -834,7 +844,7 @@ minetest.register_node(":streets:trafficlight_top_extender_right_yellow",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -845,23 +855,23 @@ minetest.register_node(":streets:trafficlight_top_extender_right_yellow",{ end, }) -minetest.register_node(":streets:trafficlight_top_extender_right_green",{ +minetest.register_node(":streets:trafficlight_top_extender_right_green", { drop = "streets:trafficlight_top_extender_right_off", description = "Traffic Light Right-Turn Module", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.tleBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tle_right_green.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tle_right_green.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -874,7 +884,7 @@ minetest.register_node(":streets:trafficlight_top_extender_right_green",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -885,26 +895,28 @@ minetest.register_node(":streets:trafficlight_top_extender_right_green",{ end, }) -minetest.register_node(":streets:trafficlight_top_extender_right_flashgreen",{ +minetest.register_node(":streets:trafficlight_top_extender_right_flashgreen", { drop = "streets:trafficlight_top_extender_right_off", description = "Traffic Light Right-Turn Module", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2, not_in_creative_inventory = 1}, + groups = { cracky = 1, level = 2, not_in_creative_inventory = 1 }, light_source = 11, sunlight_propagates = true, node_box = { type = "fixed", fixed = streets.tleBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_tle_right_flashgreen.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_tle_right_flashgreen.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -917,7 +929,7 @@ minetest.register_node(":streets:trafficlight_top_extender_right_flashgreen",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -928,12 +940,12 @@ minetest.register_node(":streets:trafficlight_top_extender_right_flashgreen",{ end, }) -minetest.register_node(":streets:pedlight_top_off",{ +minetest.register_node(":streets:pedlight_top_off", { description = "Pedestrian Light", - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2}, + groups = { cracky = 1, level = 2 }, inventory_image = "streets_pedlight_inv.png", light_source = 11, sunlight_propagates = true, @@ -941,10 +953,10 @@ minetest.register_node(":streets:pedlight_top_off",{ type = "fixed", fixed = streets.plBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_pl_off.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_pl_off.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -957,7 +969,7 @@ minetest.register_node(":streets:pedlight_top_off",{ end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -968,14 +980,14 @@ minetest.register_node(":streets:pedlight_top_off",{ end, }) -minetest.register_node(":streets:pedlight_top_dontwalk",{ +minetest.register_node(":streets:pedlight_top_dontwalk", { drop = "streets:pedlight_top_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_pl_dontwalk.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_pl_dontwalk.png" }, node_box = { type = "fixed", fixed = streets.plBox @@ -983,7 +995,7 @@ minetest.register_node(":streets:pedlight_top_dontwalk",{ light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -992,14 +1004,14 @@ minetest.register_node(":streets:pedlight_top_dontwalk",{ }, }) -minetest.register_node(":streets:pedlight_top_walk",{ +minetest.register_node(":streets:pedlight_top_walk", { drop = "streets:pedlight_top_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_pl_walk.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_pl_walk.png" }, node_box = { type = "fixed", fixed = streets.plBox @@ -1007,7 +1019,7 @@ minetest.register_node(":streets:pedlight_top_walk",{ light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1016,17 +1028,19 @@ minetest.register_node(":streets:pedlight_top_walk",{ }, }) -minetest.register_node(":streets:pedlight_top_flashingdontwalk",{ +minetest.register_node(":streets:pedlight_top_flashingdontwalk", { drop = "streets:pedlight_top_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_pl_flashingdontwalk.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_pl_flashingdontwalk.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, node_box = { type = "fixed", fixed = streets.plBox @@ -1034,7 +1048,7 @@ minetest.register_node(":streets:pedlight_top_flashingdontwalk",{ light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1043,17 +1057,19 @@ minetest.register_node(":streets:pedlight_top_flashingdontwalk",{ }, }) -minetest.register_node(":streets:pedlight_top_flashingwalk",{ +minetest.register_node(":streets:pedlight_top_flashingwalk", { drop = "streets:pedlight_top_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_pl_flashingwalk.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_pl_flashingwalk.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, node_box = { type = "fixed", fixed = streets.plBox @@ -1061,7 +1077,7 @@ minetest.register_node(":streets:pedlight_top_flashingwalk",{ light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1071,13 +1087,13 @@ minetest.register_node(":streets:pedlight_top_flashingwalk",{ }) -for _,i in pairs({"","_left","_right"}) do - minetest.register_node(":streets:trafficlight_top"..i.."_off",{ +for _, i in pairs({ "", "_left", "_right" }) do + minetest.register_node(":streets:trafficlight_top" .. i .. "_off", { description = (i == "" and "Traffic Light") or (i == "_left" and "Traffic Light (Left Turn)") or (i == "_right" and "Traffic Light (Right Turn)"), - drawtype="nodebox", + drawtype = "nodebox", paramtype = "light", paramtype2 = "facedir", - groups = {cracky = 1, level = 2}, + groups = { cracky = 1, level = 2 }, inventory_image = ((i == "") and "streets_trafficlight_inv_straight.png") or ((i == "_left") and "streets_trafficlight_inv_left.png") or ((i == "_right") and "streets_trafficlight_inv_right.png"), light_source = 11, sunlight_propagates = true, @@ -1085,10 +1101,10 @@ for _,i in pairs({"","_left","_right"}) do type = "fixed", fixed = streets.tlBox }, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl"..i.."_off.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl" .. i .. "_off.png" }, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1101,7 +1117,7 @@ for _,i in pairs({"","_left","_right"}) do end, on_receive_fields = function(pos, formname, fields, sender) local name = sender:get_player_name() - if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, {protection_bypass=true}) then + if minetest.is_protected(pos, name) and not minetest.check_player_privs(name, { protection_bypass = true }) then minetest.record_protection_violation(pos, name) return end @@ -1112,14 +1128,14 @@ for _,i in pairs({"","_left","_right"}) do end, }) - minetest.register_node(":streets:trafficlight_top"..i.."_red",{ - drop = "streets:trafficlight_top"..i.."_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + minetest.register_node(":streets:trafficlight_top" .. i .. "_red", { + drop = "streets:trafficlight_top" .. i .. "_off", + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl"..i.."_red.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl" .. i .. "_red.png" }, node_box = { type = "fixed", fixed = streets.tlBox @@ -1127,7 +1143,7 @@ for _,i in pairs({"","_left","_right"}) do light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1136,14 +1152,14 @@ for _,i in pairs({"","_left","_right"}) do }, }) - minetest.register_node(":streets:trafficlight_top"..i.."_yellow",{ - drop = "streets:trafficlight_top"..i.."_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + minetest.register_node(":streets:trafficlight_top" .. i .. "_yellow", { + drop = "streets:trafficlight_top" .. i .. "_off", + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl"..i.."_yellow.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl" .. i .. "_yellow.png" }, node_box = { type = "fixed", fixed = streets.tlBox @@ -1151,7 +1167,7 @@ for _,i in pairs({"","_left","_right"}) do light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1160,14 +1176,14 @@ for _,i in pairs({"","_left","_right"}) do }, }) - minetest.register_node(":streets:trafficlight_top"..i.."_redyellow",{ - drop = "streets:trafficlight_top"..i.."_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + minetest.register_node(":streets:trafficlight_top" .. i .. "_redyellow", { + drop = "streets:trafficlight_top" .. i .. "_off", + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl"..i.."_redyellow.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl" .. i .. "_redyellow.png" }, node_box = { type = "fixed", fixed = streets.tlBox @@ -1175,7 +1191,7 @@ for _,i in pairs({"","_left","_right"}) do light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1184,14 +1200,14 @@ for _,i in pairs({"","_left","_right"}) do }, }) - minetest.register_node(":streets:trafficlight_top"..i.."_green",{ - drop = "streets:trafficlight_top"..i.."_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + minetest.register_node(":streets:trafficlight_top" .. i .. "_green", { + drop = "streets:trafficlight_top" .. i .. "_off", + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl"..i.."_green.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl" .. i .. "_green.png" }, node_box = { type = "fixed", fixed = streets.tlBox @@ -1199,7 +1215,7 @@ for _,i in pairs({"","_left","_right"}) do light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1208,17 +1224,19 @@ for _,i in pairs({"","_left","_right"}) do }, }) - minetest.register_node(":streets:trafficlight_top"..i.."_warn",{ - drop = "streets:trafficlight_top"..i.."_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + minetest.register_node(":streets:trafficlight_top" .. i .. "_warn", { + drop = "streets:trafficlight_top" .. i .. "_off", + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_tl"..i.."_warn.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_tl" .. i .. "_warn.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, node_box = { type = "fixed", fixed = streets.tlBox @@ -1226,7 +1244,7 @@ for _,i in pairs({"","_left","_right"}) do light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1235,17 +1253,19 @@ for _,i in pairs({"","_left","_right"}) do }, }) - minetest.register_node(":streets:trafficlight_top"..i.."_flashred",{ - drop = "streets:trafficlight_top"..i.."_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + minetest.register_node(":streets:trafficlight_top" .. i .. "_flashred", { + drop = "streets:trafficlight_top" .. i .. "_off", + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_tl"..i.."_flashred.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_tl" .. i .. "_flashred.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, node_box = { type = "fixed", fixed = streets.tlBox @@ -1253,7 +1273,7 @@ for _,i in pairs({"","_left","_right"}) do light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1262,17 +1282,19 @@ for _,i in pairs({"","_left","_right"}) do }, }) - minetest.register_node(":streets:trafficlight_top"..i.."_flashgreen",{ - drop = "streets:trafficlight_top"..i.."_off", - groups = {cracky = 1, not_in_creative_inventory = 1}, + minetest.register_node(":streets:trafficlight_top" .. i .. "_flashgreen", { + drop = "streets:trafficlight_top" .. i .. "_off", + groups = { cracky = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png",{ - name="streets_tl"..i.."_flashgreen.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2}, - }}, + tiles = { + "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_bg.png", { + name = "streets_tl" .. i .. "_flashgreen.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 }, + } + }, node_box = { type = "fixed", fixed = streets.tlBox @@ -1280,7 +1302,7 @@ for _,i in pairs({"","_left","_right"}) do light_source = 6, digiline = { receptor = {}, - wire = {rules=streets.tlDigilineRules}, + wire = { rules = streets.tlDigilineRules }, effector = { action = function(pos, node, channel, msg) streets.on_digiline_receive(pos, node, channel, msg) @@ -1293,109 +1315,109 @@ end minetest.register_craft({ output = "streets:trafficlight_top_off", recipe = { - {"default:steel_ingot", "dye:red", "default:steel_ingot"}, - {"default:steel_ingot", "dye:yellow", "default:steel_ingot"}, - {"default:steel_ingot", "dye:green", "default:steel_ingot"} + { "default:steel_ingot", "dye:red", "default:steel_ingot" }, + { "default:steel_ingot", "dye:yellow", "default:steel_ingot" }, + { "default:steel_ingot", "dye:green", "default:steel_ingot" } } }) minetest.register_craft({ output = "streets:trafficlight_top_left_off", recipe = { - {"dye:red", "default:steel_ingot", "default:steel_ingot"}, - {"dye:yellow", "default:steel_ingot", "default:steel_ingot"}, - {"dye:green", "default:steel_ingot", "default:steel_ingot"} + { "dye:red", "default:steel_ingot", "default:steel_ingot" }, + { "dye:yellow", "default:steel_ingot", "default:steel_ingot" }, + { "dye:green", "default:steel_ingot", "default:steel_ingot" } } }) minetest.register_craft({ output = "streets:trafficlight_top_right_off", recipe = { - {"default:steel_ingot", "default:steel_ingot", "dye:red"}, - {"default:steel_ingot", "default:steel_ingot", "dye:yellow"}, - {"default:steel_ingot", "default:steel_ingot", "dye:green"} + { "default:steel_ingot", "default:steel_ingot", "dye:red" }, + { "default:steel_ingot", "default:steel_ingot", "dye:yellow" }, + { "default:steel_ingot", "default:steel_ingot", "dye:green" } } }) minetest.register_craft({ output = "streets:pedlight_top_off", recipe = { - {"default:steel_ingot", "dye:orange", "default:steel_ingot"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "dye:white", "default:steel_ingot"} + { "default:steel_ingot", "dye:orange", "default:steel_ingot" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, + { "default:steel_ingot", "dye:white", "default:steel_ingot" } } }) minetest.register_craft({ output = "streets:trafficlight_top_extender_left_off", recipe = { - {"dye:yellow", "default:steel_ingot", "default:steel_ingot"}, - {"dye:green", "default:steel_ingot", "default:steel_ingot"} + { "dye:yellow", "default:steel_ingot", "default:steel_ingot" }, + { "dye:green", "default:steel_ingot", "default:steel_ingot" } } }) minetest.register_craft({ output = "streets:trafficlight_top_extender_right_off", recipe = { - {"default:steel_ingot", "default:steel_ingot", "dye:yellow"}, - {"default:steel_ingot", "default:steel_ingot", "dye:green"} + { "default:steel_ingot", "default:steel_ingot", "dye:yellow" }, + { "default:steel_ingot", "default:steel_ingot", "dye:green" } } }) minetest.register_craft({ output = "streets:beacon_off", recipe = { - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "dye:red", "default:steel_ingot"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"} + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" }, + { "default:steel_ingot", "dye:red", "default:steel_ingot" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } } }) minetest.register_craft({ output = "streets:beacon_hybrid_off", recipe = { - {"dye:red", "default:steel_ingot", "dye:red"}, - {"default:steel_ingot", "dye:yellow", "default:steel_ingot"}, - {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"} + { "dye:red", "default:steel_ingot", "dye:red" }, + { "default:steel_ingot", "dye:yellow", "default:steel_ingot" }, + { "default:steel_ingot", "default:steel_ingot", "default:steel_ingot" } } }) minetest.register_craft({ output = "streets:digiline_distributor", recipe = { - {"", "digilines:wire_std_00000000", ""}, - {"digilines:wire_std_00000000", "mesecons_luacontroller:luacontroller0000", "digilines:wire_std_00000000"}, - {"", "digilines:wire_std_00000000", ""} + { "", "digilines:wire_std_00000000", "" }, + { "digilines:wire_std_00000000", "mesecons_luacontroller:luacontroller0000", "digilines:wire_std_00000000" }, + { "", "digilines:wire_std_00000000", "" } } }) -streets.portable_tl_on_receive_fields = function(pos,formname,fields,sender) +streets.portable_tl_on_receive_fields = function(pos, formname, fields, sender) local meta = minetest.get_meta(pos) if fields.normal then - meta:set_string("mode","Normal") + meta:set_string("mode", "Normal") elseif fields.yyflash then - meta:set_string("mode","Y-Y Flash") + meta:set_string("mode", "Y-Y Flash") elseif fields.yrflash then - meta:set_string("mode","Y-R Flash") + meta:set_string("mode", "Y-R Flash") elseif fields.rrflash then - meta:set_string("mode","R-R Flash") + meta:set_string("mode", "R-R Flash") elseif fields.save then if tonumber(fields.yellow) then - meta:set_int("yellow",fields.yellow) + meta:set_int("yellow", fields.yellow) end if tonumber(fields.allred) then - meta:set_int("allred",fields.allred) + meta:set_int("allred", fields.allred) end if tonumber(fields.maingreen) then - meta:set_int("maingreen",fields.maingreen) + meta:set_int("maingreen", fields.maingreen) end if tonumber(fields.sidegreen) then - meta:set_int("sidegreen",fields.sidegreen) + meta:set_int("sidegreen", fields.sidegreen) end end end -streets.portable_tl_tick = function(pos,meta) +streets.portable_tl_tick = function(pos, meta) local yellow = meta:get_int("yellow") local allred = meta:get_int("allred") local sidegreen = meta:get_int("sidegreen") @@ -1441,12 +1463,12 @@ streets.portable_tl_tick = function(pos,meta) phaselen = maingreen end end - time = string.format("%s of %s Seconds Remaining",phaselen-tick,phaselen) + time = string.format("%s of %s Seconds Remaining", phaselen - tick, phaselen) end - meta:set_int("tick",tick) + meta:set_int("tick", tick) local need_swap = phase ~= meta:get_string(phase) local swap_to = "streets:trafficlight_portable_rrflash" - meta:set_string("phase",phase) + meta:set_string("phase", phase) if mode == "R-R Flash" then need_swap = true @@ -1474,228 +1496,228 @@ streets.portable_tl_tick = function(pos,meta) end end local node = minetest.get_node(pos) - minetest.swap_node(pos,{name = swap_to,param2 = node.param2}) + minetest.swap_node(pos, { name = swap_to, param2 = node.param2 }) end - local formspec = "size[8,4]".. - "label[0,0;Mode: "..mode.."]".. - "label[0,0.5;"..(mode == "Normal" and "Phase: "..phase or "").."]".. - "label[0,1;"..time.."]".. - "label[0,2;Select Mode:]".. - "button[0,2.5;2,1;normal;Normal]".. - "button[2,2.5;2,1;rrflash;R-R Flash]".. - "button[0,3.5;2,1;yyflash;Y-Y Flash]".. - "button[2,3.5;2,1;yrflash;Y-R Flash]".. - "label[5.5,0;Time Adjustments:]" + local formspec = "size[8,4]" .. + "label[0,0;Mode: " .. mode .. "]" .. + "label[0,0.5;" .. (mode == "Normal" and "Phase: " .. phase or "") .. "]" .. + "label[0,1;" .. time .. "]" .. + "label[0,2;Select Mode:]" .. + "button[0,2.5;2,1;normal;Normal]" .. + "button[2,2.5;2,1;rrflash;R-R Flash]" .. + "button[0,3.5;2,1;yyflash;Y-Y Flash]" .. + "button[2,3.5;2,1;yrflash;Y-R Flash]" .. + "label[5.5,0;Time Adjustments:]" if mode == "Normal" then - formspec = formspec.."label[5.5,1;Cannot edit times\nwhile running.\nSelect a flash mode first.]" + formspec = formspec .. "label[5.5,1;Cannot edit times\nwhile running.\nSelect a flash mode first.]" else - formspec = formspec.. "field[4.5,1;2,1;yellow;Yellow;${yellow}]".. - "field[6.5,1;2,1;allred;All Red;${allred}]".. - "field[4.5,2;2,1;maingreen;Main Green;${maingreen}]".. - "field[6.5,2;2,1;sidegreen;Side Green;${sidegreen}]".. - "button[5.25,3;2,1;save;Save]" + formspec = formspec .. "field[4.5,1;2,1;yellow;Yellow;${yellow}]" .. + "field[6.5,1;2,1;allred;All Red;${allred}]" .. + "field[4.5,2;2,1;maingreen;Main Green;${maingreen}]" .. + "field[6.5,2;2,1;sidegreen;Side Green;${sidegreen}]" .. + "button[5.25,3;2,1;save;Save]" end - meta:set_string("formspec",formspec) + meta:set_string("formspec", formspec) end -minetest.register_node(":streets:trafficlight_portable_off",{ +minetest.register_node(":streets:trafficlight_portable_off", { description = "Portable Traffic Light", inventory_image = "streets_trafficlight_inv_portable.png", - groups = {cracky = 1,portable_tl = 1}, + groups = { cracky = 1, portable_tl = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", on_receive_fields = streets.portable_tl_on_receive_fields, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_off.png","streets_tl_off.png","streets_tl_off.png","streets_tl_off.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_off.png", "streets_tl_off.png", "streets_tl_off.png", "streets_tl_off.png" }, node_box = { type = "fixed", fixed = { - {-0.1875,-0.5,-0.1875,0.1875,0.5,0.1875}, --Box + { -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 }, --Box - --Needs visors at some point. Converting to a mesh would be best. - } + --Needs visors at some point. Converting to a mesh would be best. + } }, on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_int("yellow",3) - meta:set_int("allred",2) - meta:set_int("sidegreen",5) - meta:set_int("maingreen",10) - meta:set_int("tick",0) - meta:set_string("mode","R-R Flash") - meta:set_string("phase","All Red A") + meta:set_int("yellow", 3) + meta:set_int("allred", 2) + meta:set_int("sidegreen", 5) + meta:set_int("maingreen", 10) + meta:set_int("tick", 0) + meta:set_string("mode", "R-R Flash") + meta:set_string("phase", "All Red A") end, light_source = 6, }) -minetest.register_node(":streets:trafficlight_portable_allred",{ +minetest.register_node(":streets:trafficlight_portable_allred", { drop = "streets:trafficlight_portable_off", - groups = {cracky = 1,portable_tl = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, portable_tl = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", on_receive_fields = streets.portable_tl_on_receive_fields, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_red.png","streets_tl_red.png","streets_tl_red.png","streets_tl_red.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_red.png", "streets_tl_red.png", "streets_tl_red.png", "streets_tl_red.png" }, node_box = { type = "fixed", fixed = { - {-0.1875,-0.5,-0.1875,0.1875,0.5,0.1875}, --Box + { -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 }, --Box - --Needs visors at some point. Converting to a mesh would be best. - } + --Needs visors at some point. Converting to a mesh would be best. + } }, light_source = 6, }) -minetest.register_node(":streets:trafficlight_portable_yellowa",{ +minetest.register_node(":streets:trafficlight_portable_yellowa", { drop = "streets:trafficlight_portable_off", - groups = {cracky = 1,portable_tl = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, portable_tl = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", on_receive_fields = streets.portable_tl_on_receive_fields, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_red.png","streets_tl_red.png","streets_tl_yellow.png","streets_tl_yellow.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_red.png", "streets_tl_red.png", "streets_tl_yellow.png", "streets_tl_yellow.png" }, node_box = { type = "fixed", fixed = { - {-0.1875,-0.5,-0.1875,0.1875,0.5,0.1875}, --Box + { -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 }, --Box - --Needs visors at some point. Converting to a mesh would be best. - } + --Needs visors at some point. Converting to a mesh would be best. + } }, light_source = 6, }) -minetest.register_node(":streets:trafficlight_portable_yellowb",{ +minetest.register_node(":streets:trafficlight_portable_yellowb", { drop = "streets:trafficlight_portable_off", - groups = {cracky = 1,portable_tl = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, portable_tl = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", on_receive_fields = streets.portable_tl_on_receive_fields, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_yellow.png","streets_tl_yellow.png","streets_tl_red.png","streets_tl_red.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_yellow.png", "streets_tl_yellow.png", "streets_tl_red.png", "streets_tl_red.png" }, node_box = { type = "fixed", fixed = { - {-0.1875,-0.5,-0.1875,0.1875,0.5,0.1875}, --Box + { -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 }, --Box - --Needs visors at some point. Converting to a mesh would be best. - } + --Needs visors at some point. Converting to a mesh would be best. + } }, light_source = 6, }) -minetest.register_node(":streets:trafficlight_portable_maingreen",{ +minetest.register_node(":streets:trafficlight_portable_maingreen", { drop = "streets:trafficlight_portable_off", - groups = {cracky = 1,portable_tl = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, portable_tl = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", on_receive_fields = streets.portable_tl_on_receive_fields, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_red.png","streets_tl_red.png","streets_tl_green.png","streets_tl_green.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_red.png", "streets_tl_red.png", "streets_tl_green.png", "streets_tl_green.png" }, node_box = { type = "fixed", fixed = { - {-0.1875,-0.5,-0.1875,0.1875,0.5,0.1875}, --Box + { -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 }, --Box - --Needs visors at some point. Converting to a mesh would be best. - } + --Needs visors at some point. Converting to a mesh would be best. + } }, light_source = 6, }) -minetest.register_node(":streets:trafficlight_portable_sidegreen",{ +minetest.register_node(":streets:trafficlight_portable_sidegreen", { drop = "streets:trafficlight_portable_off", - groups = {cracky = 1,portable_tl = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, portable_tl = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", on_receive_fields = streets.portable_tl_on_receive_fields, - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_green.png","streets_tl_green.png","streets_tl_red.png","streets_tl_red.png"}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", "streets_tl_green.png", "streets_tl_green.png", "streets_tl_red.png", "streets_tl_red.png" }, node_box = { type = "fixed", fixed = { - {-0.1875,-0.5,-0.1875,0.1875,0.5,0.1875}, --Box + { -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 }, --Box - --Needs visors at some point. Converting to a mesh would be best. - } + --Needs visors at some point. Converting to a mesh would be best. + } }, light_source = 6, }) streets.portable_tl_tile_flashred = { - name="streets_tl_flashred.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2} - } + name = "streets_tl_flashred.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 } +} streets.portable_tl_tile_flashyellow = { - name="streets_tl_warn.png", - animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=1.2} - } + name = "streets_tl_warn.png", + animation = { type = "vertical_frames", aspect_w = 64, aspect_h = 64, length = 1.2 } +} -minetest.register_node(":streets:trafficlight_portable_rrflash",{ +minetest.register_node(":streets:trafficlight_portable_rrflash", { drop = "streets:trafficlight_portable_off", - groups = {cracky = 1,portable_tl = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, portable_tl = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", on_receive_fields = streets.portable_tl_on_receive_fields, - tiles = {"streets_tl_bg.png","streets_tl_bg.png",streets.portable_tl_tile_flashred,streets.portable_tl_tile_flashred,streets.portable_tl_tile_flashred,streets.portable_tl_tile_flashred}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", streets.portable_tl_tile_flashred, streets.portable_tl_tile_flashred, streets.portable_tl_tile_flashred, streets.portable_tl_tile_flashred }, node_box = { type = "fixed", fixed = { - {-0.1875,-0.5,-0.1875,0.1875,0.5,0.1875}, --Box + { -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 }, --Box - --Needs visors at some point. Converting to a mesh would be best. - } + --Needs visors at some point. Converting to a mesh would be best. + } }, light_source = 6, }) -minetest.register_node(":streets:trafficlight_portable_yyflash",{ +minetest.register_node(":streets:trafficlight_portable_yyflash", { drop = "streets:trafficlight_portable_off", - groups = {cracky = 1,portable_tl = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, portable_tl = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", on_receive_fields = streets.portable_tl_on_receive_fields, - tiles = {"streets_tl_bg.png","streets_tl_bg.png",streets.portable_tl_tile_flashyellow,streets.portable_tl_tile_flashyellow,streets.portable_tl_tile_flashyellow,streets.portable_tl_tile_flashyellow}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", streets.portable_tl_tile_flashyellow, streets.portable_tl_tile_flashyellow, streets.portable_tl_tile_flashyellow, streets.portable_tl_tile_flashyellow }, node_box = { type = "fixed", fixed = { - {-0.1875,-0.5,-0.1875,0.1875,0.5,0.1875}, --Box + { -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 }, --Box - --Needs visors at some point. Converting to a mesh would be best. - } + --Needs visors at some point. Converting to a mesh would be best. + } }, light_source = 6, }) -minetest.register_node(":streets:trafficlight_portable_yrflash",{ +minetest.register_node(":streets:trafficlight_portable_yrflash", { drop = "streets:trafficlight_portable_off", - groups = {cracky = 1,portable_tl = 1,not_in_creative_inventory = 1}, + groups = { cracky = 1, portable_tl = 1, not_in_creative_inventory = 1 }, paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, drawtype = "nodebox", on_receive_fields = streets.portable_tl_on_receive_fields, - tiles = {"streets_tl_bg.png","streets_tl_bg.png",streets.portable_tl_tile_flashred,streets.portable_tl_tile_flashred,streets.portable_tl_tile_flashyellow,streets.portable_tl_tile_flashyellow}, + tiles = { "streets_tl_bg.png", "streets_tl_bg.png", streets.portable_tl_tile_flashred, streets.portable_tl_tile_flashred, streets.portable_tl_tile_flashyellow, streets.portable_tl_tile_flashyellow }, node_box = { type = "fixed", fixed = { - {-0.1875,-0.5,-0.1875,0.1875,0.5,0.1875}, --Box + { -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 }, --Box - --Needs visors at some point. Converting to a mesh would be best. - } + --Needs visors at some point. Converting to a mesh would be best. + } }, light_source = 6, }) @@ -1705,25 +1727,25 @@ minetest.register_abm({ interval = 1, chance = 1, action = function(pos) - streets.portable_tl_tick(pos,minetest.get_meta(pos)) + streets.portable_tl_tick(pos, minetest.get_meta(pos)) end, }) - + minetest.register_craft({ output = "streets:trafficlight_portable_off", type = "shapeless", - recipe = {"streets:trafficlight_top_off","mesecons_luacontroller:luacontroller0000"} + recipe = { "streets:trafficlight_top_off", "mesecons_luacontroller:luacontroller0000" } }) minetest.register_node("streets:pedbutton_left", { drawtype = "nodebox", tiles = { - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_pedbutton_us_back.png", - "streets_pedbutton_us_left.png" + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_pedbutton_us_back.png", + "streets_pedbutton_us_left.png" }, paramtype = "light", paramtype2 = "facedir", @@ -1732,7 +1754,7 @@ minetest.register_node("streets:pedbutton_left", { sunlight_propagates = true, selection_box = { type = "fixed", - fixed = { -0.5, -0.5, 0.65, 0.5, 0.5, 0.85 } + fixed = { -0.5, -0.5, 0.65, 0.5, 0.5, 0.85 } }, node_box = { type = "fixed", @@ -1745,21 +1767,21 @@ minetest.register_node("streets:pedbutton_left", { { receptor = {} }, - groups = {cracky = 1}, + groups = { cracky = 1 }, description = "Pedestrian Crossing Button Assembly - Left", on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_string("formspec","size[8,4;]field[1,1;6,2;channel;Channel;${channel}]field[1,2;6,2;msg;Message;${msg}]button_exit[2.25,3;3,1;submit;Save]") + meta:set_string("formspec", "size[8,4;]field[1,1;6,2;channel;Channel;${channel}]field[1,2;6,2;msg;Message;${msg}]button_exit[2.25,3;3,1;submit;Save]") end, on_receive_fields = function(pos, formname, fields, sender) local meta = minetest.get_meta(pos) if fields.channel and fields.msg and fields.channel ~= "" and fields.msg ~= "" then - meta:set_string("channel",fields.channel) - meta:set_string("msg",fields.msg) - meta:set_string("formspec","") - minetest.swap_node(pos, {name = "streets:pedbutton_left_off", param2=minetest.get_node(pos).param2}) + meta:set_string("channel", fields.channel) + meta:set_string("msg", fields.msg) + meta:set_string("formspec", "") + minetest.swap_node(pos, { name = "streets:pedbutton_left_off", param2 = minetest.get_node(pos).param2 }) else - minetest.chat_send_player(sender:get_player_name(),"Channel and message must both be set!") + minetest.chat_send_player(sender:get_player_name(), "Channel and message must both be set!") end end, }) @@ -1767,12 +1789,12 @@ minetest.register_node("streets:pedbutton_left", { minetest.register_node("streets:pedbutton_left_off", { drawtype = "nodebox", tiles = { - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_pedbutton_us_back.png", - "streets_pedbutton_us_left.png" + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_pedbutton_us_back.png", + "streets_pedbutton_us_left.png" }, paramtype = "light", paramtype2 = "facedir", @@ -1781,7 +1803,7 @@ minetest.register_node("streets:pedbutton_left_off", { sunlight_propagates = true, selection_box = { type = "fixed", - fixed = { -0.5, -0.5, 0.65, 0.5, 0.5, 0.85 } + fixed = { -0.5, -0.5, 0.65, 0.5, 0.5, 0.85 } }, node_box = { type = "fixed", @@ -1791,17 +1813,17 @@ minetest.register_node("streets:pedbutton_left_off", { { -0.06, -0.41, 0.7, 0.05, -0.32, 0.65 } } }, - digiline = + digiline = { receptor = {} }, - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, drop = "streets:pedbutton_left", - on_rightclick = function (pos) + on_rightclick = function(pos) local meta = minetest.get_meta(pos) digiline:receptor_send(pos, digiline.rules.default, meta:get_string("channel"), meta:get_string("msg")) end, - on_punch = function (pos) + on_punch = function(pos) local meta = minetest.get_meta(pos) digiline:receptor_send(pos, digiline.rules.default, meta:get_string("channel"), meta:get_string("msg")) end, @@ -1810,12 +1832,12 @@ minetest.register_node("streets:pedbutton_left_off", { minetest.register_node("streets:pedbutton_right", { drawtype = "nodebox", tiles = { - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_pedbutton_us_back.png", - "streets_pedbutton_us_right.png" + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_pedbutton_us_back.png", + "streets_pedbutton_us_right.png" }, paramtype = "light", paramtype2 = "facedir", @@ -1824,7 +1846,7 @@ minetest.register_node("streets:pedbutton_right", { sunlight_propagates = true, selection_box = { type = "fixed", - fixed = { -0.5, -0.5, 0.65, 0.5, 0.5, 0.85 } + fixed = { -0.5, -0.5, 0.65, 0.5, 0.5, 0.85 } }, node_box = { type = "fixed", @@ -1837,21 +1859,21 @@ minetest.register_node("streets:pedbutton_right", { { receptor = {} }, - groups = {cracky = 1}, + groups = { cracky = 1 }, description = "Pedestrian Crossing Button Assembly - Right", on_construct = function(pos) local meta = minetest.get_meta(pos) - meta:set_string("formspec","size[8,4;]field[1,1;6,2;channel;Channel;${channel}]field[1,2;6,2;msg;Message;${msg}]button_exit[2.25,3;3,1;submit;Save]") + meta:set_string("formspec", "size[8,4;]field[1,1;6,2;channel;Channel;${channel}]field[1,2;6,2;msg;Message;${msg}]button_exit[2.25,3;3,1;submit;Save]") end, on_receive_fields = function(pos, formname, fields, sender) local meta = minetest.get_meta(pos) if fields.channel and fields.msg and fields.channel ~= "" and fields.msg ~= "" then - meta:set_string("channel",fields.channel) - meta:set_string("msg",fields.msg) - meta:set_string("formspec","") - minetest.swap_node(pos, {name = "streets:pedbutton_right_off", param2=minetest.get_node(pos).param2}) + meta:set_string("channel", fields.channel) + meta:set_string("msg", fields.msg) + meta:set_string("formspec", "") + minetest.swap_node(pos, { name = "streets:pedbutton_right_off", param2 = minetest.get_node(pos).param2 }) else - minetest.chat_send_player(sender:get_player_name(),"Channel and message must both be set!") + minetest.chat_send_player(sender:get_player_name(), "Channel and message must both be set!") end end, }) @@ -1859,12 +1881,12 @@ minetest.register_node("streets:pedbutton_right", { minetest.register_node("streets:pedbutton_right_off", { drawtype = "nodebox", tiles = { - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_tl_bg.png", - "streets_pedbutton_us_back.png", - "streets_pedbutton_us_right.png" + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_tl_bg.png", + "streets_pedbutton_us_back.png", + "streets_pedbutton_us_right.png" }, paramtype = "light", paramtype2 = "facedir", @@ -1873,7 +1895,7 @@ minetest.register_node("streets:pedbutton_right_off", { sunlight_propagates = true, selection_box = { type = "fixed", - fixed = { -0.5, -0.5, 0.65, 0.5, 0.5, 0.85 } + fixed = { -0.5, -0.5, 0.65, 0.5, 0.5, 0.85 } }, node_box = { type = "fixed", @@ -1883,17 +1905,17 @@ minetest.register_node("streets:pedbutton_right_off", { { -0.06, -0.41, 0.7, 0.05, -0.32, 0.65 } } }, - digiline = + digiline = { receptor = {} }, - groups = {cracky = 1, not_in_creative_inventory = 1}, + groups = { cracky = 1, not_in_creative_inventory = 1 }, drop = "streets:pedbutton_right", - on_rightclick = function (pos) + on_rightclick = function(pos) local meta = minetest.get_meta(pos) digiline:receptor_send(pos, digiline.rules.default, meta:get_string("channel"), meta:get_string("msg")) end, - on_punch = function (pos) + on_punch = function(pos) local meta = minetest.get_meta(pos) digiline:receptor_send(pos, digiline.rules.default, meta:get_string("channel"), meta:get_string("msg")) end, @@ -1902,11 +1924,11 @@ minetest.register_node("streets:pedbutton_right_off", { minetest.register_craft({ output = "streets:pedbutton_left", type = "shapeless", - recipe = {"streets:sign_us_pushtocross_left","digilines:wire_std_00000000"} + recipe = { "streets:sign_us_pushtocross_left", "digilines:wire_std_00000000" } }) minetest.register_craft({ output = "streets:pedbutton_right", type = "shapeless", - recipe = {"streets:sign_us_pushtocross_right","digilines:wire_std_00000000"} + recipe = { "streets:sign_us_pushtocross_right", "digilines:wire_std_00000000" } }) diff --git a/todo.txt b/todo.txt index 76eb36b..441a701 100644 --- a/todo.txt +++ b/todo.txt @@ -8,9 +8,9 @@ == 1. General = ✓ create a new folder structure that is: easy to understand, easy to extend, easily configurable (important later on...) -- find suitable licenses for media/code: CC-BY-SA 3.0 seems to be fine for media, not sure which license I should choose for the code though... +✓ find suitable licenses for media/code: CC-BY-SA 3.0 seems to be fine for media, not sure which license I should choose for the code though... ✓ create new 16px textures; many people asked for it... -- use kaeza's intllib +? use kaeza's intllib - use Rubendwardy's achievements == 2. API == @@ -28,7 +28,7 @@ ✓ The following nodes are available in white and yellow ✓ Arrows: left, right, straight on, straight on + left, straight on + right, straight on + left + right, left + right ✓ Middle lines: solid, dashed, double solid, double dashed, double mixed -... Side lines: solid slim, solid thick, dashed slim, dashed thick, outer edge thick, outer edge thin, inner edge thick, inner edge thin +✓ Side lines: solid slim, solid thick, dashed slim, dashed thick, outer edge thick, outer edge thin, inner edge thick, inner edge thin ✓ Others: Parking, Forbidden area, crosswalk === 3.3 Roadworks === @@ -41,15 +41,15 @@ ✓ use walls API for concrete walls === 3.5 Passive road accessories === --? find a style that is not too country specific but still easy for everyone to understand +✓ find a style that is not too country specific but still easy for everyone to understand * Possibly include the old signs, but maybe with some country specific? I'd love to have at least some of the most common USA ones in there. (cheapie) * Let's forget to be un-country-specific. Let's include US and EU ones, that should satisfy many players. We can make the sign workshop use tabs to organise them into categories and a dropdown to select the set to be used. (wd97) -- Warning signs: "!", lava, water, construction area, curves, railroad crossings, crosswalks, "Baken" -... Traffic: "STOP", "Railroad", "Give way", "right of way", "Priority", "One way", "roundabout (a square of course)", "dead end", "Parking" +✓ Warning signs: "!", lava, water, construction area, curves, railroad crossings, crosswalks, "Baken" +✓ Traffic: "STOP", "Railroad", "Give way", "right of way", "Priority", "One way", "roundabout (a square of course)", "dead end", "Parking" - Writable using signs_lib (hopefully?): city entrance/exit, street name, guideposts * Especially in this category, the list of signs is subject to change. If something is not possible due to graphical or technical limitations, it won't get implemented. * Spontaneous ideas of mine are possible and very likely... -- Traffic barriers +✓ Traffic barriers ✓ delineators === 3.6 Active road accessories @@ -57,9 +57,9 @@ * = streets/laneuse ✓ Trafficlight (off, red, yellow, green) ✓? (ambiguous) Trafficlight (off, red, yellow) -- Compact and portable trafficlight (e.g. for roadworks) +✓ Compact and portable trafficlight (e.g. for roadworks) ✓ Blinking light (off, yellow) -- bollards +✓ bollards === 3.7 Railroad crossings === ✓ Controllable barriers (manual (punch) or mesecons)