New slab types: 1/16, 1/8, 7/8, 15/16 slabs (suggested by VanessaE), reorganized circular saw

This commit is contained in:
Calinou 2013-10-26 18:16:43 +02:00
parent 621948c70a
commit f322bb1bc1
2 changed files with 115 additions and 6 deletions

View File

@ -55,17 +55,22 @@ circular_saw.get_stair_output_inv = function(modname, material, anz, max)
end end
return { return {
modname .. ":micro_" .. material .. "_bottom " .. math.min(math.floor(anz/1), max_offered),
modname .. ":panel_" .. material .. "_bottom " .. math.min(math.floor(anz/2), max_offered),
modname .. ":stair_" .. material .. "_half " .. math.min(math.floor(anz/3), max_offered),
modname .. ":stair_" .. material .. "_alt " .. math.min(math.floor(anz/4), max_offered),
modname .. ":stair_" .. material .. "_outer " .. math.min(math.floor(anz/5), max_offered),
modname .. ":stair_" .. material .. " " .. math.min(math.floor(anz/6), max_offered), modname .. ":stair_" .. material .. " " .. math.min(math.floor(anz/6), max_offered),
modname .. ":stair_" .. material .. "_inner " .. math.min(math.floor(anz/7), max_offered), modname .. ":stair_" .. material .. "_inner " .. math.min(math.floor(anz/7), max_offered),
modname .. ":stair_" .. material .. "_outer " .. math.min(math.floor(anz/5), max_offered),
modname .. ":stair_" .. material .. "_half " .. math.min(math.floor(anz/3), max_offered), modname .. ":slab_" .. material .. "_1 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":slab_" .. material .. "_2 " .. math.min(math.floor(anz/1), max_offered),
modname .. ":slab_" .. material .. "_quarter " .. math.min(math.floor(anz/2), max_offered), modname .. ":slab_" .. material .. "_quarter " .. math.min(math.floor(anz/2), max_offered),
modname .. ":slab_" .. material .. " " .. math.min(math.floor(anz/4), max_offered), modname .. ":slab_" .. material .. " " .. math.min(math.floor(anz/4), max_offered),
modname .. ":slab_" .. material .. "_three_quarter " .. math.min(math.floor(anz/6), max_offered), modname .. ":slab_" .. material .. "_three_quarter " .. math.min(math.floor(anz/6), max_offered),
modname .. ":slab_" .. material .. "_14 " .. math.min(math.floor(anz/7), max_offered),
modname .. ":slab_" .. material .. "_15 " .. math.min(math.floor(anz/8), max_offered),
modname .. ":panel_" .. material .. "_bottom " .. math.min(math.floor(anz/2), max_offered),
modname .. ":micro_" .. material .. "_bottom " .. math.min(math.floor(anz/1), max_offered),
modname .. ":stair_" .. material .. "_alt " .. math.min(math.floor(anz/4), max_offered),
"", "",
} }
end end

View File

@ -115,6 +115,110 @@ function register_slab(modname, subname, recipeitem, groups, images, description
end end
}) })
minetest.register_node(":"..modname .. ":slab_" .. subname .. "_2", {
description = S("%s Slab"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":slab_" .. drop .. "_quarter",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":"..modname .. ":slab_" .. subname .. "_1", {
description = S("%s Slab"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":slab_" .. drop .. "_quarter",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":"..modname .. ":slab_" .. subname .. "_14", {
description = S("%s Slab"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":slab_" .. drop .. "_quarter",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.375, 0.5},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
minetest.register_node(":"..modname .. ":slab_" .. subname .. "_15", {
description = S("%s Slab"):format(S(description)),
drawtype = "nodebox",
tiles = images,
light_source = light,
drop = modname .. ":slab_" .. drop .. "_quarter",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
},
sounds = default.node_sound_stone_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
stairsplus_rotate_and_place(itemstack, placer, pointed_thing, keys["sneak"])
return itemstack
end
})
-- Unregister default recipes, optional, see _config.txt -- Unregister default recipes, optional, see _config.txt
if allow_stair_slab_crafting == false if allow_stair_slab_crafting == false