diff options
25 files changed, 472 insertions, 262 deletions
diff --git a/asphaltstairs/function.lua b/asphaltstairs/function.lua deleted file mode 100644 index 9879d4c..0000000 --- a/asphaltstairs/function.lua +++ /dev/null @@ -1,56 +0,0 @@ --- StreetsMod needs a special slab definition, so it needs its own register_stair_and_slab -streets.register_stair_and_slab = function(node,desc,tile,item) - minetest.register_node(":streets:"..node.."_stair",{ - description = desc.."stair", - groups = {cracky = 3}, - tiles = tile, - paramtype = "light", - paramtype2 = "facedir", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, - {-0.5, 0, 0, 0.5, 0.5, 0.5} - } - } - }) - minetest.register_node(":streets:"..node.."_slab",{ - description = desc.." slab", - groups = {cracky = 3}, - tiles = tile, - paramtype = "light", - paramtype2 = "facedir", - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, - } - } - }) - minetest.register_craft({ - output = "streets:"..node.."_stair 4", - recipe = { - {"","",item}, - {"",item,item}, - {item,item,item} - } - }) - minetest.register_craft({ - output = "streets:"..node.."_stair 4", - recipe = { - {item,"",""}, - {item,item,""}, - {item,item,item} - } - }) - minetest.register_craft({ - output = "streets:"..node.."_slab 3", - recipe = { - {"","",""}, - {"","",""}, - {item,item,item} - } - }) -end
\ No newline at end of file diff --git a/asphaltstairs/init.lua b/asphaltstairs/init.lua index 7c1c181..a7ec32b 100644 --- a/asphaltstairs/init.lua +++ b/asphaltstairs/init.lua @@ -1,7 +1,7 @@ --[[ StreetsMod: Asphalt stairs ]] -if streets.extendedBy.moreblocks == true then +if type(register_stair_slab_panel_micro) ~= "function" then return end -- Asphalt register_stair_slab_panel_micro("streets", "asphalt", "streets:asphalt", {cracky=3}, {"streets_asphalt.png"}, "Asphalt", "asphalt", nil) minetest.register_alias("streets:asphalt_stair","stairs:stair_asphalt") @@ -25,7 +25,7 @@ if streets.extendedBy.moreblocks == true then } }) minetest.register_craft({ - output = "streets:asphalt_solid_line_stair", + output = "streets:asphalt_solid_line_stair 6", recipe = { {"","","streets:asphalt_solid_line"}, {"","streets:asphalt_solid_line","streets:asphalt_solid_line"}, @@ -33,7 +33,7 @@ if streets.extendedBy.moreblocks == true then } }) minetest.register_craft({ - output = "streets:asphalt_solid_line_stair", + output = "streets:asphalt_solid_line_stair 6", recipe = { {"streets:asphalt_solid_line","",""}, {"streets:asphalt_solid_line","streets:asphalt_solid_line",""}, @@ -56,7 +56,7 @@ if streets.extendedBy.moreblocks == true then } }) minetest.register_craft({ - output = "streets:asphalt_solid_line_slab", + output = "streets:asphalt_solid_line_slab 3", recipe = { {"","",""}, {"","",""}, @@ -82,7 +82,7 @@ if streets.extendedBy.moreblocks == true then } }) minetest.register_craft({ - output = "streets:asphalt_dashed_line_stair", + output = "streets:asphalt_dashed_line_stair 6", recipe = { {"","","streets:asphalt_dashed_line"}, {"","streets:asphalt_dashed_line","streets:asphalt_dashed_line"}, @@ -90,7 +90,7 @@ if streets.extendedBy.moreblocks == true then } }) minetest.register_craft({ - output = "streets:asphalt_dashed_line_stair", + output = "streets:asphalt_dashed_line_stair 6", recipe = { {"streets:asphalt_dashed_line","",""}, {"streets:asphalt_dashed_line","streets:asphalt_dashed_line",""}, @@ -113,7 +113,7 @@ if streets.extendedBy.moreblocks == true then } }) minetest.register_craft({ - output = "streets:asphalt_dashed_line_slab", + output = "streets:asphalt_dashed_line_slab 3", recipe = { {"","",""}, {"","",""}, @@ -153,7 +153,7 @@ if streets.extendedBy.moreblocks == true then } }) minetest.register_craft({ - output = "streets:asphalt_side_stair_l", + output = "streets:asphalt_side_stair_l 6", recipe = { {"","","streets:asphalt_side"}, {"","streets:asphalt_side","streets:asphalt_side"}, @@ -161,7 +161,7 @@ if streets.extendedBy.moreblocks == true then } }) minetest.register_craft({ - output = "streets:asphalt_side_stair_l", + output = "streets:asphalt_side_stair_l 6", recipe = { {"streets:asphalt_side","",""}, {"streets:asphalt_side","streets:asphalt_side",""}, @@ -208,7 +208,7 @@ if streets.extendedBy.moreblocks == true then } }) minetest.register_craft({ - output = "streets:asphalt_side_slab_l", + output = "streets:asphalt_side_slab_l 3", recipe = { {"","",""}, {"","",""}, @@ -224,5 +224,4 @@ if streets.extendedBy.moreblocks == true then type = "shapeless", output = "streets:asphalt_side_l", recipe = {"streets:asphalt_side_r"} - }) -end
\ No newline at end of file + })
\ No newline at end of file diff --git a/concretestairs/init.lua b/concretestairs/init.lua index 4cd3efd..b3000fa 100644 --- a/concretestairs/init.lua +++ b/concretestairs/init.lua @@ -1,7 +1,7 @@ --[[ StreetsMod: Concrete stairs (compatible to circular saw) ]] -if streets.extendedBy.moreblocks == true and streets.extendedBy.prefab == false then +if type(register_stair_slab_panel_mirco) == "function" and streets.extendedBy.prefab == false then register_stair_slab_panel_micro("streets", "concrete", "streets:concrete", {cracky=2}, {"streets_concrete.png"}, "Concrete", "concrete", nil) table.insert(circular_saw.known_stairs,"streets:concrete") minetest.register_alias("stairs:stair_concrete","streets:stair_concrete") diff --git a/description.txt b/description.txt new file mode 100644 index 0000000..57612b0 --- /dev/null +++ b/description.txt @@ -0,0 +1 @@ +With the StreetsMod, you can build your own realistic streets with arrows, lines, manholes and many more cool stuff. You don't need any additional mod, but it's recommended to have stairs (default), wool (default) and bucket (default) installed. It's easy for you to enable/disable certain parts of this mod because it's organised as a modpack, which you can configure in Minetest's Main Menu -> Configure.
\ No newline at end of file diff --git a/emergencyphone/init.lua b/emergencyphone/init.lua index 90124a8..2dc818f 100644 --- a/emergencyphone/init.lua +++ b/emergencyphone/init.lua @@ -1,27 +1,25 @@ --[[ StreetsMod: Emergency Phone ]] -if streets.extendedBy.wool == true then - minetest.register_node(":streets:emergencyphone",{ - description = "Emergency Phone", - tiles = {"streets_sos_top.png","streets_sos_bottom.png","streets_sos_side.png","streets_sos_side.png","streets_sos_side.png","streets_sos_front.png"}, - groups = {cracky = 3}, - paramtype2 = "facedir", - light_source = 5, - on_rightclick = function(pos,node,clicker) - if clicker:is_player() and clicker:get_hp() < 6 then - clicker:set_hp(6) - minetest.log("action",clicker:get_player_name() .. " healed by emergency phone at pos (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ")") - end +minetest.register_node(":streets:emergencyphone",{ + description = "Emergency Phone", + tiles = {"streets_sos_top.png","streets_sos_bottom.png","streets_sos_side.png","streets_sos_side.png","streets_sos_side.png","streets_sos_front.png"}, + groups = {cracky = 3}, + paramtype2 = "facedir", + light_source = 5, + on_rightclick = function(pos,node,clicker) + if clicker:is_player() and clicker:get_hp() < 6 then + clicker:set_hp(6) + minetest.log("action",clicker:get_player_name() .. " healed by emergency phone at pos (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ")") end - }) - minetest.register_alias("streets:emergency_phone","streets:emergencyphone") - minetest.register_craft({ - output = "streets:emergencyphone", - recipe = { - {"wool:orange","default:torch","wool:orange"}, - {"wool:orange","default:apple","wool:orange"}, - {"default:steel_ingot","default:diamondblock","default:steel_ingot"} - } - }) -end
\ No newline at end of file + end + }) + minetest.register_alias("streets:emergency_phone","streets:emergencyphone") +minetest.register_craft({ + output = "streets:emergencyphone", + recipe = { + {"wool:orange","default:torch","wool:orange"}, + {"wool:orange","default:apple","wool:orange"}, + {"default:steel_ingot","default:diamondblock","default:steel_ingot"} + } +})
\ No newline at end of file diff --git a/labels/init.lua b/labels/init.lua index 5e59a3c..c627b64 100644 --- a/labels/init.lua +++ b/labels/init.lua @@ -1,8 +1,6 @@ --[[ StreetsMod: All kinds of asphalt with labels ]] -if streets.extendedBy.wool == false then return end --- minetest.register_node(":streets:asphalt_sideline",{ description = "Asphalt with sideline", groups = {cracky=3}, @@ -13,9 +11,9 @@ minetest.register_alias("streets:asphalt_side","streets:asphalt_sideline") minetest.register_craft({ output = "streets:asphalt_side 6", recipe = { - {"wool:white","streets:asphalt","streets:asphalt"}, - {"wool:white","streets:asphalt","streets:asphalt"}, - {"wool:white","streets:asphalt","streets:asphalt"} + {"dye:white","streets:asphalt","streets:asphalt"}, + {"dye:white","streets:asphalt","streets:asphalt"}, + {"dye:white","streets:asphalt","streets:asphalt"} } }) @@ -29,9 +27,9 @@ minetest.register_alias("streets:asphalt_middle","streets:asphalt_solid_line") minetest.register_craft({ output = "streets:asphalt_solid_line 6", recipe = { - {"streets:asphalt","wool:white","streets:asphalt"}, - {"streets:asphalt","wool:white","streets:asphalt"}, - {"streets:asphalt","wool:white","streets:asphalt"} + {"streets:asphalt","dye:white","streets:asphalt"}, + {"streets:asphalt","dye:white","streets:asphalt"}, + {"streets:asphalt","dye:white","streets:asphalt"} } }) @@ -45,9 +43,9 @@ minetest.register_alias("streets:asphalt_middle_dashed","streets:asphalt_dashed_ minetest.register_craft({ output = "streets:asphalt_dashed_line 6", recipe = { - {"streets:asphalt","wool:white","streets:asphalt"}, + {"streets:asphalt","dye:white","streets:asphalt"}, {"streets:asphalt","streets:asphalt","streets:asphalt"}, - {"streets:asphalt","wool:white","streets:asphalt"} + {"streets:asphalt","dye:white","streets:asphalt"} } }) @@ -61,9 +59,9 @@ minetest.register_node(":streets:asphalt_outer_edge",{ minetest.register_craft({ output = "streets:asphalt_outer_edge 4", recipe = { - {"wool:white","wool:white","wool:white"}, - {"wool:white","streets:asphalt","streets:asphalt"}, - {"wool:white","streets:asphalt","streets:asphalt"} + {"dye:white","dye:white","dye:white"}, + {"dye:white","streets:asphalt","streets:asphalt"}, + {"dye:white","streets:asphalt","streets:asphalt"} } }) @@ -77,9 +75,9 @@ minetest.register_node(":streets:asphalt_parking",{ minetest.register_craft({ output = "streets:asphalt_outer_edge 4", recipe = { - {"streets:asphalt","wool:white","wool:white"}, - {"streets:asphalt","wool:white","wool:white"}, - {"streets:asphalt","wool:white","streets:asphalt"} + {"streets:asphalt","dye:white","dye:white"}, + {"streets:asphalt","dye:white","dye:white"}, + {"streets:asphalt","dye:white","streets:asphalt"} } }) @@ -94,8 +92,8 @@ minetest.register_craft({ output = "streets:asphalt_arrow_straight 4", recipe = { {"streets:asphalt","streets:asphalt","streets:asphalt"}, - {"streets:asphalt","wool:white","streets:asphalt"}, - {"streets:asphalt","wool:white","streets:asphalt"} + {"streets:asphalt","dye:white","streets:asphalt"}, + {"streets:asphalt","dye:white","streets:asphalt"} } }) @@ -110,8 +108,8 @@ minetest.register_craft({ output = "streets:asphalt_arrow_left 4", recipe = { {"streets:asphalt","streets:asphalt","streets:asphalt"}, - {"wool:white","wool:white","streets:asphalt"}, - {"streets:asphalt","wool:white","streets:asphalt"} + {"dye:white","dye:white","streets:asphalt"}, + {"streets:asphalt","dye:white","streets:asphalt"} } }) @@ -126,8 +124,8 @@ minetest.register_craft({ output = "streets:asphalt_arrow_right 4", recipe = { {"streets:asphalt","streets:asphalt","streets:asphalt"}, - {"streets:asphalt","wool:white","wool:white"}, - {"streets:asphalt","wool:white","streets:asphalt"} + {"streets:asphalt","dye:white","dye:white"}, + {"streets:asphalt","dye:white","streets:asphalt"} } }) @@ -141,9 +139,9 @@ minetest.register_node(":streets:asphalt_arrow_straight_left",{ minetest.register_craft({ output = "streets:asphalt_arrow_straight_left 4", recipe = { - {"streets:asphalt","wool:white","streets:asphalt"}, - {"wool:white","wool:white","streets:asphalt"}, - {"streets:asphalt","wool:white","streets:asphalt"} + {"streets:asphalt","dye:white","streets:asphalt"}, + {"dye:white","dye:white","streets:asphalt"}, + {"streets:asphalt","dye:white","streets:asphalt"} } }) @@ -157,9 +155,9 @@ minetest.register_node(":streets:asphalt_arrow_straight_right",{ minetest.register_craft({ output = "streets:asphalt_arrow_straight_right 4", recipe = { - {"streets:asphalt","wool:white","streets:asphalt"}, - {"streets:asphalt","wool:white","wool:white"}, - {"streets:asphalt","wool:white","streets:asphalt"} + {"streets:asphalt","dye:white","streets:asphalt"}, + {"streets:asphalt","dye:white","dye:white"}, + {"streets:asphalt","dye:white","streets:asphalt"} } }) @@ -173,8 +171,8 @@ minetest.register_node(":streets:asphalt_arrow_alldirs",{ minetest.register_craft({ output = "streets:asphalt_arrow_alldirs 4", recipe = { - {"streets:asphalt","wool:white","streets:asphalt"}, - {"wool:white","wool:white","wool:white"}, - {"streets:asphalt","wool:white","streets:asphalt"} + {"streets:asphalt","dye:white","streets:asphalt"}, + {"dye:white","dye:white","dye:white"}, + {"streets:asphalt","dye:white","streets:asphalt"} } })
\ No newline at end of file diff --git a/roadsigns/init.lua b/roadsigns/init.lua index 4985694..38e8692 100644 --- a/roadsigns/init.lua +++ b/roadsigns/init.lua @@ -2,4 +2,5 @@ StreetsMod: Poles and signs ]] dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/pole.lua") -dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/signs.lua")
\ No newline at end of file +dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/signs.lua") +dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/workshop.lua")
\ No newline at end of file diff --git a/roadsigns/pole.lua b/roadsigns/pole.lua index 8f2f7ba..478afb9 100644 --- a/roadsigns/pole.lua +++ b/roadsigns/pole.lua @@ -48,7 +48,8 @@ minetest.register_node(":streets:pole_top",{ paramtype = "light", paramtype2 = "facedir", drawtype = "nodebox", - can_dig = function(pos,player) + drop = "", + can_dig = function() return false end, node_box = { diff --git a/roadsigns/signs.lua b/roadsigns/signs.lua index a73b294..0992adf 100644 --- a/roadsigns/signs.lua +++ b/roadsigns/signs.lua @@ -1,81 +1,110 @@ -if streets.extendedBy.bucket == true and streets.extendedBy.wool then - minetest.register_node(":streets:sign_lava",{ - description = "Warning sign (lava)", - tiles = {"streets_sign_lava.png"}, - inventory_image = "streets_sign_lava.png", - wield_image = "streets_sign_lava.png", - groups = {snappy = 1,attached_node = 1}, - drawtype = "signlike", - paramtype = "light", - paramtype2 = "wallmounted", - walkable = false, - sunlight_propagates = true, - selection_box = { - type = "wallmounted" +minetest.register_node(":streets:sign_blank",{ + description = "Emtpy sign", + tiles = {"streets_sign_back.png"}, + inventory_image = "streets_sign_back.png", + wield_image = "streets_sign_back.png", + groups = {snappy = 1,attached_node = 1}, + drawtype = "nodebox", + node_box = { + type = "wallmounted", + fixed = { + {-0.4,-0.5,-0.4,0.4,-0.4,0.4} } - }) - - minetest.register_craft({ - output = "streets:sign_lava 2", - recipe = { - {"wool:red","wool:red","wool:red"}, - {"wool:red","bucket:bucket_lava","wool:red"}, - {"wool:red","wool:red","wool:red"} - }, - replacements = { - {"bucket:bucket_lava", "bucket:bucket_empty"} + }, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = { + type = "wallmounted" + }, + streets = { + signworkshop = { + recipe = {"default:steel_ingot","","",""}, + time = 3 } - }) - - minetest.register_node(":streets:sign_water",{ - description = "Warning sign (water)", - tiles = {"streets_sign_water.png"}, - inventory_image = "streets_sign_water.png", - wield_image = "streets_sign_water.png", - groups = {snappy = 1,attached_node = 1}, - drawtype = "signlike", - paramtype = "light", - paramtype2 = "wallmounted", - walkable = false, - sunlight_propagates = true, - selection_box = { - type = "wallmounted" + } +}) +minetest.register_node(":streets:sign_lava",{ + description = "Warning sign (lava)", + tiles = {"streets_sign_lava.png"}, + inventory_image = "streets_sign_lava.png", + wield_image = "streets_sign_lava.png", + groups = {snappy = 1,attached_node = 1}, + drawtype = "nodebox", + node_box = { + type = "wallmounted", + fixed = { + {-0.4,-0.5,-0.4,0.4,-0.4,0.4} } - }) - - minetest.register_craft({ - output = "streets:sign_water 2", - recipe = { - {"wool:red","wool:red","wool:red"}, - {"wool:red","bucket:bucket_water","wool:red"}, - {"wool:red","wool:red","wool:red"} - }, - replacements = { - {"bucket:bucket_water", "bucket:bucket_empty"} + }, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = { + type = "wallmounted" + }, + streets = { + signworkshop = { + recipe = {"streets:sign_blank","bucket:bucket_lava","",""}, + time = 5 } - }) + } +}) - minetest.register_node(":streets:sign_construction",{ - description = "Warning sign (Construction area)", - tiles = {"streets_sign_construction.png"}, - inventory_image = "streets_sign_construction.png", - wield_image = "streets_sign_construction.png", - groups = {snappy = 1,attached_node = 1}, - drawtype = "signlike", - paramtype = "light", - paramtype2 = "wallmounted", - walkable = false, - sunlight_propagates = true, - selection_box = { - type = "wallmounted" +minetest.register_node(":streets:sign_water",{ + description = "Warning sign (water)", + tiles = {"streets_sign_water.png"}, + inventory_image = "streets_sign_water.png", + wield_image = "streets_sign_water.png", + groups = {snappy = 1,attached_node = 1}, + drawtype = "nodebox", + node_box = { + type = "wallmounted", + fixed = { + {-0.4,-0.5,-0.4,0.4,-0.4,0.4} + } + }, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = { + type = "wallmounted" + }, + streets = { + signworkshop = { + recipe = {"streets:sign_blank","bucket:bucket_water","",""}, + time = 5 + } + } +}) + +minetest.register_node(":streets:sign_construction",{ + description = "Warning sign (Construction area)", + tiles = {"streets_sign_construction.png"}, + inventory_image = "streets_sign_construction.png", + wield_image = "streets_sign_construction.png", + groups = {snappy = 1,attached_node = 1}, + drawtype = "nodebox", + node_box = { + type = "wallmounted", + fixed = { + {-0.4,-0.5,-0.4,0.4,-0.4,0.4} } - }) - minetest.register_craft({ - output = "streets:sign_construction 2", - recipe = { - {"wool:red","wool:red","wool:red"}, - {"wool:red","default:shovel_steel","wool:red"}, - {"wool:red","wool:red","wool:red"} + }, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = { + type = "wallmounted" + }, + streets = { + signworkshop = { + recipe = {"streets:sign_blank","default:dirt","",""}, + time = 5 } - }) -end
\ No newline at end of file + } +})
\ No newline at end of file diff --git a/roadsigns/textures/streets_signworkshop_bottom.png b/roadsigns/textures/streets_signworkshop_bottom.png Binary files differnew file mode 100644 index 0000000..022bb2c --- /dev/null +++ b/roadsigns/textures/streets_signworkshop_bottom.png diff --git a/roadsigns/textures/streets_signworkshop_front.png b/roadsigns/textures/streets_signworkshop_front.png Binary files differnew file mode 100644 index 0000000..83317b1 --- /dev/null +++ b/roadsigns/textures/streets_signworkshop_front.png diff --git a/roadsigns/textures/streets_signworkshop_side.png b/roadsigns/textures/streets_signworkshop_side.png Binary files differnew file mode 100644 index 0000000..509a3e3 --- /dev/null +++ b/roadsigns/textures/streets_signworkshop_side.png diff --git a/roadsigns/textures/streets_signworkshop_top.png b/roadsigns/textures/streets_signworkshop_top.png Binary files differnew file mode 100644 index 0000000..07f4f06 --- /dev/null +++ b/roadsigns/textures/streets_signworkshop_top.png diff --git a/roadsigns/workshop.lua b/roadsigns/workshop.lua new file mode 100644 index 0000000..9c68fb7 --- /dev/null +++ b/roadsigns/workshop.lua @@ -0,0 +1,147 @@ +--[[ + StreetsMod: Create signs in the signworkshop +]] +local forms = { + inactive = { + "size[12,10]", + "label[3.5,0;Sign workshop - Create signs for your roads!]", + "label[0,0.5;Available signs:]", + "list[context;streets:signworkshop_list;0,1;5,4]", + "label[9,0.5;Needed stuff:]", + "list[context;streets:signworkshop_recipe;8,1;4,1]", + "label[9,2;Put it here:]", + "list[context;streets:signworkshop_input;8,3;4,1]", + "button[8,4;2,1;streets:signworkshop_send;Start!]", + "label[5.8,0.5;Selected:]", + "list[context;streets:signworkshop_select;6,1;1,1]", + "label[5.8,2.5;Output:]", + "list[context;streets:signworkshop_output;6,3;1,1]", + "list[current_player;main;2,6;8,4]", + }, + active = { + "size[12,10]", + "label[3.5,0;Sign workshop - Create signs for your roads!]", + "label[0,0.5;Available signs:]", + "list[context;streets:signworkshop_list;0,1;5,4]", + "label[9,0.5;Needed stuff:]", + "list[context;streets:signworkshop_recipe;8,1;4,1]", + "label[9,2;Put it here:]", + "list[context;streets:signworkshop_input;8,3;4,1]", + "label[5.8,0.5;Selected:]", + "list[context;streets:signworkshop_select;6,1;1,1]", + "label[5.8,2.5;Output:]", + "list[context;streets:signworkshop_output;6,3;1,1]", + "list[current_player;main;2,6;8,4]" + -- + } +} +minetest.register_node(":streets:signworkshop",{ + description = "Sign workshop", + tiles = {"streets_signworkshop_top.png","streets_signworkshop_bottom.png","streets_signworkshop_side.png","streets_signworkshop_side.png","streets_signworkshop_side.png","streets_signworkshop_front.png"}, + groups = {cracky = 1, level = 2}, + paramtype2 = "facedir", + after_place_node = function(pos) + minetest.get_meta(pos):set_string("formspec",table.concat(forms.inactive)) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("streets:signworkshop_list",5*4) + inv:set_size("streets:signworkshop_recipe",3*2) + inv:set_size("streets:signworkshop_input",4*1) + inv:set_size("streets:signworkshop_select",1*1) + inv:set_size("streets:signworkshop_output",1*1) + -- Fill + inv:add_item("streets:signworkshop_list","streets:sign_blank") + inv:add_item("streets:signworkshop_list","streets:sign_lava") + inv:add_item("streets:signworkshop_list","streets:sign_water") + inv:add_item("streets:signworkshop_list","streets:sign_construction") + -- Meta + meta:set_string("infotext","Sign workshop idle") + meta:set_string("idle","y") + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + if listname ~= "streets:signworkshop_input" then + return 0 + else + return 1 + end + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + -- Move items inside input slots + if to_list == "streets:signworkshop_input" and from_list == "streets:signworkshop_input" then + return 1 + -- List -> selection + elseif from_list == "streets:signworkshop_list" and to_list == "streets:signworkshop_select" then + local inv = minetest.get_meta(pos):get_inventory() + local selected = inv:get_stack("streets:signworkshop_list",from_index):to_table() + local need = minetest.registered_nodes[selected.name].streets.signworkshop.recipe + inv:set_list("streets:signworkshop_recipe",{need[1],need[2],need[3],need[4]}) + return 1 + -- selection -> list + elseif from_list == "streets:signworkshop_select" and to_list == "streets:signworkshop_list" then + local inv = minetest.get_meta(pos):get_inventory() + inv:set_list("streets:signworkshop_recipe",{"","","",""}) + return 1 + -- Every other case + else + return 0 + end + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + if listname == "streets:signworkshop_input" or listname == "streets:signworkshop_output" then + return 99 + else + return 0 + end + end, + on_receive_fields = function(pos, formname, fields, sender) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + -- + if inv:is_empty("streets:signworkshop_input") ~= true and inv:is_empty("streets:signworkshop_select") ~= true and meta:get_string("idle") == "y" then + local selection = inv:get_stack("streets:signworkshop_select",1):get_name() + local def = minetest.registered_nodes[selection].streets.signworkshop + local need = inv:get_list("streets:signworkshop_recipe") + local has = inv:get_list("streets:signworkshop_input") + need[1] = need[1]:to_table() + need[2] = need[2]:to_table() + need[3] = need[3]:to_table() + need[4] = need[4]:to_table() + has[1] = has[1]:to_table() + has[2] = has[2]:to_table() + has[3] = has[3]:to_table() + has[4] = has[4]:to_table() + if need[1] == nil then need[1] = { name = "" } end + if need[2] == nil then need[2] = { name = "" } end + if need[3] == nil then need[3] = { name = "" } end + if need[4] == nil then need[4] = { name = "" } end + if has[1] == nil then has[1] = { name = "" } end + if has[2] == nil then has[2] = { name = "" } end + if has[3] == nil then has[3] = { name = "" } end + if has[4] == nil then has[4] = { name = "" } end + if need[1].name == has[1].name and need[2].name == has[2].name and need[3].name == has[3].name and need[4].name == has[4].name then + meta:set_string("infotext","Sign workshop working") + meta:set_string("idle","n") + meta:set_string("formspec",table.concat(forms.active) .. "label[8,4;Please wait " .. def.time .. " seconds...]") + -- Clear input + inv:set_list("streets:signworkshop_input",{"","","",""}) + minetest.after(def.time,function() + -- Reset infotext and meta + meta:set_string("infotext","Sign workshop idle") + meta:set_string("idle","y") + meta:set_string("formspec",table.concat(forms.inactive)) + -- Fill output + inv:add_item("streets:signworkshop_output",selection) + end) + end + end + end +}) + +minetest.register_craft({ + output = "streets:signworkshop", + recipe = { + {"default:steel_ingot","default:glass","default:steel_ingot"}, + {"default:steel_ingot","default:diamond","default:steel_ingot"}, + {"default:cobble","default:cobble","default:cobble"} + } +})
\ No newline at end of file diff --git a/roadworks/init.lua b/roadworks/init.lua index cbbb8b7..6df2e13 100644 --- a/roadworks/init.lua +++ b/roadworks/init.lua @@ -247,63 +247,63 @@ minetest.register_node(":streets:rw_sideline",{ minetest.register_craft({ output = "streets:rw_asphalt_solid 3", recipe = { - {"","wool:yellow",""}, - {"","wool:yellow",""}, - {"","wool:yellow",""} + {"","dye:yellow",""}, + {"","dye:yellow",""}, + {"","dye:yellow",""} } }) minetest.register_craft({ output = "streets:rw_sideline 3", recipe = { - {"wool:yellow","wool:yellow",""}, - {"wool:yellow","wool:yellow",""}, - {"wool:yellow","wool:yellow",""} + {"dye:yellow","dye:yellow",""}, + {"dye:yellow","dye:yellow",""}, + {"dye:yellow","dye:yellow",""} } }) minetest.register_craft({ output = "streets:rw_asphalt_dashed 3", recipe = { - {"","wool:yellow",""}, + {"","dye:yellow",""}, {"","",""}, - {"","wool:yellow",""} + {"","dye:yellow",""} } }) minetest.register_craft({ output = "streets:rw_cross 3", recipe = { - {"wool:yellow","","wool:yellow"}, - {"","wool:yellow",""}, - {"wool:yellow","","wool:yellow"} + {"dye:yellow","","dye:yellow"}, + {"","dye:yellow",""}, + {"dye:yellow","","dye:yellow"} } }) minetest.register_craft({ output = "streets:rw_outer_edge 3", recipe = { - {"wool:yellow","wool:yellow","wool:yellow"}, - {"wool:yellow","",""}, - {"wool:yellow","",""} + {"dye:yellow","dye:yellow","dye:yellow"}, + {"dye:yellow","",""}, + {"dye:yellow","",""} } }) minetest.register_craft({ output = "streets:rw_parking 3", recipe = { - {"","wool:yellow","wool:yellow"}, - {"","wool:yellow","wool:yellow"}, - {"","wool:yellow",""} + {"","dye:yellow","dye:yellow"}, + {"","dye:yellow","dye:yellow"}, + {"","dye:yellow",""} } }) minetest.register_craft({ output = "streets:rw_alldirs 3", recipe = { - {"","wool:yellow",""}, - {"wool:yellow","wool:yellow","wool:yellow"}, - {"","wool:yellow",""} + {"","dye:yellow",""}, + {"dye:yellow","dye:yellow","dye:yellow"}, + {"","dye:yellow",""} } }) @@ -311,8 +311,8 @@ minetest.register_craft({ output = "streets:rw_left 3", recipe = { {"","",""}, - {"wool:yellow","wool:yellow",""}, - {"","wool:yellow",""} + {"dye:yellow","dye:yellow",""}, + {"","dye:yellow",""} } }) @@ -320,26 +320,26 @@ minetest.register_craft({ output = "streets:rw_right 3", recipe = { {"","",""}, - {"","wool:yellow","wool:yellow"}, - {"","wool:yellow",""} + {"","dye:yellow","dye:yellow"}, + {"","dye:yellow",""} } }) minetest.register_craft({ output = "streets:rw_straight_left 3", recipe = { - {"","wool:yellow",""}, - {"wool:yellow","wool:yellow",""}, - {"","wool:yellow",""} + {"","dye:yellow",""}, + {"dye:yellow","dye:yellow",""}, + {"","dye:yellow",""} } }) minetest.register_craft({ output = "streets:rw_straight_right 3", recipe = { - {"","wool:yellow",""}, - {"","wool:yellow","wool:yellow"}, - {"","wool:yellow",""} + {"","dye:yellow",""}, + {"","dye:yellow","dye:yellow"}, + {"","dye:yellow",""} } }) @@ -347,7 +347,7 @@ minetest.register_craft({ output = "streets:rw_straight 3", recipe = { {"","",""}, - {"","wool:yellow",""}, - {"","wool:yellow",""} + {"","dye:yellow",""}, + {"","dye:yellow",""} } })
\ No newline at end of file diff --git a/screenshot.png b/screenshot.png Binary files differnew file mode 100644 index 0000000..d9bf232 --- /dev/null +++ b/screenshot.png diff --git a/streetlamps/init.lua b/streetlamps/init.lua index 1cc9973..a139104 100644 --- a/streetlamps/init.lua +++ b/streetlamps/init.lua @@ -1,8 +1,49 @@ --[[ StreetsMod: Streetlamps ]] +--[[minetest.register_node(":streets:streetlamp_basic_controller",{ + description = "Trafficlight", + tiles = {"streets_lampcontroller_top.png","streets_lampcontroller_bottom.png","streets_lampcontroller_sides.png"}, + groups = {cracky = 1, not_in_creative_inventory = 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} + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5,-0.5,-0.5,0.5,0.5,0.5}, + {-0.3,1.5,-0.3,0.3,4.5,0.3} + } + }, + mesecons = { + effector = { + action_on = function(pos,node) + minetest.set_node({x = pos.x, y = pos.y + 4, z = pos.z},{name = "streets:streetlamp_basic_top_on"}) + end, + action_off = function(pos,node) + minetest.set_node({x = pos.x, y = pos.y + 4, z = pos.z},{name = "streets:streetlamp_basic_top_off"}) + end + } + }, + after_dig_node = function(pos) + minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z}) + minetest.remove_node({x = pos.x, y = pos.y + 3, z = pos.z}) + minetest.remove_node({x = pos.x, y = pos.y + 4, z = pos.z}) + minetest.chat_send_all("!!!") + end +})]] + minetest.register_node(":streets:streetlamp_basic_bottom",{ + drop = "", description = "Street lamp", + tiles = {"streets_lamps_basic_bottom.png"}, + inventory_image = "streets_lamps_basi_inv.png", groups = {cracky = 1}, paramtype = "light", drawtype = "nodebox", @@ -13,24 +54,18 @@ minetest.register_node(":streets:streetlamp_basic_bottom",{ {-0.1,0.4,-0.1,0.1,0.5,0.1} } }, + pointable = false, after_place_node = function(pos,placer,itemstack) minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z},{name = "streets:streetlamp_basic_middle"}) - minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_off"}) - end, - mesecons = { - effector = { - action_on = function(pos,node) - minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_on"}) - end, - action_off = function(pos,node) - minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_off"}) - end - } - } + minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_on"}) + -- minetest.set_node({x = pos.x, y = pos.y - 2, z = pos.z},{name = "streets:streetlamp_basic_controller"}) + end }) minetest.register_node(":streets:streetlamp_basic_middle",{ + drop = "", description = "U cheater U", groups = {cracky = 1, not_in_creative_inventory = 1}, + tiles = {"streets_lamps_basic_middle.png"}, paramtype = "light", drawtype = "nodebox", pointable = false, @@ -41,7 +76,8 @@ minetest.register_node(":streets:streetlamp_basic_middle",{ } } }) -minetest.register_node(":streets:streetlamp_basic_top_off",{ +--[[minetest.register_node(":streets:streetlamp_basic_top_off",{ + drop = "", description = "U cheater U", groups = {cracky = 1, not_in_creative_inventory = 1}, paramtype = "light", @@ -54,13 +90,14 @@ minetest.register_node(":streets:streetlamp_basic_top_off",{ {-0.3,-0.4,-0.3,0.3,0.5,0.3} } } -}) +})]] minetest.register_node(":streets:streetlamp_basic_top_on",{ + drop = "", description = "U cheater U", groups = {cracky = 1, not_in_creative_inventory = 1}, + tiles = {"streets_lamps_basic_top_top.png","streets_lamps_basic_top_top.png","streets_lamps_basic_top.png","streets_lamps_basic_top.png","streets_lamps_basic_top.png","streets_lamps_basic_top.png"}, paramtype = "light", drawtype = "nodebox", - pointable = false, light_source = 10, node_box = { type = "fixed", @@ -68,5 +105,24 @@ minetest.register_node(":streets:streetlamp_basic_top_on",{ {-0.1,-0.5,-0.1,0.1,-0.4,0.1}, {-0.3,-0.4,-0.3,0.3,0.5,0.3} } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.3,0.5,-0.3,0.3,-2.5,0.3}, + } + }, + after_dig_node = function(pos) + minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z}) + minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z}) + end +}) + +minetest.register_craft({ + output = "streets:streetlamp_basic_bottom", + recipe = { + {"","default:torch",""}, + {"","default:stick",""}, + {"","default:stick",""} } })
\ No newline at end of file diff --git a/streetlamps/textures/streets_lamps_basi_inv.png b/streetlamps/textures/streets_lamps_basi_inv.png Binary files differnew file mode 100644 index 0000000..5c31236 --- /dev/null +++ b/streetlamps/textures/streets_lamps_basi_inv.png diff --git a/streetlamps/textures/streets_lamps_basic_bottom.png b/streetlamps/textures/streets_lamps_basic_bottom.png Binary files differnew file mode 100644 index 0000000..07d123f --- /dev/null +++ b/streetlamps/textures/streets_lamps_basic_bottom.png diff --git a/streetlamps/textures/streets_lamps_basic_middle.png b/streetlamps/textures/streets_lamps_basic_middle.png Binary files differnew file mode 100644 index 0000000..1370765 --- /dev/null +++ b/streetlamps/textures/streets_lamps_basic_middle.png diff --git a/streetlamps/textures/streets_lamps_basic_top.png b/streetlamps/textures/streets_lamps_basic_top.png Binary files differnew file mode 100644 index 0000000..355f50d --- /dev/null +++ b/streetlamps/textures/streets_lamps_basic_top.png diff --git a/streetlamps/textures/streets_lamps_basic_top_top.png b/streetlamps/textures/streets_lamps_basic_top_top.png Binary files differnew file mode 100644 index 0000000..4d6bf22 --- /dev/null +++ b/streetlamps/textures/streets_lamps_basic_top_top.png diff --git a/streetsmod/init.lua b/streetsmod/init.lua index ed044bd..e7de999 100644 --- a/streetsmod/init.lua +++ b/streetsmod/init.lua @@ -11,6 +11,10 @@ streets.version = "1.3 indev" streets.modpath = minetest.get_modpath("streets") streets.extendedBy = {} + streets.load = { + start = os.clock(), + fin = 0 + } -- Check for mods which change this mod's beahaviour print("Streets: Checking installed mods...") @@ -35,13 +39,6 @@ print("'Moreblocks' not installed \n\t => There won't be stairs and slabs'") streets.extendedBy.moreblocks = false end - if minetest.get_modpath("bucket") then - print("'Bucket' is installed \n\t => All signs are available") - streets.extendedBy.bucket = true - else - print("'Bucket' not installed \n\t => No signs available") - streets.extendedBy.bucket = false - end if minetest.get_modpath("mesecons") then print("'Mesecons' is installed \n\t => Trafficlights might be available. Checking for digilines. Streetlamps available") streets.extendedBy.mesecons = true @@ -64,6 +61,29 @@ streets.extendedBy.prefab = false end +-- Streets chatcommand + local function round(num, idp) + local mult = 10^(idp or 0) + return math.floor(num * mult + 0.5) / mult + end + minetest.register_chatcommand("streets",{ + description = "Check version of you installed StreetsMod and find information", + func = function(name,param) + minetest.show_formspec(name, "streets:streetsform", table.concat({ + "size[10,6]", + "label[0,1;Wool installed: " .. tostring(streets.extendedBy.wool) .. "]", + "label[0,1.5;Technic installed: " .. tostring(streets.extendedBy.technic) .. "]", + "label[0,2;Moreblocks installed: " .. tostring(streets.extendedBy.moreblocks) .. "]", + "label[0,2.5;Mesecons installed: " .. tostring(streets.extendedBy.mesecons) .. "]", + "label[0,3;Digilines installed: " .. tostring(streets.extendedBy.digilines) .. "]", + "label[0,3.5;Prefab installed: " .. tostring(streets.extendedBy.prefab) .. "]", + "label[0,4.5;Running version: " .. streets.version .. "]", + "label[0,5;Load time: " .. round(streets.load.fin - streets.load.start,4) .. "s]" + })) + end + }) + -- Done print("Streets: Setup completed, have fun with StreetsMod ".. streets.version .."!") - print("Streets: Special thanks to everyone who contributed to this mod (except myself): Immanuel_Kant and philipbenr!")
\ No newline at end of file + print("Streets: Special thanks to everyone who contributed to this mod (except myself): Immanuel_Kant and philipbenr!") + streets.load.fin = os.clock()
\ No newline at end of file diff --git a/trafficlight/init.lua b/trafficlight/init.lua index 768c26a..3eaa43a 100644 --- a/trafficlight/init.lua +++ b/trafficlight/init.lua @@ -1,9 +1,9 @@ --[[ StreetsMod: inDev Trafficlights ]] -if streets.extendedBy.mesecons and streets.extendedBy.digilines then minetest.register_node(":streets:trafficlight_bottom",{ description = "Cheater", + drop = "", groups = {not_in_creative_inventory = 1}, paramtype = "light", paramtype2 = "facedir", @@ -17,16 +17,11 @@ minetest.register_node(":streets:trafficlight_bottom",{ {-0.1,0.25,-0.1,0.1,0.5,0.1} } }, - selection_box = { - type = "fixed", - fixed = { - {-0.25,-0.5,-0.25,0.25,2.5,0.25}, - } - } }) minetest.register_node(":streets:trafficlight_middle",{ description = "Cheater!", + drop = "", groups = {cracky = 1, not_in_creative_inventory = 1}, paramtype = "light", drawtype = "nodebox", @@ -43,6 +38,7 @@ minetest.register_node(":streets:trafficlight_middle",{ minetest.register_node(":streets:trafficlight_controller",{ description = "Trafficlight", + inventory_image = "streets_trafficlight_inv.png", tiles = {"streets_lampcontroller_top.png","streets_lampcontroller_bottom.png","streets_lampcontroller_sides.png"}, groups = {cracky = 1}, drawtype = "nodebox", @@ -54,6 +50,13 @@ minetest.register_node(":streets:trafficlight_controller",{ {-0.05,0.5,-0.05,0.05,1.6,0.05} } }, + selection_box = { + type = "fixed", + fixed = { + {-0.5,-0.5,-0.5,0.5,0.5,0.5}, + {-0.3,1.5,-0.3,0.3,4.5,0.3} + } + }, on_receive_fields = function(pos, formname, fields, sender) minetest.get_meta(pos):set_string("channel", fields.channel) end, @@ -117,6 +120,7 @@ minetest.register_node(":streets:trafficlight_controller",{ minetest.register_node(":streets:trafficlight_top_off",{ description = "U cheater U", + drop = "", groups = {cracky = 1, not_in_creative_inventory = 1}, paramtype = "light", paramtype2 = "facedir", @@ -134,6 +138,7 @@ minetest.register_node(":streets:trafficlight_top_off",{ minetest.register_node(":streets:trafficlight_top_red",{ description = "U cheater U", + drop = "", groups = {cracky = 1, not_in_creative_inventory = 1}, paramtype = "light", paramtype2 = "facedir", @@ -152,6 +157,7 @@ minetest.register_node(":streets:trafficlight_top_red",{ minetest.register_node(":streets:trafficlight_top_yellow",{ description = "U cheater U", + drop = "", groups = {cracky = 1, not_in_creative_inventory = 1}, paramtype = "light", paramtype2 = "facedir", @@ -170,6 +176,7 @@ minetest.register_node(":streets:trafficlight_top_yellow",{ minetest.register_node(":streets:trafficlight_top_redyellow",{ description = "U cheater U", + drop = "", groups = {cracky = 1, not_in_creative_inventory = 1}, paramtype = "light", paramtype2 = "facedir", @@ -188,6 +195,7 @@ minetest.register_node(":streets:trafficlight_top_redyellow",{ minetest.register_node(":streets:trafficlight_top_green",{ description = "U cheater U", + drop = "", groups = {cracky = 1, not_in_creative_inventory = 1}, paramtype = "light", paramtype2 = "facedir", @@ -206,6 +214,7 @@ minetest.register_node(":streets:trafficlight_top_green",{ minetest.register_node(":streets:trafficlight_top_warn",{ description = "U cheater U", + drop = "", groups = {cracky = 1, not_in_creative_inventory = 1}, paramtype = "light", paramtype2 = "facedir", @@ -225,4 +234,11 @@ minetest.register_node(":streets:trafficlight_top_warn",{ light_source = 6, }) -end
\ No newline at end of file +minetest.register_craft({ + output = "streets:trafficlight_controller", + recipe = { + {"dye:red","",""}, + {"dye:yellow","",""}, + {"dye:green","",""} + } +})
\ No newline at end of file diff --git a/trafficlight/textures/streets_trafficlight_inv.png b/trafficlight/textures/streets_trafficlight_inv.png Binary files differnew file mode 100644 index 0000000..fb76b72 --- /dev/null +++ b/trafficlight/textures/streets_trafficlight_inv.png |