1
0
Fork 0

A more elegant solution for slabs

After a good bit of trial and error, and asking questions... I have rewritten the override code and it works. (tested, slabs can now be used to make composters and barrels with this method.)
bambootoo^2
Michieal 2022-12-16 05:24:54 +00:00
parent da4e359df0
commit c09ed02801
1 changed files with 2 additions and 9 deletions

View File

@ -344,8 +344,7 @@ local function create_nodes()
-- let's add plank slabs to the wood_slab group. -- let's add plank slabs to the wood_slab group.
local bamboo_plank_slab = "mcl_stairs:slab_bamboo_plank" local bamboo_plank_slab = "mcl_stairs:slab_bamboo_plank"
local node_def_plank_slab_def = minetest.registered_nodes[bamboo_plank_slab] local node_groups = {
node_def_plank_slab_def.groups = {
wood_slab = 1, wood_slab = 1,
building_block = 1, building_block = 1,
slab = 1, slab = 1,
@ -354,13 +353,7 @@ local function create_nodes()
stair = 1 stair = 1
} }
if DEBUG then minetest.override_item(bamboo_plank_slab, {groups = node_groups})
minetest.log("Plank_Slab definition: \n" .. dump(node_def_plank_slab_def))
end
-- A necessary evil, to add a single group to an already registered node. (And yes, I did try override_item())
minetest.unregister_item(node_def_plank_slab_def.name)
minetest.register_node(":"..node_def_plank_slab_def.name, node_def_plank_slab_def)
end end
end end
end end