stairs and slabs added

master
Victor Hackeridze 2012-04-24 12:52:50 +06:00
parent f840c839d6
commit 6c9664aeab
3 changed files with 121 additions and 1 deletions

View File

@ -0,0 +1,3 @@
default
stone_brick
dye

117
rtmg/mods/stairs/init.lua Normal file
View File

@ -0,0 +1,117 @@
stairs = {}
-- Node will be called stairs:stair_<subname>
function stairs.register_stair(subname, recipeitem, groups, images, description)
minetest.register_node("stairs:stair_" .. subname, {
description = description,
drawtype = "nodebox",
tile_images = images,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
{-0.5, 0, 0, 0.5, 0.5, 0.5},
},
},
stack_max = 128,
})
minetest.register_craft({
output = 'stairs:stair_' .. subname .. ' 4',
recipe = {
{recipeitem, "", ""},
{recipeitem, recipeitem, ""},
{recipeitem, recipeitem, recipeitem},
},
})
end
-- Node will be called stairs:slab_<subname>
function stairs.register_slab(subname, recipeitem, groups, images, description)
minetest.register_node("stairs:slab_" .. subname, {
description = description,
drawtype = "nodebox",
tile_images = images,
paramtype = "light",
is_ground_content = true,
groups = groups,
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
},
stack_max = 128,
})
minetest.register_craft({
output = 'stairs:slab_' .. subname .. ' 3',
recipe = {
{recipeitem, recipeitem, recipeitem},
},
})
end
-- Nodes will be called stairs:{stair,slab}_<subname>
function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab)
stairs.register_stair(subname, recipeitem, groups, images, desc_stair)
stairs.register_slab(subname, recipeitem, groups, images, desc_slab)
end
stairs.register_stair_and_slab("wood", "default:wood",
{snappy=2,choppy=2,oddly_breakable_by_hand=2},
{"default_wood.png"},
"Wooden stair",
"Wooden slab")
stairs.register_stair_and_slab("stone", "default:stone",
{cracky=3},
{"default_stone.png"},
"Stone stair",
"Stone slab")
stairs.register_stair_and_slab("cobble", "default:cobble",
{cracky=3},
{"default_cobble.png"},
"Cobble stair",
"Cobble slab")
stairs.register_stair_and_slab("brick", "default:brick",
{cracky=3},
{"default_brick.png"},
"Brick stair",
"Brick slab")
stairs.register_stair_and_slab("sandstone", "default:sandstone",
{crumbly=2,cracky=2},
{"default_sandstone.png"},
"Sandstone stair",
"Sandstone slab")
-- stone bricks
stairs.register_stair_and_slab("stone_brick", "stone_brick:stone_brick",
{cracky=2, level=2},
{"default_stone.png^stone_brick_stone_brick.png"},
"Stone brick stair",
"Stone brick slab")
-- Colored bricks:
for color, name in pairs(SB_NAMES_COLORS) do
local texture = "stone_brick_" .. color .. ".png"
stairs.register_stair_and_slab(color .. "_stone_brick", "stone_brick:" .. color .. "_stone_brick",
{cracky=2, level=2},
{texture},
name .. " stair",
name .. " slab")
dye.add_dye_recipe("stairs:stair_" .. color .. "_stone_brick","stairs:stair_stone_brick",color)
dye.add_dye_recipe("stairs:stair_white_stone_brick","stairs:stair_" .. color .. "_stone_brick","white")
end

View File

@ -1,6 +1,6 @@
-- stone bricks
local SB_NAMES_COLORS = {
SB_NAMES_COLORS = {
["white"] = "White stone brick",
["light_gray"] = "Light-gray stone brick",
["gray"] = "Gray stone brick",