moreblocks no longer exports register_stair_slab_panel_micro

use stairsplus:register_all instead

also fixed a few places to detect moreblocks more appropriately
master
Vanessa Dannenberg 2019-03-11 09:39:20 -04:00
parent 1255328730
commit c2374dc16c
3 changed files with 259 additions and 118 deletions

View File

@ -1,8 +1,7 @@
--[[ --[[
StreetsMod: Asphalt stairs StreetsMod: Asphalt stairs
]] ]]
if not rawget(_G, "register_stair_slab_panel_micro") if not minetest.get_modpath("moreblocks") then return end
or type(register_stair_slab_panel_micro) ~= "function" then return end
-- Asphalt solid line -- Asphalt solid line
-- Stair -- 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_stair","stairs:stair_asphalt")
minetest.register_alias("streets:asphalt_slab","stairs:slab_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) stairsplus:register_all(
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) "streets",
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) "asphalt",
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) "streets:asphalt",
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) groups = {not_in_creative_inventory=1, cracky=3},
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) tiles = {"streets_asphalt.png"},
description = "Asphalt"
}
)
table.insert(circular_saw.known_stairs,"streets:asphalt") stairsplus:register_all(
table.insert(circular_saw.known_stairs,"streets:asphalt_solid_line") "streets",
table.insert(circular_saw.known_stairs,"streets:asphalt_dashed_line") "asphalt_solid_line",
table.insert(circular_saw.known_stairs,"streets:asphalt_side") "streets:asphalt_solid_line",
table.insert(circular_saw.known_stairs,"streets:asphalt_side_r") {
table.insert(circular_saw.known_stairs,"streets:asphalt_outer_edge") groups = {not_in_creative_inventory=1, cracky=3},
table.insert(circular_saw.known_stairs,"streets:asphalt_outer_edge_r") 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)"
}
)

View File

@ -1,10 +1,17 @@
--[[ --[[
StreetsMod: Concrete stairs (compatible to circular saw) StreetsMod: Concrete stairs (compatible to circular saw)
]] ]]
if rawget(_G, "register_stair_slab_panel_micro") if minetest.get_modpath("moreblocks") then
and type(register_stair_slab_panel_micro) == "function" then stairsplus:register_all(
register_stair_slab_panel_micro("streets", "concrete", "basic_materials:concrete_block", {cracky=2}, {"basic_materials_concrete_block.png"}, "Concrete", "concrete", nil) "streets",
table.insert(circular_saw.known_stairs,"basic_materials:concrete_block") "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") minetest.register_alias("stairs:stair_concrete","streets:stair_concrete")
else else
minetest.register_alias("stairs:stair_concrete","prefab:concrete_stair") minetest.register_alias("stairs:stair_concrete","prefab:concrete_stair")

View File

