diff options
| -rw-r--r-- | asphaltstairs/init.lua | 126 | ||||
| -rw-r--r-- | concretestairs/init.lua | 15 | ||||
| -rw-r--r-- | infrastructure/nodes_extension.lua | 236 | 
3 files changed, 259 insertions, 118 deletions
| diff --git a/asphaltstairs/init.lua b/asphaltstairs/init.lua index 5ef4759..22a147d 100644 --- a/asphaltstairs/init.lua +++ b/asphaltstairs/init.lua @@ -1,8 +1,7 @@  --[[  	StreetsMod: Asphalt stairs  ]] -if not rawget(_G, "register_stair_slab_panel_micro") -or type(register_stair_slab_panel_micro) ~= "function" then return end +if not minetest.get_modpath("moreblocks") then return end  	-- Asphalt solid line  		-- Stair @@ -227,18 +226,113 @@ or type(register_stair_slab_panel_micro) ~= "function" then return end  	minetest.register_alias("streets:asphalt_stair","stairs:stair_asphalt")  	minetest.register_alias("streets:asphalt_slab","stairs:slab_asphalt") -	register_stair_slab_panel_micro("streets", "asphalt",              "streets:asphalt",              {cracky=3}, {"streets_asphalt.png"}, "Asphalt", "asphalt", nil) -	register_stair_slab_panel_micro("streets", "asphalt_solid_line",   "streets:asphalt_solid_line",   {cracky=3}, {"streets_asphalt.png^streets_asphalt_solid_line.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_solid_line.png"},   "Asphalt with solid centerline",                        "asphalt", nil) -	register_stair_slab_panel_micro("streets", "asphalt_dashed_line",  "streets:asphalt_dashed_line",  {cracky=3}, {"streets_asphalt.png^streets_asphalt_dashed_line.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_dashed_line.png"}, "Asphalt with dashed centerline",                       "asphalt", nil) -	register_stair_slab_panel_micro("streets", "asphalt_side",         "streets:asphalt_sideline",     {cracky=3}, {"streets_asphalt.png^streets_asphalt_side.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_side.png"},               "Asphalt with solid outer line (left)",                 "asphalt", nil) -	register_stair_slab_panel_micro("streets", "asphalt_side_r",       "streets:asphalt_side_r",       {cracky=3}, {"streets_asphalt.png^streets_asphalt_side_r.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png","streets_asphalt.png^streets_asphalt_side_r.png"},           "Asphalt with solid outer line (right)",                "asphalt", nil) -	register_stair_slab_panel_micro("streets", "asphalt_outer_edge",   "streets:asphalt_outer_edge",   {cracky=3}, {"streets_asphalt.png^streets_asphalt_outer_edge.png","streets_asphalt.png"},                                                                                                                          "Asphalt with solid outer line (corner/edge)",          "asphalt", nil) -	register_stair_slab_panel_micro("streets", "asphalt_outer_edge_r", "streets:asphalt_outer_edge_r", {cracky=3}, {"streets_asphalt.png^(streets_asphalt_outer_edge.png^[transformR270)","streets_asphalt.png"},                                                                                                         "Asphalt with solid outer line (corner/edge, rotated)", "asphalt", nil) +	stairsplus:register_all( +		"streets", +		"asphalt", +		"streets:asphalt", +		{ +			groups = {not_in_creative_inventory=1, cracky=3}, +			tiles = {"streets_asphalt.png"}, +			description = "Asphalt" +		} +	) -	table.insert(circular_saw.known_stairs,"streets:asphalt") -	table.insert(circular_saw.known_stairs,"streets:asphalt_solid_line") -	table.insert(circular_saw.known_stairs,"streets:asphalt_dashed_line") -	table.insert(circular_saw.known_stairs,"streets:asphalt_side") -	table.insert(circular_saw.known_stairs,"streets:asphalt_side_r") -	table.insert(circular_saw.known_stairs,"streets:asphalt_outer_edge") -	table.insert(circular_saw.known_stairs,"streets:asphalt_outer_edge_r") +	stairsplus:register_all( +		"streets", +		"asphalt_solid_line", +		"streets:asphalt_solid_line", +		{ +			groups = {not_in_creative_inventory=1, cracky=3}, +			tiles = { +				"streets_asphalt.png^streets_asphalt_solid_line.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png^streets_asphalt_solid_line.png" +			}, +			description = "Asphalt with solid centerline" +		} +	) + +	stairsplus:register_all( +		"streets", +		"asphalt_dashed_line", +		"streets:asphalt_dashed_line", +		{ +			groups = {not_in_creative_inventory=1, cracky=3}, +			tiles = { +				"streets_asphalt.png^streets_asphalt_dashed_line.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png^streets_asphalt_dashed_line.png" +			}, +			description = "Asphalt with dashed centerline" +		} +	) + +	stairsplus:register_all( +		"streets", +		"asphalt_side", +		"streets:asphalt_sideline", +		{ +			groups = {not_in_creative_inventory=1, cracky=3}, +			tiles = { +				"streets_asphalt.png^streets_asphalt_side.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png^streets_asphalt_side.png" +			}, +			description = "Asphalt with solid outer line (left)" +		} +	) + +	stairsplus:register_all( +		"streets", +		"asphalt_side_r", +		"streets:asphalt_side_r", +		{ +			groups = {not_in_creative_inventory=1, cracky=3}, +			tiles = { +				"streets_asphalt.png^streets_asphalt_side_r.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png", +				"streets_asphalt.png^streets_asphalt_side_r.png" +			}, +			description = "Asphalt with solid outer line (right)" +		} +	) + +	stairsplus:register_all( +		"streets", +		"asphalt_outer_edge", +		"streets:asphalt_outer_edge", +		{ +			groups = {not_in_creative_inventory=1, cracky=3}, +			tiles = { +				"streets_asphalt.png^streets_asphalt_outer_edge.png", +				"streets_asphalt.png" +			}, +			description = "Asphalt with solid outer line (corner/edge)", +		} +	) + +	stairsplus:register_all( +		"streets", +		"asphalt_outer_edge_r", +		"streets:asphalt_outer_edge_r", +		{ +			groups = {not_in_creative_inventory=1, cracky=3}, +			tiles = { +				"streets_asphalt.png^(streets_asphalt_outer_edge.png^[transformR270)", +				"streets_asphalt.png" +			}, +			description = "Asphalt with solid outer line (corner/edge, rotated)" +		} +	) diff --git a/concretestairs/init.lua b/concretestairs/init.lua index 0a030be..09bbdb7 100644 --- a/concretestairs/init.lua +++ b/concretestairs/init.lua @@ -1,10 +1,17 @@  --[[  	StreetsMod: Concrete stairs (compatible to circular saw)  ]] -if rawget(_G, "register_stair_slab_panel_micro") -and type(register_stair_slab_panel_micro) == "function" then -	register_stair_slab_panel_micro("streets", "concrete", "basic_materials:concrete_block", {cracky=2}, {"basic_materials_concrete_block.png"}, "Concrete", "concrete", nil) -	table.insert(circular_saw.known_stairs,"basic_materials:concrete_block") +if minetest.get_modpath("moreblocks") then +	stairsplus:register_all( +		"streets", +		"concrete", +		"basic_materials:concrete_block", +		{ +			groups = {not_in_creative_inventory=1, cracky=2}, +			tiles = {"basic_materials_concrete_block.png"}, +			description = "Concrete" +		} +	)  	minetest.register_alias("stairs:stair_concrete","streets:stair_concrete")  else  	minetest.register_alias("stairs:stair_concrete","prefab:concrete_stair") diff --git a/infrastructure/nodes_extension.lua b/infrastructure/nodes_extension.lua index 8eebdba..efa802d 100644 --- a/infrastructure/nodes_extension.lua +++ b/infrastructure/nodes_extension.lua @@ -1,19 +1,27 @@  -- **************************************************************************************************** MATERIALS  -- Galvanized steel stair, slab, panel and microblock -	register_stair_slab_panel_micro("infrastructure", "galvanized_steel", "infrastructure:galvanized_steel", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=2}, -			{"infrastructure_galvanized_steel.png"}, -			"Galvanized steel", -			"galvanized_steel", -			0) +	stairsplus:register_all( +		"infrastructure", +		"galvanized_steel", +		"infrastructure:galvanized_steel", +		{ +			groups = {not_in_creative_inventory=1, cracky=2}, +			tiles = { "infrastructure_galvanized_steel.png" }, +			description = "Galvanized steel", +		} +	)  -- **************************************************************************************************** CENTER LINES  -- Asphalt stair, slab, panel and microblock with center solid line -	register_stair_slab_panel_micro("infrastructure", "asphalt_center_solid_line", "infrastructure:asphalt_center_solid_line", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{ +	stairsplus:register_all( +		"infrastructure", +		"asphalt_center_solid_line", +		"infrastructure:asphalt_center_solid_line", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = {  				"streets_asphalt.png^infrastructure_single_yellow_line.png",  				"streets_asphalt.png",  				"streets_asphalt.png", @@ -21,14 +29,18 @@  				"streets_asphalt.png",  				"streets_asphalt.png"  			}, -			"Asphalt with center solid line", -			"asphalt_center_solid_line", -			0) +			description = "Asphalt with center solid line", +		} +	)  -- Asphalt stair, slab, panel and microblock with center solid line on one side -	register_stair_slab_panel_micro("infrastructure", "asphalt_center_solid_one_side", "infrastructure:asphalt_center_solid_one_side", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{ +	stairsplus:register_all( +		"infrastructure", +		"asphalt_center_solid_one_side", +		"infrastructure:asphalt_center_solid_one_side", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = {  				"streets_asphalt.png^infrastructure_solid_yellow_line_one_side.png",  				"streets_asphalt.png",  				"streets_asphalt.png", @@ -36,14 +48,18 @@  				"streets_asphalt.png",  				"streets_asphalt.png"  			}, -			"Asphalt with center solid line on one side", -			"asphalt_center_solid_one_side", -			0) +			description = "Asphalt with center solid line on one side", +		} +	)  -- Asphalt stair, slab, panel and microblock with center solid double line -	register_stair_slab_panel_micro("infrastructure", "asphalt_center_solid_double", "infrastructure:asphalt_center_solid_double", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{ +	stairsplus:register_all( +		"infrastructure", +		"asphalt_center_solid_double", +		"infrastructure:asphalt_center_solid_double", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = {  				"streets_asphalt.png^infrastructure_double_yellow_line.png",  				"streets_asphalt.png",  				"streets_asphalt.png", @@ -51,14 +67,18 @@  				"streets_asphalt.png",  				"streets_asphalt.png"  			}, -			"Asphalt with center solid double line", -			"asphalt_center_solid_double", -			0) +			description = "Asphalt with center solid double line", +		} +	)  -- Asphalt block with center corner single line -	register_stair_slab_panel_micro("infrastructure", "asphalt_center_corner_single", "infrastructure:asphalt_center_corner_single", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{ +	stairsplus:register_all( +		"infrastructure", +		"asphalt_center_corner_single", +		"infrastructure:asphalt_center_corner_single", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = {  				"streets_asphalt.png^infrastructure_single_yellow_line_corner.png",  				"streets_asphalt.png",  				"streets_asphalt.png", @@ -66,14 +86,18 @@  				"streets_asphalt.png",  				"streets_asphalt.png"  			}, -			"Asphalt with center corner single line", -			"asphalt_center_corner_single", -			0) +			description = "Asphalt with center corner single line", +		} +	)  -- Asphalt block with center corner double line -	register_stair_slab_panel_micro("infrastructure", "asphalt_center_corner_double", "infrastructure:asphalt_center_corner_double", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{ +	stairsplus:register_all( +		"infrastructure", +		"asphalt_center_corner_double", +		"infrastructure:asphalt_center_corner_double", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = {  				"streets_asphalt.png^infrastructure_solid_double_yellow_line_corner.png",  				"streets_asphalt.png",  				"streets_asphalt.png", @@ -81,82 +105,98 @@  				"streets_asphalt.png",  				"streets_asphalt.png"  			}, -			"Asphalt with center corner double line", -			"asphalt_center_corner_double", -			0) +			description = "Asphalt with center corner double line", +		} +	)  -- **************************************************************************************************** TRAFFIC MARKS  -- Asphalt stair, slab, panel and microblock with arrow straight -	register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_straight", "infrastructure:asphalt_arrow_straight", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{"streets_arrow_straight.png", "infrastructure_asphalt.png"}, -			"Asphalt with arrow straight", -			"asphalt_arrow_straight", -			0) +	stairsplus:register_all( +		"infrastructure", +		"asphalt_arrow_straight", +		"infrastructure:asphalt_arrow_straight", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = { +				"streets_arrow_straight.png", +				"infrastructure_asphalt.png" +			}, +			description = "Asphalt with arrow straight", +		} +	)  -- Asphalt stair, slab, panel and microblock with arrow straight + left -	register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_straight_left", "infrastructure:asphalt_arrow_straight_left", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{"streets_asphalt.png^streets_arrow_straight_left.png", "infrastructure_asphalt.png"}, -			"Asphalt with arrow straight + left", -			"asphalt_arrow_straight_left", -			0) +	stairsplus:register_all( +		"infrastructure", +		"asphalt_arrow_straight_left", +		"infrastructure:asphalt_arrow_straight_left", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = { +				"streets_asphalt.png^streets_arrow_straight_left.png", +				"infrastructure_asphalt.png" +			}, +			description = "Asphalt with arrow straight + left", +		} +	)  -- Asphalt stair, slab, panel and microblock with arrow straight + right -	register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_straight_right", "infrastructure:asphalt_arrow_straight_right", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{"streets_asphalt.png^streets_arrow_straight_right.png", "infrastructure_asphalt.png"}, -			"Asphalt with arrow straight + right", -			"asphalt_arrow_straight_right", -			0) +	stairsplus:register_all( +		"infrastructure", +		"asphalt_arrow_straight_right", +		"infrastructure:asphalt_arrow_straight_right", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = { +				"streets_asphalt.png^streets_arrow_straight_right.png", +				"infrastructure_asphalt.png" +			}, +			description = "Asphalt with arrow straight + right", +		} +	)  -- Asphalt stair, slab, panel and microblock with arrow left -	register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_left", "infrastructure:asphalt_arrow_left", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{"streets_asphalt.png^streets_arrow_left.png", "infrastructure_asphalt.png"}, -			"Asphalt with arrow left", -			"asphalt_arrow_left", -			0) +	stairsplus:register_all( +		"infrastructure", +		"asphalt_arrow_left", +		"infrastructure:asphalt_arrow_left", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = { +				"streets_asphalt.png^streets_arrow_left.png", +				"infrastructure_asphalt.png" +			}, +			description = "Asphalt with arrow left", +		} +	)  -- Asphalt stair, slab, panel and microblock with arrow right -	register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_right", "infrastructure:asphalt_arrow_right", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{"streets_asphalt.png^streets_arrow_right.png", "infrastructure_asphalt.png"}, -			"Asphalt with arrow right", -			"asphalt_arrow_right", -			0) +	stairsplus:register_all( +		"infrastructure", +		"asphalt_arrow_right", +		"infrastructure:asphalt_arrow_right", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = { +				"streets_asphalt.png^streets_arrow_right.png", +				"infrastructure_asphalt.png" +			}, +			description = "Asphalt with arrow right", +		} +	)  -- Asphalt stair, slab, panel and microblock with "P"-sign -	register_stair_slab_panel_micro("infrastructure", "asphalt_parking", "infrastructure:asphalt_parking", -			{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, -			{"streets_asphalt.png^streets_parking.png", "infrastructure_asphalt.png"}, -			"Asphalt with a parking sign", -			"asphalt_parking", -			0) - --- Register known infrastructure nodes in circular saw if avaiable -	if circular_saw then -		for i,v in ipairs({ --- Materials -			"asphalt", -			"concrete", -			"galvanized_steel", --- Center lines -			"asphalt_center_dashed", -			"asphalt_center_solid", -			"asphalt_center_solid_one_side", -			"asphalt_center_solid_double", -			"asphalt_center_corner_single", -			"asphalt_center_corner_double", --- Traffic marks -			"asphalt_arrow_straight", -			"asphalt_arrow_straight_left", -			"asphalt_arrow_straight_right", -			"asphalt_arrow_left", -			"asphalt_arrow_right", -			"asphalt_parking" -		}) do -			table.insert(circular_saw.known_stairs, "infrastructure:"..v); -		end -	end +	stairsplus:register_all( +		"infrastructure", +		"asphalt_parking", +		"infrastructure:asphalt_parking", +		{ +			groups = {not_in_creative_inventory=1, cracky=1}, +			tiles = { +				"streets_asphalt.png^streets_parking.png", +				"infrastructure_asphalt.png" +			}, +			description = "Asphalt with a parking sign", +		} +	) | 
