Simplify usage of mcl_dyes color table

This commit is contained in:
Elias Åström 2024-07-07 22:59:00 +02:00
parent cbed4aa453
commit 58dc09a0ce
2 changed files with 6 additions and 8 deletions

View File

@ -32,12 +32,10 @@ function register_alias_if_not_exists(alias, name)
end
minetest.register_on_mods_loaded(function()
for name, cdef in pairs(mcl_dyes.colors) do
if cdef.mcl2 then
register_alias_if_not_exists("mcl_stairs:slab_concrete_"..cdef.mcl2, "mcl_stairs:slab_concrete_"..name)
register_alias_if_not_exists("mcl_stairs:slab_concrete_"..cdef.mcl2.."_double", "mcl_stairs:slab_concrete_"..name.."_double")
register_alias_if_not_exists("mcl_stairs:stair_concrete_"..cdef.mcl2, "mcl_stairs:stair_concrete_"..name)
register_alias_if_not_exists("mcl_stairs:stair_concrete_"..cdef.mcl2.."_inner", "mcl_stairs:stair_concrete_"..name.."_inner")
register_alias_if_not_exists("mcl_stairs:stair_concrete_"..cdef.mcl2.."_outer", "mcl_stairs:stair_concrete_"..name.."_outer")
end
register_alias_if_not_exists("mcl_stairs:slab_concrete_"..cdef.mcl2, "mcl_stairs:slab_concrete_"..name)
register_alias_if_not_exists("mcl_stairs:slab_concrete_"..cdef.mcl2.."_double", "mcl_stairs:slab_concrete_"..name.."_double")
register_alias_if_not_exists("mcl_stairs:stair_concrete_"..cdef.mcl2, "mcl_stairs:stair_concrete_"..name)
register_alias_if_not_exists("mcl_stairs:stair_concrete_"..cdef.mcl2.."_inner", "mcl_stairs:stair_concrete_"..name.."_inner")
register_alias_if_not_exists("mcl_stairs:stair_concrete_"..cdef.mcl2.."_outer", "mcl_stairs:stair_concrete_"..name.."_outer")
end
end)

View File

@ -6,7 +6,7 @@ mcl_dye.add_bone_meal_particle = mcl_bone_meal.add_bone_meal_particle
mcl_dye.mcl2dyes_translate = {}
for k, v in pairs(mcl_dyes.colors) do
mcl_dye.mcl2dyes_translate["mcl_dye:"..(v.mcl2 or k)] = "mcl_dyes:"..k
mcl_dye.mcl2dyes_translate["mcl_dye:"..v.mcl2] = "mcl_dyes:"..k
end
-- Override of minetest.register_craft rewrites crafing recipes that use mcl2 item names to use the mcla eqivalents.