aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalinou <calinou@opmbx.org>2014-10-29 21:06:30 +0100
committerCalinou <calinou@opmbx.org>2014-10-29 21:06:30 +0100
commited5d0398bbab72cd103ec730f899838771d8a9b5 (patch)
tree80001ad00d4ff0b47cd266a014d47ee54811ec4a
parent851a6db870f9ee4a2e644c3cc1ee9cf7d5f63776 (diff)
downloadmoreblocks-ed5d0398bbab72cd103ec730f899838771d8a9b5.tar.gz
moreblocks-ed5d0398bbab72cd103ec730f899838771d8a9b5.tar.bz2
moreblocks-ed5d0398bbab72cd103ec730f899838771d8a9b5.zip
Add inner, outer, outer-cut slopes and their half and half-raised variations, with crafting recipes for them. Code cleanup is ongoing.
-rw-r--r--stairsplus/slopes.lua365
1 files changed, 349 insertions, 16 deletions
diff --git a/stairsplus/slopes.lua b/stairsplus/slopes.lua
index f38a7ad..8017bdf 100644
--- a/stairsplus/slopes.lua
+++ b/stairsplus/slopes.lua
@@ -18,20 +18,93 @@ local box_slope = {
local box_slope_half = {
type = "fixed",
fixed = {
- {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5}, -- NodeBox1
- {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5}, -- NodeBox2
- {-0.5, -0.25, 0, 0.5, -0.125, 0.5}, -- NodeBox3
- {-0.5, -0.125, 0.25, 0.5, 0, 0.5}, -- NodeBox4
+ {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
+ {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5},
+ {-0.5, -0.25, 0, 0.5, -0.125, 0.5},
+ {-0.5, -0.125, 0.25, 0.5, 0, 0.5},
}
}
local box_slope_half_raised = {
type = "fixed",
fixed = {
- {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5}, -- NodeBox1
- {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5}, -- NodeBox2
- {-0.5, 0.25, 0, 0.5, 0.375, 0.5}, -- NodeBox3
- {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5}, -- NodeBox4
+ {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
+ {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5},
+ {-0.5, 0.25, 0, 0.5, 0.375, 0.5},
+ {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5},
+ }
+}
+
+--==============================================================
+
+local box_slope_inner = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
+ {-0.5, -0.5, -0.25, 0.5, 0, 0.5},
+ {-0.5, -0.5, -0.5, 0.25, 0, 0.5},
+ {-0.5, 0, -0.5, 0, 0.25, 0.5},
+ {-0.5, 0, 0, 0.5, 0.25, 0.5},
+ {-0.5, 0.25, 0.25, 0.5, 0.5, 0.5},
+ {-0.5, 0.25, -0.5, -0.25, 0.5, 0.5},
+ }
+}
+
+local box_slope_inner_half = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
+ {-0.5, -0.375, -0.25, 0.5, -0.25, 0.5},
+ {-0.5, -0.375, -0.5, 0.25, -0.25, 0.5},
+ {-0.5, -0.25, -0.5, 0, -0.125, 0.5},
+ {-0.5, -0.25, 0, 0.5, -0.125, 0.5},
+ {-0.5, -0.125, 0.25, 0.5, 0, 0.5},
+ {-0.5, -0.125, -0.5, -0.25, 0, 0.5},
+ }
+}
+
+local box_slope_inner_half_raised = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
+ {-0.5, 0.125, -0.25, 0.5, 0.25, 0.5},
+ {-0.5, 0.125, -0.5, 0.25, 0.25, 0.5},
+ {-0.5, 0.25, -0.5, 0, 0.375, 0.5},
+ {-0.5, 0.25, 0, 0.5, 0.375, 0.5},
+ {-0.5, 0.375, 0.25, 0.5, 0.5, 0.5},
+ {-0.5, 0.375, -0.5, -0.25, 0.5, 0.5},
+ }
+}
+
+--==============================================================
+
+local box_slope_outer = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
+ {-0.5, -0.25, -0.25, 0.25, 0, 0.5},
+ {-0.5, 0, 0, 0, 0.25, 0.5},
+ {-0.5, 0.25, 0.25, -0.25, 0.5, 0.5}
+ }
+}
+
+local box_slope_outer_half = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
+ {-0.5, -0.375, -0.25, 0.25, -0.25, 0.5},
+ {-0.5, -0.25, 0, 0, -0.125, 0.5},
+ {-0.5, -0.125, 0.25, -0.25, 0, 0.5}
+ }
+}
+
+local box_slope_outer_half_raised = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, 0.125, 0.5},
+ {-0.5, 0.125, -0.25, 0.25, 0.25, 0.5},
+ {-0.5, 0.25, 0, 0, 0.375, 0.5},
+ {-0.5, 0.375, 0.25, -0.25, 0.5, 0.5}
}
}
@@ -66,6 +139,60 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
collision_box = box_slope_half_raised,
selection_box = box_slope_half_raised,
},
+
+--==============================================================
+
+ ["_inner"] = {
+ mesh = "moreblocks_slope_inner.obj",
+ collision_box = box_slope_inner,
+ selection_box = box_slope_inner,
+ },
+ ["_inner_half"] = {
+ mesh = "moreblocks_slope_inner_half.obj",
+ collision_box = box_slope_inner_half,
+ selection_box = box_slope_inner_half,
+ },
+ ["_inner_half_raised"] = {
+ mesh = "moreblocks_slope_inner_half_raised.obj",
+ collision_box = box_slope_inner_half_raised,
+ selection_box = box_slope_inner_half_raised,
+ },
+
+--==============================================================
+
+ ["_outer"] = {
+ mesh = "moreblocks_slope_outer.obj",
+ collision_box = box_slope_outer,
+ selection_box = box_slope_outer,
+ },
+ ["_outer_half"] = {
+ mesh = "moreblocks_slope_outer_half.obj",
+ collision_box = box_slope_outer_half,
+ selection_box = box_slope_outer_half,
+ },
+ ["_outer_half_raised"] = {
+ mesh = "moreblocks_slope_outer_half_raised.obj",
+ collision_box = box_slope_outer_half_raised,
+ selection_box = box_slope_outer_half_raised,
+ },
+
+--==============================================================
+
+ ["_outer_cut"] = {
+ mesh = "moreblocks_slope_outer_cut.obj",
+ collision_box = box_slope_outer,
+ selection_box = box_slope_outer,
+ },
+ ["_outer_cut_half"] = {
+ mesh = "moreblocks_slope_outer_cut_half.obj",
+ collision_box = box_slope_outer_half,
+ selection_box = box_slope_outer_half,
+ },
+ ["_outer_cut_half_raised"] = {
+ mesh = "moreblocks_slope_outer_cut_half_raised.obj",
+ collision_box = box_slope_outer_half_raised,
+ selection_box = box_slope_outer_half_raised,
+ },
}
local desc = S("%s Slope"):format(fields.description)
@@ -87,20 +214,226 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
-- Some saw-less recipes:
minetest.register_craft({
- output = modname .. ":slope_" .. subname .. " 10",
+ output = modname .. ":slope_" .. subname .. " 7",
+ recipe = {
+ {modname .. ":panel_" .. subname, "", ""},
+ {recipeitem, modname .. ":panel_" .. subname, ""},
+ {recipeitem, recipeitem, modname .. ":panel_" .. subname},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. " 7",
+ recipe = {
+ {"", "", modname .. ":panel_" .. subname},
+ {"", modname .. ":panel_" .. subname, recipeitem},
+ {modname .. ":panel_" .. subname, recipeitem, recipeitem},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_half 10",
+ recipe = {
+ {modname .. ":panel_" .. subname, "", ""},
+ {recipeitem, recipeitem, modname .. ":panel_" .. subname},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_half 10",
+ recipe = {
+ {"", "", modname .. ":panel_" .. subname},
+ {modname .. ":panel_" .. subname, recipeitem, recipeitem},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_half_raised 7",
+ recipe = {
+ {modname .. ":panel_" .. subname, "", ""},
+ {recipeitem, recipeitem, modname .. ":panel_" .. subname},
+ {recipeitem, recipeitem, recipeitem},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_half_raised 7",
+ recipe = {
+ {"", "", modname .. ":panel_" .. subname},
+ {modname .. ":panel_" .. subname, recipeitem, recipeitem},
+ {recipeitem, recipeitem, recipeitem},
+ },
+ })
+
+--===================================================== Inner ==
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_inner 7",
+ recipe = {
+ {modname .. ":stair_" .. subname .. "_half", "", ""},
+ {recipeitem, modname .. ":stair_" .. subname .. "_half", ""},
+ {recipeitem, recipeitem, modname .. ":stair_" .. subname .. "_half"},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_inner 7",
+ recipe = {
+ {"", "", modname .. ":stair_" .. subname .. "_half"},
+ {"", modname .. ":stair_" .. subname .. "_half", recipeitem},
+ {modname .. ":stair_" .. subname .. "_half", recipeitem, recipeitem},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_inner_half 10",
recipe = {
- {modname .. ":stair_" .. subname, "", ""},
- {recipeitem, modname .. ":stair_" .. subname, ""},
- {recipeitem, recipeitem, modname .. ":stair_" .. subname},
+ {modname .. ":stair_" .. subname .. "_half", "", ""},
+ {recipeitem, recipeitem, modname .. ":stair_" .. subname .. "_half"},
},
})
minetest.register_craft({
- output = modname .. ":slope_" .. subname .. " 10",
+ output = modname .. ":slope_" .. subname .. "_inner_half 10",
+ recipe = {
+ {"", "", modname .. ":stair_" .. subname .. "_half"},
+ {modname .. ":stair_" .. subname .. "_half", recipeitem, recipeitem},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_inner_half_raised 7",
recipe = {
- {"", "", modname .. ":stair_" .. subname},
- {"", modname .. ":stair_" .. subname, recipeitem},
- {modname .. ":stair_" .. subname, recipeitem, recipeitem},
+ {modname .. ":stair_" .. subname .. "_half", "", ""},
+ {recipeitem, recipeitem, modname .. ":stair_" .. subname .. "_half"},
+ {recipeitem, recipeitem, recipeitem},
},
})
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_inner_half_raised 7",
+ recipe = {
+ {"", "", modname .. ":stair_" .. subname .. "_half"},
+ {modname .. ":stair_" .. subname .. "_half", recipeitem, recipeitem},
+ {recipeitem, recipeitem, recipeitem},
+ },
+ })
+
+--===================================================== Outer ==
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_outer 7",
+ recipe = {
+ {modname .. ":micro_" .. subname, "", ""},
+ {recipeitem, modname .. ":micro_" .. subname, ""},
+ {recipeitem, recipeitem, modname .. ":micro_" .. subname},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_outer 7",
+ recipe = {
+ {"", "", modname .. ":micro_" .. subname},
+ {"", modname .. ":micro_" .. subname, recipeitem},
+ {modname .. ":micro_" .. subname, recipeitem, recipeitem},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_outer_half 10",
+ recipe = {
+ {modname .. ":micro_" .. subname, "", ""},
+ {recipeitem, recipeitem, modname .. ":micro_" .. subname},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_outer_half 10",
+ recipe = {
+ {"", "", modname .. ":micro_" .. subname},
+ {modname .. ":micro_" .. subname, recipeitem, recipeitem},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_outer_half_raised 7",
+ recipe = {
+ {modname .. ":micro_" .. subname, "", ""},
+ {recipeitem, recipeitem, modname .. ":micro_" .. subname},
+ {recipeitem, recipeitem, recipeitem},
+ },
+ })
+
+ minetest.register_craft({
+ output = modname .. ":slope_" .. subname .. "_outer_half_raised 7",
+ recipe = {
+ {"", "", modname .. ":micro_" .. subname},
+ {modname .. ":micro_" .. subname, recipeitem, recipeitem},
+ {recipeitem, recipeitem, recipeitem},
+ },
+ })
+
+--================================================= Shapeless ==
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = recipeitem,
+ recipe = {modname .. ":slope_" .. subname, modname .. ":slope_" .. subname},
+ })
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = recipeitem,
+ recipe = {modname .. ":slope_" .. subname .. "_outer_cut", modname .. ":slope_" .. subname .. "_outer_cut"},
+ })
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = recipeitem,
+ recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half_raised"},
+ })
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = recipeitem,
+ recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
+ modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
+ })
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = modname .. ":slab_" .. subname,
+ recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half"},
+ })
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = modname .. ":slope_" .. subname .. "_half_raised",
+ recipe = {modname .. ":slope_" .. subname .. "_half", modname .. ":slope_" .. subname .. "_half",
+ modname .. ":slope_" .. subname .. "_half"},
+ })
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = modname .. ":slope_" .. subname .. "_half_raised",
+ recipe = {modname .. ":slab_" .. subname, modname .. ":slope_" .. subname .. "_half"},
+ })
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = modname .. ":slope_" .. subname .. "_outer_cut",
+ recipe = {modname .. ":slope_" .. subname .. "_outer"},
+ })
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = modname .. ":slope_" .. subname .. "_outer_cut_half",
+ recipe = {modname .. ":slope_" .. subname .. "_outer_half"},
+ })
+
+ minetest.register_craft({
+ type = "shapeless",
+ output = modname .. ":slope_" .. subname .. "_outer_cut_half_raised",
+ recipe = {modname .. ":slope_" .. subname .. "_outer_half_raised"},
+ })
end