forked from minetest/minetest_game
Stairs: Improve inner/outer stair descriptions. Code cleanup
This commit is contained in:
parent
2824e4bb7c
commit
0132bfe41e
@ -44,7 +44,8 @@ local function rotate_and_place(itemstack, placer, pointed_thing)
|
|||||||
return minetest.item_place(itemstack, placer, pointed_thing, param2)
|
return minetest.item_place(itemstack, placer, pointed_thing, param2)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register stairs.
|
|
||||||
|
-- Register stair
|
||||||
-- Node will be called stairs:stair_<subname>
|
-- Node will be called stairs:stair_<subname>
|
||||||
|
|
||||||
function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
|
function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
|
||||||
@ -141,7 +142,8 @@ end
|
|||||||
-- Slab facedir to placement 6d matching table
|
-- Slab facedir to placement 6d matching table
|
||||||
local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4}
|
local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4}
|
||||||
|
|
||||||
-- Register slabs.
|
|
||||||
|
-- Register slab
|
||||||
-- Node will be called stairs:slab_<subname>
|
-- Node will be called stairs:slab_<subname>
|
||||||
|
|
||||||
function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
|
function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
|
||||||
@ -292,7 +294,8 @@ if replace then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register stairs.
|
|
||||||
|
-- Register inner stair
|
||||||
-- Node will be called stairs:stair_inner_<subname>
|
-- Node will be called stairs:stair_inner_<subname>
|
||||||
|
|
||||||
function stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds)
|
function stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds)
|
||||||
@ -317,7 +320,7 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images, descri
|
|||||||
end
|
end
|
||||||
groups.stair = 1
|
groups.stair = 1
|
||||||
minetest.register_node(":stairs:stair_inner_" .. subname, {
|
minetest.register_node(":stairs:stair_inner_" .. subname, {
|
||||||
description = description .. " Inner",
|
description = "Inner " .. description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = stair_images,
|
tiles = stair_images,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
@ -368,7 +371,8 @@ function stairs.register_stair_inner(subname, recipeitem, groups, images, descri
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register stairs.
|
|
||||||
|
-- Register outer stair
|
||||||
-- Node will be called stairs:stair_outer_<subname>
|
-- Node will be called stairs:stair_outer_<subname>
|
||||||
|
|
||||||
function stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds)
|
function stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds)
|
||||||
@ -393,7 +397,7 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images, descri
|
|||||||
end
|
end
|
||||||
groups.stair = 1
|
groups.stair = 1
|
||||||
minetest.register_node(":stairs:stair_outer_" .. subname, {
|
minetest.register_node(":stairs:stair_outer_" .. subname, {
|
||||||
description = description .. " Outer",
|
description = "Outer " .. description,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
tiles = stair_images,
|
tiles = stair_images,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
@ -443,6 +447,7 @@ function stairs.register_stair_outer(subname, recipeitem, groups, images, descri
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Stair/slab registration function.
|
-- Stair/slab registration function.
|
||||||
-- Nodes will be called stairs:{stair,slab}_<subname>
|
-- Nodes will be called stairs:{stair,slab}_<subname>
|
||||||
|
|
||||||
@ -453,6 +458,7 @@ function stairs.register_stair_and_slab(subname, recipeitem, groups, images, des
|
|||||||
stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds)
|
stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Register default stairs and slabs
|
-- Register default stairs and slabs
|
||||||
|
|
||||||
stairs.register_stair_and_slab(
|
stairs.register_stair_and_slab(
|
||||||
|
Loading…
Reference in New Issue
Block a user