1
0
mirror of https://github.com/mt-mods/homedecor_modpack.git synced 2024-12-23 00:20:17 +01:00

Proper handle stairs groups

fix #410
This commit is contained in:
Alexander Weber 2018-04-16 20:03:23 +02:00 committed by Vanessa Dannenberg
parent 5db791deb4
commit 3597c2c1aa

View File

@ -1,21 +1,18 @@
local S = homedecor_i18n.gettext local S = homedecor_i18n.gettext
local stairs_groups_names = {"cracky","choppy","flammable","crumbly","snappy"}
local function building_blocks_stairs(nodename, def) local function building_blocks_stairs(nodename, def)
minetest.register_node(nodename, def) minetest.register_node(nodename, def)
if minetest.get_modpath("moreblocks") or minetest.get_modpath("stairs") then if minetest.get_modpath("moreblocks") or minetest.get_modpath("stairs") then
local mod, name = nodename:match("(.*):(.*)") local mod, name = nodename:match("(.*):(.*)")
minetest.register_alias(mod .. ":slab_" .. name, "stairs:slab_" .. name) minetest.register_alias(mod .. ":slab_" .. name, "stairs:slab_" .. name)
minetest.register_alias(mod .. ":stair_" .. name, "stairs:stair_" .. name) minetest.register_alias(mod .. ":stair_" .. name, "stairs:stair_" .. name)
for groupname,value in pairs(def.groups) do local stairs_groups = {}
if groupname ~= "cracky" and for _, groupname in ipairs(stairs_groups_names) do
groupname ~= "choppy" and stairs_groups[groupname] = def.groups[groupname]
groupname ~="flammable" and
groupname ~="crumbly" and
groupname ~="snappy"
then
def.groups.groupname = nil
end
end end
if minetest.get_modpath("moreblocks") then if minetest.get_modpath("moreblocks") then
stairsplus:register_all( stairsplus:register_all(
mod, mod,
@ -24,13 +21,13 @@ local function building_blocks_stairs(nodename, def)
{ {
description = def.description, description = def.description,
tiles = def.tiles, tiles = def.tiles,
groups = def.groups, groups = stairs_groups,
sounds = def.sounds, sounds = def.sounds,
} }
) )
else else
stairs.register_stair_and_slab(name,nodename, stairs.register_stair_and_slab(name,nodename,
def.groups, stairs_groups,
def.tiles, def.tiles,
("%s Stair"):format(def.description), ("%s Stair"):format(def.description),
("%s Slab"):format(def.description), ("%s Slab"):format(def.description),