diff --git a/stairsplus/api/node.lua b/stairsplus/api/node.lua index 993dbd8..df2dce4 100644 --- a/stairsplus/api/node.lua +++ b/stairsplus/api/node.lua @@ -156,7 +156,9 @@ function api.register_single(node, shape, overrides, meta) end if not meta.allow_override_groups and overrides.groups then - stairsplus.log("warning", "removing group overrides from %s", shaped_name) + stairsplus.log("warning", "removing group overrides from %s (was %s, will be %s)", + shaped_name, minetest.serialize(overrides.groups):sub(8), minetest.serialize(def.groups):sub(8) + ) overrides.groups = nil end diff --git a/stairsplus/compat2/init.lua b/stairsplus/compat2/init.lua index 899aa5d..591d480 100644 --- a/stairsplus/compat2/init.lua +++ b/stairsplus/compat2/init.lua @@ -6,7 +6,15 @@ stairsplus.compat = { def.drawtype == "plantlike" or def.drawtype == "nodebox" ) - end + end, + is_legacy_paramtype2 = function(node) + local def = minetest.registered_nodes[node] + return ( + def.paramtype2 == "color" or + def.paramtype2 == "colorwallmounted" or + def.paramtype2 == "glasslikeliquidlevel" + ) + end, } stairsplus.dofile("compat2", "stairs") diff --git a/stairsplus/compat2/old_moreblocks.lua b/stairsplus/compat2/old_moreblocks.lua index 6ca920f..ecc9e83 100644 --- a/stairsplus/compat2/old_moreblocks.lua +++ b/stairsplus/compat2/old_moreblocks.lua @@ -4,6 +4,8 @@ local api = stairsplus.api local is_legacy_drawtype = stairsplus.compat.is_legacy_drawtype +local is_legacy_paramtype2 = stairsplus.compat.is_legacy_paramtype2 + local legacy_mode = stairsplus.settings.legacy_mode local function clean_legacy_fields(fields) @@ -51,11 +53,17 @@ local function clean_legacy_fields(fields) end local function register_group(modname, subname, recipeitem, fields, group) + if not minetest.registered_nodes[recipeitem] then + error(("cannot register stairs for %s before the node is defined"):format(recipeitem)) + end fields = clean_legacy_fields(fields) local meta = {} if is_legacy_drawtype(recipeitem) then meta.ignore_drawtype = true end + if is_legacy_paramtype2(recipeitem) then + meta.ignore_paramtype2 = true + end api.register_group(recipeitem, group, fields, meta) diff --git a/stairsplus/compat2/stairs.lua b/stairsplus/compat2/stairs.lua index 12b7303..02f51f0 100644 --- a/stairsplus/compat2/stairs.lua +++ b/stairsplus/compat2/stairs.lua @@ -9,8 +9,10 @@ local api = stairsplus.api local S = stairsplus.S -local default_align_style = stairsplus.settings.default_align_style local is_legacy_drawtype = stairsplus.compat.is_legacy_drawtype +local is_legacy_paramtype2 = stairsplus.compat.is_legacy_paramtype2 + +local default_align_style = stairsplus.settings.default_align_style function stairs.register_stair(subname, node, groups, tiles, description, sounds, worldaligntex) local meta = { @@ -19,6 +21,9 @@ function stairs.register_stair(subname, node, groups, tiles, description, sounds if is_legacy_drawtype(node) then meta.ignore_drawtype = true end + if is_legacy_paramtype2(node) then + meta.ignore_paramtype2 = true + end api.register_single(node, "stair", { groups = groups, @@ -37,6 +42,9 @@ function stairs.register_slab(subname, node, groups, images, description, sounds if is_legacy_drawtype(node) then meta.ignore_drawtype = true end + if is_legacy_paramtype2(node) then + meta.ignore_paramtype2 = true + end api.register_single(node, "slab_8", { groups = groups, @@ -55,6 +63,9 @@ function stairs.register_stair_inner(subname, node, groups, tiles, description, if is_legacy_drawtype(node) then meta.ignore_drawtype = true end + if is_legacy_paramtype2(node) then + meta.ignore_paramtype2 = true + end api.register_single(node, "stair_inner", { groups = groups, @@ -73,6 +84,9 @@ function stairs.register_stair_outer(subname, node, groups, tiles, description, if is_legacy_drawtype(node) then meta.ignore_drawtype = true end + if is_legacy_paramtype2(node) then + meta.ignore_paramtype2 = true + end api.register_single(node, "stair_outer", { groups = groups,