forked from minetest-mods/moreblocks
add a few new shapes to the table saw: (#67)
* 1/16 slab, L-shaped (two sides) * 1/16 slab, corner-shaped (three sides) * 1/16 slab, U-shaped (three sides)
This commit is contained in:
parent
6f033c1695
commit
0569ff9683
@ -26,9 +26,9 @@ circular_saw.cost_in_microblocks = {
|
|||||||
1, 1, 1, 1, 1, 1, 1, 2,
|
1, 1, 1, 1, 1, 1, 1, 2,
|
||||||
2, 3, 2, 4, 2, 4, 5, 6,
|
2, 3, 2, 4, 2, 4, 5, 6,
|
||||||
7, 1, 1, 2, 4, 6, 7, 8,
|
7, 1, 1, 2, 4, 6, 7, 8,
|
||||||
3, 1, 1, 2, 4, 4, 2, 6,
|
1, 2, 2, 3, 1, 1, 2, 4,
|
||||||
7, 3, 7, 7, 4, 8, 3, 2,
|
4, 2, 6, 7, 3, 7, 7, 4,
|
||||||
6, 2, 1, 3, 4,
|
8, 3, 2, 6, 2, 1, 3, 4
|
||||||
}
|
}
|
||||||
|
|
||||||
circular_saw.names = {
|
circular_saw.names = {
|
||||||
@ -40,6 +40,7 @@ circular_saw.names = {
|
|||||||
{"panel", "_4"},
|
{"panel", "_4"},
|
||||||
{"micro", ""},
|
{"micro", ""},
|
||||||
{"panel", ""},
|
{"panel", ""},
|
||||||
|
|
||||||
{"micro", "_12"},
|
{"micro", "_12"},
|
||||||
{"panel", "_12"},
|
{"panel", "_12"},
|
||||||
{"micro", "_14"},
|
{"micro", "_14"},
|
||||||
@ -48,6 +49,7 @@ circular_saw.names = {
|
|||||||
{"panel", "_15"},
|
{"panel", "_15"},
|
||||||
{"stair", "_outer"},
|
{"stair", "_outer"},
|
||||||
{"stair", ""},
|
{"stair", ""},
|
||||||
|
|
||||||
{"stair", "_inner"},
|
{"stair", "_inner"},
|
||||||
{"slab", "_1"},
|
{"slab", "_1"},
|
||||||
{"slab", "_2"},
|
{"slab", "_2"},
|
||||||
@ -56,11 +58,16 @@ circular_saw.names = {
|
|||||||
{"slab", "_three_quarter"},
|
{"slab", "_three_quarter"},
|
||||||
{"slab", "_14"},
|
{"slab", "_14"},
|
||||||
{"slab", "_15"},
|
{"slab", "_15"},
|
||||||
|
|
||||||
|
{"slab", "_two_sides"},
|
||||||
|
{"slab", "_three_sides"},
|
||||||
|
{"slab", "_three_sides_u"},
|
||||||
{"stair", "_half"},
|
{"stair", "_half"},
|
||||||
{"stair", "_alt_1"},
|
{"stair", "_alt_1"},
|
||||||
{"stair", "_alt_2"},
|
{"stair", "_alt_2"},
|
||||||
{"stair", "_alt_4"},
|
{"stair", "_alt_4"},
|
||||||
{"stair", "_alt"},
|
{"stair", "_alt"},
|
||||||
|
|
||||||
{"slope", ""},
|
{"slope", ""},
|
||||||
{"slope", "_half"},
|
{"slope", "_half"},
|
||||||
{"slope", "_half_raised"},
|
{"slope", "_half_raised"},
|
||||||
@ -69,6 +76,7 @@ circular_saw.names = {
|
|||||||
{"slope", "_inner_half_raised"},
|
{"slope", "_inner_half_raised"},
|
||||||
{"slope", "_inner_cut"},
|
{"slope", "_inner_cut"},
|
||||||
{"slope", "_inner_cut_half"},
|
{"slope", "_inner_cut_half"},
|
||||||
|
|
||||||
{"slope", "_inner_cut_half_raised"},
|
{"slope", "_inner_cut_half_raised"},
|
||||||
{"slope", "_outer"},
|
{"slope", "_outer"},
|
||||||
{"slope", "_outer_half"},
|
{"slope", "_outer_half"},
|
||||||
|
@ -28,6 +28,20 @@ local slabs_defs = {
|
|||||||
["_2"] = 2,
|
["_2"] = 2,
|
||||||
["_14"] = 14,
|
["_14"] = 14,
|
||||||
["_15"] = 15,
|
["_15"] = 15,
|
||||||
|
["_two_sides"] = {
|
||||||
|
{ -0.5, -0.5, -0.5, 0.5, -7/16, 7/16 },
|
||||||
|
{ -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 }
|
||||||
|
},
|
||||||
|
["_three_sides"] = {
|
||||||
|
{ -7/16, -0.5, -0.5, 0.5, -7/16, 7/16 },
|
||||||
|
{ -7/16, -0.5, 7/16, 0.5, 0.5, 0.5 },
|
||||||
|
{ -0.5, -0.5, -0.5, -7/16, 0.5, 0.5 }
|
||||||
|
},
|
||||||
|
["_three_sides_u"] = {
|
||||||
|
{ -0.5, -0.5, -0.5, 0.5, 0.5, -7/16 },
|
||||||
|
{ -0.5, -0.5, -7/16, 0.5, -7/16, 7/16 },
|
||||||
|
{ -0.5, -0.5, 7/16, 0.5, 0.5, 0.5 }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function stairsplus:register_slab_alias(modname_old, subname_old, modname_new, subname_new)
|
function stairsplus:register_slab_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
@ -47,21 +61,36 @@ end
|
|||||||
function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
||||||
local defs = stairsplus.copytable(slabs_defs)
|
local defs = stairsplus.copytable(slabs_defs)
|
||||||
local desc_base = S("%s Slab"):format(fields.description)
|
local desc_base = S("%s Slab"):format(fields.description)
|
||||||
for alternate, num in pairs(defs) do
|
for alternate, shape in pairs(defs) do
|
||||||
local def = {
|
|
||||||
node_box = {
|
local def = {}
|
||||||
type = "fixed",
|
|
||||||
fixed = {-0.5, -0.5, -0.5, 0.5, (num/16)-0.5, 0.5},
|
if type(shape) ~= "table" then
|
||||||
|
def = {
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.5, -0.5, 0.5, (shape/16)-0.5, 0.5},
|
||||||
|
},
|
||||||
|
description = ("%s (%d/16)"):format(desc_base, shape)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
def = {
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = shape,
|
||||||
|
},
|
||||||
|
description = desc_base
|
||||||
}
|
}
|
||||||
}
|
end
|
||||||
|
|
||||||
for k, v in pairs(fields) do
|
for k, v in pairs(fields) do
|
||||||
def[k] = v
|
def[k] = v
|
||||||
end
|
end
|
||||||
|
|
||||||
def.drawtype = "nodebox"
|
def.drawtype = "nodebox"
|
||||||
def.paramtype = "light"
|
def.paramtype = "light"
|
||||||
def.paramtype2 = def.paramtype2 or "facedir"
|
def.paramtype2 = def.paramtype2 or "facedir"
|
||||||
def.on_place = minetest.rotate_node
|
def.on_place = minetest.rotate_node
|
||||||
def.description = ("%s (%d/16)"):format(desc_base, num)
|
|
||||||
def.groups = stairsplus:prepare_groups(fields.groups)
|
def.groups = stairsplus:prepare_groups(fields.groups)
|
||||||
if fields.drop and not (type(fields.drop) == "table") then
|
if fields.drop and not (type(fields.drop) == "table") then
|
||||||
def.drop = modname.. ":slab_" .. fields.drop .. alternate
|
def.drop = modname.. ":slab_" .. fields.drop .. alternate
|
||||||
|
Loading…
Reference in New Issue
Block a user