sorcery  compat.lua at [9278734b41]

File compat.lua artifact bd8d2ccd93 part of check-in 9278734b41


local brass, silver

if minetest.get_modpath("moreores") then
	silver = 'moreores:silver'
else
	minetest.register_alias('moreores:silver_ingot','sorcery:silver_ingot')
	minetest.register_alias('moreores:silver_block','sorcery:silver_block')
end

if minetest.get_modpath("basic_materials") then
	brass = 'basic_materials:brass'
elseif minetest.get_modpath("morelights") then
	brass = 'morelights_vintage:brass'
else
	minetest.register_alias('basic_materials:brass_ingot', 'sorcery:brass_ingot')
	minetest.register_alias('basic_materials:brass_block', 'sorcery:brass_block')
	minetest.register_alias('morelights_vintage:brass_block', 'sorcery:brass_block')
	minetest.register_alias('morelights_vintage:brass_ingot', 'sorcery:brass_ingot')
end

if brass then
	minetest.register_alias('sorcery:brass_ingot',brass..'_ingot')
	minetest.register_alias('sorcery:brass_block',brass..'_block')
end
if silver then
	minetest.register_alias('sorcery:silver_ingot',silver..'_ingot')
	minetest.register_alias('sorcery:silver_block',silver..'_block')
end

return {
	defp = function(name)
		return minetest.registered_items[name] or minetest.registered_aliases[name]
	end
}