From 82333bd70744cb279234956335a4c6b663bfe995 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 29 Jul 2023 18:08:57 +0200 Subject: [PATCH] Fix possible crash with stairsplus --- handlers/registration.lua | 5 ++++- src/nodes.lua | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/handlers/registration.lua b/handlers/registration.lua index c8bcbef..44eacc2 100644 --- a/handlers/registration.lua +++ b/handlers/registration.lua @@ -160,7 +160,7 @@ end -- Registers aliases for a node that had a name collision -- with a node from the moreblocks mod -function xdecor.register_moreblocks_aliases(original_basename, new_basename) +function xdecor.register_legacy_aliases(original_basename, new_basename) minetest.register_alias("xdecor:"..original_basename, "xdecor:"..new_basename) minetest.register_alias("xdecor:"..original_basename.."_panel", "xdecor:"..new_basename.."_panel") minetest.register_alias("xdecor:"..original_basename.."_doublepanel", "xdecor:"..new_basename.."_doublepanel") @@ -176,5 +176,8 @@ function xdecor.register_moreblocks_aliases(original_basename, new_basename) minetest.register_alias("stairs:stair_outer_"..original_basename, "stairs:stair_outer_"..new_basename) minetest.register_alias("stairs:stair_inner_"..original_basename, "stairs:stair_inner"..new_basename) end + if minetest.get_modpath("stairsplus") and minetest.global_exists("stairsplus") and stairsplus.api then + stairsplus.api.register_alias_all("xdecor:"..original_basename, "xdecor:"..new_basename) + end end diff --git a/src/nodes.lua b/src/nodes.lua index e8bf919..2380e33 100644 --- a/src/nodes.lua +++ b/src/nodes.lua @@ -767,7 +767,7 @@ register_hard_node("stone_rune", S("Runestone")) register_hard_node("stone_tile_x", S("Polished Stone Block"), { tiles = {"xdecor_stone_tile.png"}, }) -xdecor.register_moreblocks_aliases("stone_tile", "stone_tile_x") +xdecor.register_legacy_aliases("stone_tile", "stone_tile_x") register_hard_node("packed_ice", S("Packed Ice"), { groups = {cracky = 1, cools_lava = 1, slippery = 3}, @@ -781,7 +781,7 @@ register_hard_node("wood_tile_x", S("Wooden Tile"), { sounds = default.node_sound_wood_defaults(), tiles = {"xdecor_wood_tile.png"}, }) -xdecor.register_moreblocks_aliases("wood_tile", "wood_tile_x") +xdecor.register_legacy_aliases("wood_tile", "wood_tile_x") xdecor.register("table", { description = S("Table"),