mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-28 12:40:20 +02:00
bugfixes for legacy stairsplus support
This commit is contained in:
@ -1,12 +1,19 @@
|
||||
-- not every fork of basic_materials has all the nodes
|
||||
if minetest.registered_nodes["basic_materials:concrete_block"] then
|
||||
local materials = stairsplus_legacy.materials
|
||||
|
||||
if materials.concrete_block and materials.concrete_block ~= "basic_materials:concrete_block" then
|
||||
stairsplus.api.register_alias_all("basic_materials:concrete_block", materials.concrete_block)
|
||||
elseif minetest.registered_nodes["basic_materials:concrete_block"] then
|
||||
stairsplus_legacy.register_legacy("basic_materials:concrete_block")
|
||||
end
|
||||
|
||||
if minetest.registered_nodes["basic_materials:cement_block"] then
|
||||
if materials.cement_block and materials.cement_block ~= "basic_materials:cement_block" then
|
||||
stairsplus.api.register_alias_all("basic_materials:cement_block", materials.cement_block)
|
||||
elseif minetest.registered_nodes["basic_materials:cement_block"] then
|
||||
stairsplus_legacy.register_legacy("basic_materials:cement_block")
|
||||
end
|
||||
|
||||
if minetest.registered_nodes["basic_materials:brass_block"] then
|
||||
if materials.brass_block and materials.brass_block ~= "basic_materials:brass_block" then
|
||||
stairsplus.api.register_alias_all("basic_materials:brass_block", materials.brass_block)
|
||||
elseif minetest.registered_nodes["basic_materials:brass_block"] then
|
||||
stairsplus_legacy.register_legacy("basic_materials:brass_block")
|
||||
end
|
||||
|
@ -1,6 +1,8 @@
|
||||
if stairsplus_legacy.has.basic_materials and stairsplus_legacy.settings.basic_materials then
|
||||
stairsplus.api.register_alias_force_all("gloopblocks:cement", "basic_materials:cement_block")
|
||||
local materials = stairsplus_legacy.materials
|
||||
|
||||
else
|
||||
if materials.cement_block and materials.cement_block ~= "gloopblocks:cement" then
|
||||
stairsplus.api.register_alias_all("gloopblocks:cement", materials.cement_block)
|
||||
elseif minetest.registered_nodes["gloopblocks:cement"] then
|
||||
stairsplus_legacy.register_legacy("gloopblocks:cement")
|
||||
end
|
||||
|
||||
|
@ -32,6 +32,7 @@ stairsplus_legacy = {
|
||||
}
|
||||
|
||||
stairsplus_legacy.dofile("settings")
|
||||
stairsplus_legacy.dofile("resources")
|
||||
|
||||
function stairsplus_legacy.register_legacy(node, overrides, meta)
|
||||
if stairsplus.settings.legacy_mode then
|
||||
@ -41,30 +42,8 @@ function stairsplus_legacy.register_legacy(node, overrides, meta)
|
||||
end
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.basic_materials and stairsplus_legacy.settings.basic_materials then
|
||||
stairsplus_legacy.dofile("basic_materials")
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.default and stairsplus_legacy.settings.default then
|
||||
stairsplus_legacy.dofile("default")
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.farming and stairsplus_legacy.settings.farming then
|
||||
stairsplus_legacy.dofile("farming")
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.gloopblocks and stairsplus_legacy.settings.gloopblocks then
|
||||
stairsplus_legacy.dofile("gloopblocks")
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.technic and stairsplus_legacy.settings.technic then
|
||||
stairsplus_legacy.dofile("technic")
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.prefab and stairsplus_legacy.settings.prefab then
|
||||
stairsplus_legacy.dofile("prefab")
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.wool and stairsplus_legacy.settings.wool then
|
||||
stairsplus_legacy.dofile("wool")
|
||||
for mod, enabled in pairs(stairsplus_legacy.settings) do
|
||||
if enabled then
|
||||
stairsplus_legacy.dofile(mod)
|
||||
end
|
||||
end
|
||||
|
@ -1,9 +1,9 @@
|
||||
if stairsplus_legacy.has.basic_materials and stairsplus_legacy.settings.basic_materials then
|
||||
stairsplus.api.register_alias_force_all("prefab:concrete", "basic_materials:concrete_block")
|
||||
local materials = stairsplus_legacy.materials
|
||||
|
||||
elseif stairsplus_legacy.has.technic and stairsplus_legacy.settings.technic then
|
||||
stairsplus.api.register_alias_force_all("prefab:concrete", "technic:concrete")
|
||||
if materials.concrete_block and materials.concrete_block ~= "prefab:concrete" then
|
||||
local slab_name = stairsplus.api.format_name(materials.concrete_block, "slab_8")
|
||||
local stair_name = stairsplus.api.format_name(materials.concrete_block, "stair")
|
||||
|
||||
else
|
||||
stairsplus_legacy.register_legacy("prefab:concrete")
|
||||
minetest.register_alias_force("prefab:concrete_slab", slab_name)
|
||||
minetest.register_alias_force("prefab:concrete_stair", stair_name)
|
||||
end
|
||||
|
34
stairsplus_legacy/resources.lua
Normal file
34
stairsplus_legacy/resources.lua
Normal file
@ -0,0 +1,34 @@
|
||||
stairsplus_legacy.materials = {}
|
||||
|
||||
if stairsplus_legacy.has.prefab then
|
||||
if minetest.registered_nodes["prefab:concrete"] then
|
||||
stairsplus_legacy.materials.concrete_block = "prefab:concrete"
|
||||
end
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.gloopblocks then
|
||||
if minetest.registered_nodes["gloopblocks:cement"] then
|
||||
stairsplus_legacy.materials.cement_block = "gloopblocks:cement"
|
||||
end
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.technic then
|
||||
if minetest.registered_nodes["technic:brass_block"] then
|
||||
stairsplus_legacy.materials.brass_block = "technic:brass_block"
|
||||
end
|
||||
if minetest.registered_nodes["technic:concrete"] then
|
||||
stairsplus_legacy.materials.concrete_block = "technic:concrete"
|
||||
end
|
||||
end
|
||||
|
||||
if stairsplus_legacy.has.basic_materials then
|
||||
if minetest.registered_nodes["basic_materials:brass_block"] then
|
||||
stairsplus_legacy.materials.brass_block = "basic_materials:brass_block"
|
||||
end
|
||||
if minetest.registered_nodes["basic_materials:cement_block"] then
|
||||
stairsplus_legacy.materials.cement_block = "basic_materials:cement_block"
|
||||
end
|
||||
if minetest.registered_nodes["basic_materials:concrete_block"] then
|
||||
stairsplus_legacy.materials.concrete_block = "basic_materials:concrete_block"
|
||||
end
|
||||
end
|
@ -1,9 +1,13 @@
|
||||
if stairsplus_legacy.has.basic_materials and stairsplus_legacy.settings.basic_materials then
|
||||
stairsplus.api.register_alias_force_all("technic:brass_block", "basic_materials:concrete_block")
|
||||
stairsplus.api.register_alias_force_all("technic:brass_block", "basic_materials:brass_block")
|
||||
local materials = stairsplus_legacy.materials
|
||||
|
||||
else
|
||||
stairsplus_legacy.register_legacy("technic:brass_block")
|
||||
if materials.concrete_block and materials.concrete_block ~= "technic:concrete" then
|
||||
stairsplus.api.register_alias_all("technic:concrete", materials.concrete_block)
|
||||
elseif minetest.registered_nodes["technic:concrete"] then
|
||||
stairsplus_legacy.register_legacy("technic:concrete")
|
||||
end
|
||||
|
||||
if materials.brass_block and materials.brass_block ~= "technic:brass_block" then
|
||||
stairsplus.api.register_alias_all("technic:brass_block", materials.brass_block)
|
||||
elseif minetest.registered_nodes["technic:brass_block"] then
|
||||
stairsplus_legacy.register_legacy("technic:brass_block")
|
||||
end
|
||||
|
Reference in New Issue
Block a user