@ -1,19 +1,27 @@
-- **************************************************************************************************** MATERIALS -- **************************************************************************************************** MATERIALS
-- Galvanized steel stair, slab, panel and microblock -- Galvanized steel stair, slab, panel and microblock
register_stair_slab_panel_micro("infrastructure", "galvanized_steel", "infrastructure:galvanized_steel", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=2}, "infrastructure",
{"infrastructure_galvanized_steel.png"}, "galvanized_steel",
"Galvanized steel", "infrastructure:galvanized_steel",
"galvanized_steel", {
0) groups = {not_in_creative_inventory=1, cracky=2},
tiles = { "infrastructure_galvanized_steel.png" },
description = "Galvanized steel",
}
)
-- **************************************************************************************************** CENTER LINES -- **************************************************************************************************** CENTER LINES
-- Asphalt stair, slab, panel and microblock with center solid line -- 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", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "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^infrastructure_single_yellow_line.png",
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png", "streets_asphalt.png",
@ -21,14 +29,18 @@
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png" "streets_asphalt.png"
}, },
"Asphalt with center solid line", description = "Asphalt with center solid line",
"asphalt_center_solid_line", }
0) )
-- Asphalt stair, slab, panel and microblock with center solid line on one side -- 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", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "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^infrastructure_solid_yellow_line_one_side.png",
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png", "streets_asphalt.png",
@ -36,14 +48,18 @@
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png" "streets_asphalt.png"
}, },
"Asphalt with center solid line on one side", description = "Asphalt with center solid line on one side",
"asphalt_center_solid_one_side", }
0) )
-- Asphalt stair, slab, panel and microblock with center solid double line -- 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", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "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^infrastructure_double_yellow_line.png",
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png", "streets_asphalt.png",
@ -51,14 +67,18 @@
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png" "streets_asphalt.png"
}, },
"Asphalt with center solid double line", description = "Asphalt with center solid double line",
"asphalt_center_solid_double", }
0) )
-- Asphalt block with center corner single line -- Asphalt block with center corner single line
register_stair_slab_panel_micro("infrastructure", "asphalt_center_corner_single", "infrastructure:asphalt_center_corner_single", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "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^infrastructure_single_yellow_line_corner.png",
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png", "streets_asphalt.png",
@ -66,14 +86,18 @@
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png" "streets_asphalt.png"
}, },
"Asphalt with center corner single line", description = "Asphalt with center corner single line",
"asphalt_center_corner_single", }
0) )
-- Asphalt block with center corner double line -- Asphalt block with center corner double line
register_stair_slab_panel_micro("infrastructure", "asphalt_center_corner_double", "infrastructure:asphalt_center_corner_double", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "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^infrastructure_solid_double_yellow_line_corner.png",
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png", "streets_asphalt.png",
@ -81,82 +105,98 @@
"streets_asphalt.png", "streets_asphalt.png",
"streets_asphalt.png" "streets_asphalt.png"
}, },
"Asphalt with center corner double line", description = "Asphalt with center corner double line",
"asphalt_center_corner_double", }
0) )
-- **************************************************************************************************** TRAFFIC MARKS -- **************************************************************************************************** TRAFFIC MARKS
-- Asphalt stair, slab, panel and microblock with arrow straight -- Asphalt stair, slab, panel and microblock with arrow straight
register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_straight", "infrastructure:asphalt_arrow_straight", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "infrastructure",
{"streets_arrow_straight.png", "infrastructure_asphalt.png"}, "asphalt_arrow_straight",
"Asphalt with arrow straight", "infrastructure:asphalt_arrow_straight",
"asphalt_arrow_straight", {
0) 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 -- 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", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "infrastructure",
{"streets_asphalt.png^streets_arrow_straight_left.png", "infrastructure_asphalt.png"}, "asphalt_arrow_straight_left",
"Asphalt with arrow straight + left", "infrastructure:asphalt_arrow_straight_left",
"asphalt_arrow_straight_left", {
0) 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 -- 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", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "infrastructure",
{"streets_asphalt.png^streets_arrow_straight_right.png", "infrastructure_asphalt.png"}, "asphalt_arrow_straight_right",
"Asphalt with arrow straight + right", "infrastructure:asphalt_arrow_straight_right",
"asphalt_arrow_straight_right", {
0) 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 -- Asphalt stair, slab, panel and microblock with arrow left
register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_left", "infrastructure:asphalt_arrow_left", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "infrastructure",
{"streets_asphalt.png^streets_arrow_left.png", "infrastructure_asphalt.png"}, "asphalt_arrow_left",
"Asphalt with arrow left", "infrastructure:asphalt_arrow_left",
"asphalt_arrow_left", {
0) 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 -- Asphalt stair, slab, panel and microblock with arrow right
register_stair_slab_panel_micro("infrastructure", "asphalt_arrow_right", "infrastructure:asphalt_arrow_right", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "infrastructure",
{"streets_asphalt.png^streets_arrow_right.png", "infrastructure_asphalt.png"}, "asphalt_arrow_right",
"Asphalt with arrow right", "infrastructure:asphalt_arrow_right",
"asphalt_arrow_right", {
0) 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 -- Asphalt stair, slab, panel and microblock with "P"-sign
register_stair_slab_panel_micro("infrastructure", "asphalt_parking", "infrastructure:asphalt_parking", stairsplus:register_all(
{not_in_creative_inventory=NOT_IN_CREATIVE_INVENTORY, cracky=1}, "infrastructure",
{"streets_asphalt.png^streets_parking.png", "infrastructure_asphalt.png"}, "asphalt_parking",
"Asphalt with a parking sign", "infrastructure:asphalt_parking",
"asphalt_parking", {
0) groups = {not_in_creative_inventory=1, cracky=1},
tiles = {
-- Register known infrastructure nodes in circular saw if avaiable "streets_asphalt.png^streets_parking.png",
if circular_saw then "infrastructure_asphalt.png"
for i,v in ipairs({ },
-- Materials description = "Asphalt with a parking sign",
"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