From 53ac0b80b3e307a0bd658476997cc8bf35325be3 Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Fri, 9 Dec 2022 14:55:37 -0800 Subject: [PATCH] create proper stairs mod replacement; create option to allow registering stairs w/out a proper recipeitem --- .pre-commit-config.yaml | 6 + settingtypes.txt | 6 + stairs/.luacheckrc | 31 +++ stairs/README.md | 1 + .../compat/stairs.lua => stairs/api.lua | 141 +++++----- stairs/compat.lua | 4 + stairs/init.lua | 33 +++ stairs/legacy.lua | 245 ++++++++++++++++++ stairs/mod.conf | 5 + stairs/settings.lua | 5 + stairs/util.lua | 47 ++++ stairsplus/.luacheckrc | 1 - stairsplus/compat/init.lua | 1 - stairsplus/mod.conf | 2 +- stairsplus_legacy/default.lua | 106 +++----- stairsplus_legacy/farming.lua | 5 +- 16 files changed, 484 insertions(+), 155 deletions(-) create mode 100644 stairs/.luacheckrc create mode 100644 stairs/README.md rename stairsplus/compat/stairs.lua => stairs/api.lua (50%) create mode 100644 stairs/compat.lua create mode 100644 stairs/init.lua create mode 100644 stairs/legacy.lua create mode 100644 stairs/mod.conf create mode 100644 stairs/settings.lua create mode 100644 stairs/util.lua diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 41dbf63..d7acf25 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,6 +29,12 @@ repos: entry: luacheck pass_filenames: false args: [--config,./moreblocks_legacy_recipes/.luacheckrc,-q,./moreblocks_legacy_recipes] + - id: luacheck_stairs + name: luacheck_stairs + language: system + entry: luacheck + pass_filenames: false + args: [--config,./stairs/.luacheckrc,-q,./stairs] - id: luacheck_stairsplus name: luacheck_stairsplus language: system diff --git a/settingtypes.txt b/settingtypes.txt index 94ed5ba..74b65e1 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -13,6 +13,12 @@ moreblocks_legacy_recipes.enabled (Enable legacy recipes) bool false # Add a yellow outline around trap nodes, to make them visibly distinct moreblocks.outline_trap_nodes (Outline trap nodes) bool true +# If true, registering stairs w/out a registered recipe item will still create the stair nodes. +# This is how the stairs mod in minetest game works currently. +# Unfortunately, they will not be craftable. +# By default, trying to do this will create an error. +stairs.legacy_stairs_without_recipeitem (Allow stairs without a base node) bool false + # I guess if you want the saw to be creative-only? stairsplus.circular_saw_crafting (Allow crafting the circular saw) bool true diff --git a/stairs/.luacheckrc b/stairs/.luacheckrc new file mode 100644 index 0000000..d32a4fb --- /dev/null +++ b/stairs/.luacheckrc @@ -0,0 +1,31 @@ +std = "lua51+luajit+minetest+stairs" +unused_args = false +max_line_length = 120 + +stds.minetest = { + read_globals = { + "DIR_DELIM", + "minetest", + "core", + "dump", + "vector", + "nodeupdate", + "VoxelManip", + "VoxelArea", + "PseudoRandom", + "ItemStack", + "default", + "table", + "math", + "string", + } +} + +stds.stairs = { + globals = { + "stairs", + }, + read_globals = { + "stairsplus", + }, +} diff --git a/stairs/README.md b/stairs/README.md new file mode 100644 index 0000000..04981cc --- /dev/null +++ b/stairs/README.md @@ -0,0 +1 @@ +stairs compat: override what stairs does diff --git a/stairsplus/compat/stairs.lua b/stairs/api.lua similarity index 50% rename from stairsplus/compat/stairs.lua rename to stairs/api.lua index 69e940b..5cbad99 100644 --- a/stairsplus/compat/stairs.lua +++ b/stairs/api.lua @@ -1,29 +1,34 @@ --- stairs compat: override what stairs does --- in stairsplus_legacy, "fix" any stairs which were already registered - -if not stairsplus.has.stairs then - return -end - local f = string.format local api = stairsplus.api local S = stairsplus.S +local legacy = stairs.legacy + 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 -local crafting_schemata_enabled = stairsplus.settings.crafting_schemata_enabled +local legacy_stairs_without_recipeitem = stairs.settings.legacy_stairs_without_recipeitem function stairs.register_stair(subname, node, groups, tiles, description, sounds, worldaligntex) + if not minetest.registered_nodes[node] then + -- registering a stair for a node that doesn't exist + if legacy_stairs_without_recipeitem then + legacy.register_stair(subname, node, groups, tiles, description, sounds, worldaligntex) + return + + else + error(f("attempt to register stairs for unknown node %q. " .. + "set `stairs.legacy_stairs_without_recipeitem = true` in minetest.conf to enable this behavior.", node)) + end + end + local meta = { align_style = worldaligntex and "world" or default_align_style } - if not minetest.registered_nodes[node] then - error(f("cannot register stairs for unknown node %q", node)) - end + if is_legacy_drawtype(node) then meta.ignore_drawtype = true end @@ -41,7 +46,19 @@ function stairs.register_stair(subname, node, groups, tiles, description, sounds minetest.register_alias(("stairs:stair_%s"):format(subname), api.format_name(node, "stair")) end -function stairs.register_slab(subname, node, groups, images, description, sounds, worldaligntex) +function stairs.register_slab(subname, node, groups, tiles, description, sounds, worldaligntex) + if not minetest.registered_nodes[node] then + -- registering a stair for a node that doesn't exist + if legacy_stairs_without_recipeitem then + legacy.register_slab(subname, node, groups, tiles, description, sounds, worldaligntex) + return + + else + error(f("attempt to register stairs for unknown node %q. " .. + "set `stairs.legacy_stairs_without_recipeitem = true` in minetest.conf to enable this behavior.", node)) + end + end + local meta = { align_style = worldaligntex and "world" or default_align_style } @@ -54,7 +71,7 @@ function stairs.register_slab(subname, node, groups, images, description, sounds api.register_single(node, "slab_8", { groups = groups, - tiles = images, + tiles = tiles, description = description, sounds = sounds, }, meta) @@ -63,6 +80,19 @@ function stairs.register_slab(subname, node, groups, images, description, sounds end function stairs.register_stair_inner(subname, node, groups, tiles, description, sounds, worldaligntex, full_description) + if not minetest.registered_nodes[node] then + -- registering a stair for a node that doesn't exist + if legacy_stairs_without_recipeitem then + legacy.register_stair_inner(subname, node, groups, tiles, description, sounds, worldaligntex, + full_description) + return + + else + error(f("attempt to register stairs for unknown node %q. " .. + "set `stairs.legacy_stairs_without_recipeitem = true` in minetest.conf to enable this behavior.", node)) + end + end + local meta = { align_style = worldaligntex and "world" or default_align_style } @@ -84,6 +114,19 @@ function stairs.register_stair_inner(subname, node, groups, tiles, description, end function stairs.register_stair_outer(subname, node, groups, tiles, description, sounds, worldaligntex, full_description) + if not minetest.registered_nodes[node] then + -- registering a stair for a node that doesn't exist + if legacy_stairs_without_recipeitem then + legacy.register_stair_outer(subname, node, groups, tiles, description, sounds, worldaligntex, + full_description) + return + + else + error(f("attempt to register stairs for unknown node %q. " .. + "set `stairs.legacy_stairs_without_recipeitem = true` in minetest.conf to enable this behavior.", node)) + end + end + local meta = { align_style = worldaligntex and "world" or default_align_style } @@ -104,68 +147,12 @@ function stairs.register_stair_outer(subname, node, groups, tiles, description, minetest.register_alias(("stairs:stair_outer_%s"):format(subname), api.format_name(node, "stair_outer")) end -local stair_name_formats = { - stair = "stairs:stair_%s", - slab_8 = "stairs:slab_%s", - stair_inner = "stairs:stair_inner_%s", - stair_outer = "stairs:stair_outer_%s", -} - -function stairsplus.compat.override_stairs(name, node, overrides, meta) - for shape, name_format in pairs(stair_name_formats) do - local stair_name = name_format:format(name) - if minetest.registered_nodes[stair_name] then - api.register_single(node, shape, overrides, meta) - local shaped_name = api.format_name(node, shape) - minetest.register_alias_force(stair_name, shaped_name) - end - end - - if not crafting_schemata_enabled then - local stair_name = stair_name_formats.stair:format(name) - local slab_name = stair_name_formats.slab_8:format(name) - - minetest.clear_craft({ - recipe = { - { stair_name, stair_name }, - { stair_name, stair_name }, - } - }) - - minetest.clear_craft({ - recipe = { - { slab_name }, - { slab_name }, - } - }) - - minetest.clear_craft({ - recipe = { - {"", "", node}, - {"", node, node}, - {node, node, node}, - } - }) - - minetest.clear_craft({ - recipe = { - {node, node, node}, - } - }) - - minetest.clear_craft({ - recipe = { - {"", node, ""}, - {node, "", node}, - {node, node, node}, - } - }) - - minetest.clear_craft({ - recipe = { - {"", node, ""}, - {node, node, node}, - } - }) - end +function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, + worldaligntex, desc_stair_inner, desc_stair_outer) + stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds, worldaligntex) + stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds, worldaligntex) + stairs.register_stair_inner(subname, recipeitem, groups, images, desc_stair, sounds, worldaligntex, + desc_stair_inner) + stairs.register_stair_outer(subname, recipeitem, groups, images, desc_stair, sounds, worldaligntex, + desc_stair_outer) end diff --git a/stairs/compat.lua b/stairs/compat.lua new file mode 100644 index 0000000..35d0334 --- /dev/null +++ b/stairs/compat.lua @@ -0,0 +1,4 @@ +-- for very, very old worlds... + +minetest.register_alias("stairs:stair_pinewood", "stairs:stair_pine_wood") +minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood") diff --git a/stairs/init.lua b/stairs/init.lua new file mode 100644 index 0000000..787d2f3 --- /dev/null +++ b/stairs/init.lua @@ -0,0 +1,33 @@ +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) +local S = minetest.get_translator(modname) + +stairs = { + version = {3, 0, 0}, + fork = "minetest_mods", + + modname = modname, + modpath = modpath, + + S = S, + + has = { + default = minetest.get_modpath("default"), + i3 = minetest.get_modpath("i3"), + stairs = minetest.get_modpath("stairs"), + unified_inventory = minetest.get_modpath("unified_inventory"), + }, + + log = function(level, messagefmt, ...) + return minetest.log(level, ("[%s] %s"):format(modname, messagefmt:format(...))) + end, + + dofile = function(...) + return dofile(table.concat({modpath, ...}, DIR_DELIM) .. ".lua") + end, +} + +stairs.dofile("util") +stairs.dofile("legacy") +stairs.dofile("api") +stairs.dofile("compat") diff --git a/stairs/legacy.lua b/stairs/legacy.lua new file mode 100644 index 0000000..7eba9bb --- /dev/null +++ b/stairs/legacy.lua @@ -0,0 +1,245 @@ +local rotate_and_place = minetest.rotate_and_place + +local get_node_vars = stairs.util.get_node_vars +local get_stair_images = stairs.util.get_stair_images + +local legacy = {} + +local nodeboxes = { + stair = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}, + {-0.5, 0.0, 0.0, 0.5, 0.5, 0.5}, + }, + }, + slab = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + }, + stair_inner = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}, + {-0.5, 0.0, 0.0, 0.5, 0.5, 0.5}, + {-0.5, 0.0, -0.5, 0.0, 0.5, 0.0}, + }, + }, + stair_outer = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.0, 0.5}, + {-0.5, 0.0, 0.0, 0.0, 0.5, 0.5}, + }, + }, +} + +local function register_generic(name, recipeitem, groups, images, description, sounds, worldaligntex, nodebox) + if not nodebox then + error() + end + + local light_source, texture_alpha, sunlight = get_node_vars(recipeitem) + + local stair_images = get_stair_images(images, worldaligntex) + + minetest.register_node(name, { + description = description, + drawtype = "nodebox", + tiles = stair_images, + use_texture_alpha = texture_alpha, + sunlight_propagates = sunlight, + light_source = light_source, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + groups = groups, + sounds = sounds, + node_box = nodebox, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" then + return itemstack + end + + return rotate_and_place(itemstack, placer, pointed_thing) + end, + }) +end + +function legacy.register_stair(subname, recipeitem, groups, images, description, sounds, worldaligntex) + local new_groups = table.copy(groups) + new_groups.stair = 1 + + register_generic(":stairs:stair_" .. subname, recipeitem, new_groups, images, description, sounds, + worldaligntex, nodeboxes.stair) + + if recipeitem and minetest.registered_nodes[recipeitem] then + -- Recipe matches appearence in inventory + minetest.register_craft({ + output = "stairs:stair_" .. subname .. " 8", + recipe = { + {"", "", recipeitem}, + {"", recipeitem, recipeitem}, + {recipeitem, recipeitem, recipeitem}, + }, + }) + + -- Use stairs to craft full blocks again (1:1) + minetest.register_craft({ + output = recipeitem .. " 3", + recipe = { + {"stairs:stair_" .. subname, "stairs:stair_" .. subname}, + {"stairs:stair_" .. subname, "stairs:stair_" .. subname}, + }, + }) + + -- Fuel + local baseburntime = minetest.get_craft_result({ + method = "fuel", + width = 1, + items = {recipeitem} + }).time + + if baseburntime > 0 then + minetest.register_craft({ + type = "fuel", + recipe = "stairs:stair_" .. subname, + burntime = math.floor(baseburntime * 0.75), + }) + end + end +end + + +-- Register slab +-- Node will be called stairs:slab_ + +function legacy.register_slab(subname, recipeitem, groups, images, description, sounds, worldaligntex) + local new_groups = table.copy(groups) + new_groups.slab = 1 + + register_generic(":stairs:slab_" .. subname, recipeitem, new_groups, images, description, sounds, + worldaligntex, nodeboxes.slab) + + if recipeitem and minetest.registered_nodes[recipeitem] then + minetest.register_craft({ + output = "stairs:slab_" .. subname .. " 6", + recipe = { + {recipeitem, recipeitem, recipeitem}, + }, + }) + + -- Use 2 slabs to craft a full block again (1:1) + minetest.register_craft({ + output = recipeitem, + recipe = { + {"stairs:slab_" .. subname}, + {"stairs:slab_" .. subname}, + }, + }) + + -- Fuel + local baseburntime = minetest.get_craft_result({ + method = "fuel", + width = 1, + items = {recipeitem} + }).time + if baseburntime > 0 then + minetest.register_craft({ + type = "fuel", + recipe = "stairs:slab_" .. subname, + burntime = math.floor(baseburntime * 0.5), + }) + end + end +end + +-- Register inner stair +-- Node will be called stairs:stair_inner_ + +function legacy.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex, + full_description) + + local new_groups = table.copy(groups) + new_groups.stair = 1 + if full_description then + description = full_description + else + description = "Inner " .. description + end + + register_generic(":stairs:stair_inner_" .. subname, recipeitem, new_groups, images, description, sounds, + worldaligntex, nodeboxes.stair_inner) + + if recipeitem and minetest.registered_nodes[recipeitem] then + minetest.register_craft({ + output = "stairs:stair_inner_" .. subname .. " 7", + recipe = { + {"", recipeitem, ""}, + {recipeitem, "", recipeitem}, + {recipeitem, recipeitem, recipeitem}, + }, + }) + + -- Fuel + local baseburntime = minetest.get_craft_result({ + method = "fuel", + width = 1, + items = {recipeitem} + }).time + + if baseburntime > 0 then + minetest.register_craft({ + type = "fuel", + recipe = "stairs:stair_inner_" .. subname, + burntime = math.floor(baseburntime * 0.875), + }) + end + end +end + + +-- Register outer stair +-- Node will be called stairs:stair_outer_ + +function legacy.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex, + full_description) + local new_groups = table.copy(groups) + new_groups.stair = 1 + + if full_description then + description = full_description + else + description = "Outer " .. description + end + + register_generic(":stairs:stair_outer_" .. subname, recipeitem, new_groups, images, description, sounds, + worldaligntex, nodeboxes.stair_outer) + + if recipeitem and minetest.registered_nodes[recipeitem] then + minetest.register_craft({ + output = "stairs:stair_outer_" .. subname .. " 6", + recipe = { + {"", recipeitem, ""}, + {recipeitem, recipeitem, recipeitem}, + }, + }) + + -- Fuel + local baseburntime = minetest.get_craft_result({ + method = "fuel", + width = 1, + items = {recipeitem} + }).time + + if baseburntime > 0 then + minetest.register_craft({ + type = "fuel", + recipe = "stairs:stair_outer_" .. subname, + burntime = math.floor(baseburntime * 0.625), + }) + end + end +end + +stairs.legacy = legacy diff --git a/stairs/mod.conf b/stairs/mod.conf new file mode 100644 index 0000000..9550e2d --- /dev/null +++ b/stairs/mod.conf @@ -0,0 +1,5 @@ +name = stairs +version = 3.0.0 +title = Stairs+'s Stairs Compat layer +description = stair API +depends = stairsplus diff --git a/stairs/settings.lua b/stairs/settings.lua new file mode 100644 index 0000000..a4434ea --- /dev/null +++ b/stairs/settings.lua @@ -0,0 +1,5 @@ +local s = minetest.settings + +stairs.settings = { + legacy_stairs_without_recipeitem = s:get_bool("stairs.legacy_stairs_without_recipeitem", false), +} diff --git a/stairs/util.lua b/stairs/util.lua new file mode 100644 index 0000000..c76bb52 --- /dev/null +++ b/stairs/util.lua @@ -0,0 +1,47 @@ +local default_align_style = stairsplus.settings.default_align_style + +local util = {} + +-- get node settings to use for stairs +function util.get_node_vars(nodename) + local def = minetest.registered_nodes[nodename] + + if def then + return def.light_source, def.use_texture_alpha, def.sunlight_propagates + end +end + +function util.get_stair_images(images, worldaligntex) + local stair_images = {} + + for i, image in ipairs(images) do + local stair_image + + if type(image) == "string" then + stair_image = { + name = image, + backface_culling = true, + } + + else + stair_image = table.copy(image) + if stair_image.backface_culling == nil then + stair_image.backface_culling = true + end + end + + if stair_image.align_style == nil then + if worldaligntex then + stair_image.align_style = "world" + else + stair_image.align_style = default_align_style + end + end + + stair_images[i] = stair_image + end + + return stair_images +end + +stairs.util = util diff --git a/stairsplus/.luacheckrc b/stairsplus/.luacheckrc index 7c3814a..e6a8559 100644 --- a/stairsplus/.luacheckrc +++ b/stairsplus/.luacheckrc @@ -24,7 +24,6 @@ stds.minetest = { stds.stairsplus = { globals = { "stairsplus", - "stairs", -- we take over control of stairs }, read_globals = { "default", diff --git a/stairsplus/compat/init.lua b/stairsplus/compat/init.lua index 95e9b4f..1ae668a 100644 --- a/stairsplus/compat/init.lua +++ b/stairsplus/compat/init.lua @@ -20,5 +20,4 @@ stairsplus.compat = { stairsplus.dofile("compat", "i3") stairsplus.dofile("compat", "unified_inventory") -stairsplus.dofile("compat", "stairs") stairsplus.dofile("compat", "old_moreblocks") diff --git a/stairsplus/mod.conf b/stairsplus/mod.conf index 4d76446..81fc53e 100644 --- a/stairsplus/mod.conf +++ b/stairsplus/mod.conf @@ -2,4 +2,4 @@ name = stairsplus version = 3.0.0 title = Stairs+ description = Microblock API -optional_depends = default, i3, stairs, unified_inventory +optional_depends = i3, unified_inventory diff --git a/stairsplus_legacy/default.lua b/stairsplus_legacy/default.lua index d831add..3c09225 100644 --- a/stairsplus_legacy/default.lua +++ b/stairsplus_legacy/default.lua @@ -1,85 +1,47 @@ -if stairsplus_legacy.has.stairs then - stairsplus.compat.override_stairs("wood", "default:wood") - stairsplus.compat.override_stairs("junglewood", "default:junglewood") - stairsplus.compat.override_stairs("pine_wood", "default:pine_wood") - stairsplus.compat.override_stairs("acacia_wood", "default:acacia_wood") - stairsplus.compat.override_stairs("aspen_wood", "default:aspen_wood") - stairsplus.compat.override_stairs("cobble", "default:cobble") - stairsplus.compat.override_stairs("stone", "default:stone") - stairsplus.compat.override_stairs("mossycobble", "default:mossycobble") - stairsplus.compat.override_stairs("stonebrick", "default:stonebrick") - stairsplus.compat.override_stairs("stone_block", "default:stone_block") - stairsplus.compat.override_stairs("desert_stone", "default:desert_stone") - stairsplus.compat.override_stairs("desert_cobble", "default:desert_cobble") - stairsplus.compat.override_stairs("desert_stonebrick", "default:desert_stonebrick") - stairsplus.compat.override_stairs("desert_stone_block", "default:desert_stone_block") - stairsplus.compat.override_stairs("sandstone", "default:sandstone") - stairsplus.compat.override_stairs("sandstonebrick", "default:sandstonebrick") - stairsplus.compat.override_stairs("sandstone_block", "default:sandstone_block") - stairsplus.compat.override_stairs("desert_sandstone", "default:desert_sandstone") - stairsplus.compat.override_stairs("desert_sandstone_brick", "default:desert_sandstone_brick") - stairsplus.compat.override_stairs("desert_sandstone_block", "default:desert_sandstone_block") - stairsplus.compat.override_stairs("silver_sandstone", "default:silver_sandstone") - stairsplus.compat.override_stairs("silver_sandstone_brick", "default:silver_sandstone_brick") - stairsplus.compat.override_stairs("silver_sandstone_block", "default:silver_sandstone_block") - stairsplus.compat.override_stairs("obsidian", "default:obsidian") - stairsplus.compat.override_stairs("obsidianbrick", "default:obsidianbrick") - stairsplus.compat.override_stairs("obsidian_block", "default:obsidian_block") - stairsplus.compat.override_stairs("brick", "default:brick") - stairsplus.compat.override_stairs("steelblock", "default:steelblock") - stairsplus.compat.override_stairs("tinblock", "default:tinblock") - stairsplus.compat.override_stairs("copperblock", "default:copperblock") - stairsplus.compat.override_stairs("bronzeblock", "default:bronzeblock") - stairsplus.compat.override_stairs("goldblock", "default:goldblock") - stairsplus.compat.override_stairs("ice", "default:ice") - stairsplus.compat.override_stairs("snowblock", "default:snowblock") - stairsplus.compat.override_stairs("glass", "default:glass", nil, {ignore_paramtype2 = true}) - stairsplus.compat.override_stairs("obsidian_glass", "default:obsidian_glass", nil, {ignore_paramtype2 = true}) -end - local default_nodes = { -- Default stairs/slabs/panels/microblocks: - "stone", - "stone_block", - "cobble", - "mossycobble", - "brick", - "sandstone", - "steelblock", - "goldblock", - "copperblock", - "bronzeblock", - "diamondblock", - "tinblock", - "desert_stone", - "desert_stone_block", - "desert_cobble", - "meselamp", - "tree", - "wood", - "jungletree", - "junglewood", - "pine_tree", - "pine_wood", "acacia_tree", "acacia_wood", "aspen_tree", "aspen_wood", + "brick", + "bronzeblock", + "cobble", + "copperblock", + "coral_skeleton", + "default:ice", + "desert_cobble", + "desert_sandstone", + "desert_sandstone_block", + "desert_sandstone_brick", + "desert_stone", + "desert_stone_block", + "desert_stonebrick", + "diamondblock", + "goldblock", + "ice", + "jungletree", + "junglewood", + "meselamp", + "mossycobble", "obsidian", "obsidian_block", "obsidianbrick", - "stonebrick", - "desert_stonebrick", + "pine_tree", + "pine_wood", + "sandstone", + "sandstone_block", "sandstonebrick", "silver_sandstone", - "silver_sandstone_brick", "silver_sandstone_block", - "desert_sandstone", - "desert_sandstone_brick", - "desert_sandstone_block", - "sandstone_block", - "coral_skeleton", - "ice", - "sand", -- TODO tmp remove + "silver_sandstone_brick", + "snowblock", + "steelblock", + "stone", + "stone_block", + "stonebrick", + "tinblock", + "tree", + "wood", } for _, name in ipairs(default_nodes) do @@ -87,6 +49,7 @@ for _, name in ipairs(default_nodes) do if minetest.registered_nodes[node] then stairsplus_legacy.register_legacy(node) stairsplus.api.register_alias_all(("moreblocks:%s"):format(name), node) + stairsplus.api.register_alias_all(("stairs:%s"):format(name), node) end end @@ -101,6 +64,7 @@ for _, name in ipairs(glass) do if minetest.registered_nodes[node] then stairsplus_legacy.register_legacy(node, nil, {ignore_paramtype2 = true}) stairsplus.api.register_alias_all(("moreblocks:%s"):format(name), node) + stairsplus.api.register_alias_all(("stairs:%s"):format(name), node) end end diff --git a/stairsplus_legacy/farming.lua b/stairsplus_legacy/farming.lua index d832d30..f40329c 100644 --- a/stairsplus_legacy/farming.lua +++ b/stairsplus_legacy/farming.lua @@ -1,12 +1,9 @@ -if stairsplus_legacy.has.stairs then - stairsplus.compat.override_stairs("straw", "farming:straw") -end - local farming_nodes = {"straw"} for _, name in pairs(farming_nodes) do local node = ("farming:%s"):format(name) if minetest.registered_nodes[node] then stairsplus_legacy.register_legacy(node) stairsplus.api.register_alias_all(("moreblocks:%s"):format(name), node) + stairsplus.api.register_alias_all(("stairs:%s"):format(name), node) end end