mirror of
https://notabug.org/TenPlus1/bakedclay.git
synced 2024-08-20 22:34:04 +02:00
tweak stairs code
This commit is contained in:
parent
268946971a
commit
67d0f2a8d6
19
init.lua
19
init.lua
@ -19,6 +19,10 @@ local clay = {
|
|||||||
{"dark_green", "Dark Green"},
|
{"dark_green", "Dark Green"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local stairs_mod = minetest.get_modpath("stairs")
|
||||||
|
local stairsplus_mod = minetest.get_modpath("moreblocks")
|
||||||
|
and minetest.global_exists("stairsplus")
|
||||||
|
|
||||||
for _, clay in pairs(clay) do
|
for _, clay in pairs(clay) do
|
||||||
|
|
||||||
-- node definition
|
-- node definition
|
||||||
@ -42,7 +46,7 @@ for _, clay in pairs(clay) do
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- register stairsplus stairs if found
|
-- register stairsplus stairs if found
|
||||||
if minetest.get_modpath("moreblocks") and stairsplus then
|
if stairsplus_mod then
|
||||||
|
|
||||||
stairsplus:register_all("bakedclay", "baked_clay_" .. clay[1], "bakedclay:" .. clay[1], {
|
stairsplus:register_all("bakedclay", "baked_clay_" .. clay[1], "bakedclay:" .. clay[1], {
|
||||||
description = clay[2] .. " Baked Clay",
|
description = clay[2] .. " Baked Clay",
|
||||||
@ -55,8 +59,17 @@ for _, clay in pairs(clay) do
|
|||||||
minetest.register_alias("stairs:slab_bakedclay_".. clay[1], "bakedclay:slab_baked_clay_" .. clay[1])
|
minetest.register_alias("stairs:slab_bakedclay_".. clay[1], "bakedclay:slab_baked_clay_" .. clay[1])
|
||||||
minetest.register_alias("stairs:stair_bakedclay_".. clay[1], "bakedclay:stair_baked_clay_" .. clay[1])
|
minetest.register_alias("stairs:stair_bakedclay_".. clay[1], "bakedclay:stair_baked_clay_" .. clay[1])
|
||||||
|
|
||||||
-- register stair and slab (unless stairs redo active)
|
-- register all stair types for stairs redo
|
||||||
elseif stairs and not stairs.mod then
|
elseif stairs_mod and stairs.mod then
|
||||||
|
|
||||||
|
stairs.register_all("bakedclay_" .. clay[1], "bakedclay:" .. clay[1],
|
||||||
|
{cracky = 3},
|
||||||
|
{"baked_clay_" .. clay[1] .. ".png"},
|
||||||
|
clay[2] .. " Baked Clay",
|
||||||
|
default.node_sound_stone_defaults())
|
||||||
|
|
||||||
|
-- register stair and slab using default stairs
|
||||||
|
elseif stairs_mod then
|
||||||
|
|
||||||
stairs.register_stair_and_slab("bakedclay_".. clay[1], "bakedclay:".. clay[1],
|
stairs.register_stair_and_slab("bakedclay_".. clay[1], "bakedclay:".. clay[1],
|
||||||
{cracky = 3},
|
{cracky = 3},
|
||||||
|
Loading…
Reference in New Issue
Block a user