Major refactor, put compat ingredients in namespace tables

This commit is contained in:
James David Clarke
2023-12-27 17:11:42 +00:00
parent 26a8ab3dd0
commit 58df66b7bc
46 changed files with 276 additions and 309 deletions

View File

@ -19,9 +19,9 @@ if technic_cnc.use_technic then
minetest.register_craft({
output = 'technic:cnc',
recipe = {
{glass_ingredient, 'technic:diamond_drill_head', glass_ingredient},
{'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'},
{'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'},
{technic_cnc.compat.glass_ingredient, 'technic:diamond_drill_head', technic_cnc.compat.glass_ingredient},
{'technic:control_logic_unit', 'technic:machine_casing', 'basic_materials:motor'},
{'technic:carbon_steel_ingot', 'technic:lv_cable', 'technic:carbon_steel_ingot'},
},
})
@ -34,9 +34,9 @@ else
minetest.register_craft({
output = 'technic:cnc',
recipe = {
{glass_ingredient, diamond_ingredient, glass_ingredient},
{'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'},
{'default:steel_ingot', mese_block_ingredient, 'default:steel_ingot'},
{technic_cnc.compat.glass_ingredient, technic_cnc.compat.diamond_ingredient, technic_cnc.compat.glass_ingredient},
{'basic_materials:ic', 'default:steelblock', 'basic_materials:motor'},
{'default:steel_ingot', technic_cnc.compat.mese_block_ingredient, 'default:steel_ingot'},
},
})

View File

@ -7,6 +7,14 @@ technic_cnc.technic_modpath = minetest.get_modpath("technic")
technic_cnc.use_technic = technic_cnc.technic_modpath
and minetest.settings:get_bool("technic_cnc_use_technic") ~= false
local mcl = minetest.get_modpath("mcl_core")
-- Compatibility table
technic_cnc.compat = {}
technic_cnc.compat.glass_ingredient = mcl and "mcl_core:glass" or 'default:glass'
technic_cnc.compat.mese_block_ingredient = mcl and "mesecons_torch:redstoneblock" or "default:mese"
technic_cnc.compat.diamond_ingredient = mcl and "mcl_core:diamond" or "default:diamond"
if rawget(_G, "intllib") then
technic_cnc.getter = intllib.Getter()
else