473 lines
11 KiB
Lua
473 lines
11 KiB
Lua
-- check for Unified Inventory
|
|
local is_uninv = minetest.global_exists("unified_inventory") or false
|
|
|
|
local function dual_register_recipe(craft_type, def)
|
|
if is_uninv then
|
|
local input_list = {}
|
|
for item, count in pairs(def.input) do
|
|
table.insert(input_list, item..' '..count)
|
|
end
|
|
|
|
-- divide the output name the same way simple crafting does...
|
|
--
|
|
local output_name
|
|
if def.output then
|
|
def.output = ItemStack(def.output)
|
|
output_name = def.output:get_name()
|
|
else
|
|
output_name = "none" -- special value for recipes with no output.
|
|
end
|
|
|
|
-- register with unified inventory
|
|
-- make sure the station has been registered as well using unified_inventory.register_craft_type()
|
|
--
|
|
unified_inventory.register_craft({
|
|
type = craft_type,
|
|
items = input_list,
|
|
output = output_name
|
|
})
|
|
end
|
|
|
|
-- register with simple crafting
|
|
--
|
|
simplecrafting_lib.register(craft_type, def)
|
|
end
|
|
|
|
local tool_repair ={
|
|
{'default:axe_steel', 'default:steel_ingot'},
|
|
{'default:pick_steel', 'default:steel_ingot'},
|
|
{'default:shovel_steel', 'default:steel_ingot'},
|
|
{'default:sword_steel', 'default:steel_ingot'},
|
|
{'farming:hoe_steel', 'default:steel_ingot'},
|
|
{'mobs:shears', 'default:steel_ingot'},
|
|
{'default:axe_bronze', 'default:bronze_ingot'},
|
|
{'default:pick_bronze', 'default:bronze_ingot'},
|
|
{'default:shovel_bronze', 'default:bronze_ingot'},
|
|
{'default:sword_bronze', 'default:bronze_ingot'},
|
|
{'default:axe_mese', 'default:mese_crystal'},
|
|
{'default:pick_mese', 'default:mese_crystal'},
|
|
{'default:shovel_mese', 'default:mese_crystal'},
|
|
{'default:sword_mese', 'default:mese_crystal'},
|
|
{'3d_armor:boots_bronze', 'default:bronze_ingot'},
|
|
{'3d_armor:boots_steel', 'default:steel_ingot'},
|
|
{'3d_armor:boots_gold', 'default:gold_ingot'},
|
|
{'3d_armor:chestplate_bronze', 'default:bronze_ingot'},
|
|
{'3d_armor:chestplate_steel', 'default:steel_ingot'},
|
|
{'3d_armor:chestplate_gold', 'default:gold_ingot'},
|
|
{'3d_armor:helmet_bronze', 'default:bronze_ingot'},
|
|
{'3d_armor:helmet_steel', 'default:steel_ingot'},
|
|
{'3d_armor:helmet_gold', 'default:gold_ingot'},
|
|
{'3d_armor:leggings_bronze', 'default:bronze_ingot'},
|
|
{'3d_armor:leggings_gold', 'default:gold_ingot'},
|
|
{'3d_armor:leggings_steel', 'default:steel_ingot'},
|
|
{'shields:shield_bronze', 'default:bronze_ingot'},
|
|
{'shields:shield_steel', 'default:steel_ingot'},
|
|
{'shields:shield_gold', 'default:gold_ingot'},
|
|
{'castle_weapons:battleaxe', 'default:steel_ingot'},
|
|
{'castle_weapons:crossbow', 'default:steel_ingot'},
|
|
{'stations:hammer', 'default:steel_ingot'},
|
|
{'epic:pick_titanium', 'epic:titanium_ingot'},
|
|
{'epic:shovel_titanium', 'epic:titanium_ingot'},
|
|
{'epic:axe_titanium', 'epic:titanium_ingot'},
|
|
{'epic:sword_titanium', 'epic:titanium_ingot'},
|
|
{'epic:helmet_titanium', 'epic:titanium_ingot'},
|
|
{'epic:boots_titanium', 'epic:titanium_ingot'},
|
|
{'epic:chestplate_titanium', 'epic:titanium_ingot'},
|
|
{'epic:leggings_titanium', 'epic:titanium_ingot'},
|
|
{'epic:shield_titanium', 'epic:titanium_ingot'},
|
|
{'epic:shovel_soft', 'default:tin_ingot'},
|
|
{'farming:scythe', 'epic:titanium_ingot'},
|
|
{'torch_bomb:torch_crossbow_steel', 'default:steel_ingot'},
|
|
{'torch_bomb:torch_crossbow_bronze', 'default:bronze_ingot'}
|
|
}
|
|
|
|
for i in ipairs (tool_repair) do
|
|
local tool = tool_repair[i][1]
|
|
local material = tool_repair[i][2]
|
|
|
|
-- no dual_register_recipe() to ignore registering repair recipes...
|
|
--
|
|
simplecrafting_lib.register('anvil', {
|
|
input = {
|
|
[tool] = 1,
|
|
[material] = 1,
|
|
},
|
|
output = tool,
|
|
})
|
|
end
|
|
|
|
--Steel Tools
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 3,
|
|
['group:stick'] = 1,
|
|
},
|
|
output = 'default:pick_steel',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 3,
|
|
['group:stick'] = 1,
|
|
},
|
|
output = 'default:axe_steel',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 1,
|
|
['default:stick'] = 2,
|
|
},
|
|
output = 'default:shovel_steel',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 3,
|
|
},
|
|
output = 'default:sword_steel',
|
|
})
|
|
|
|
--Bronze tools
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:bronze_ingot'] = 3,
|
|
['group:stick'] = 1,
|
|
},
|
|
output = 'default:pick_bronze',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:bronze_ingot'] = 3,
|
|
['group:stick'] = 1,
|
|
},
|
|
output = 'default:axe_bronze',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:bronze_ingot'] = 1,
|
|
['group:stick'] = 2,
|
|
},
|
|
output = 'default:shovel_bronze',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:bronze_ingot'] = 3,
|
|
},
|
|
output = 'default:sword_bronze',
|
|
})
|
|
|
|
--Mese tools
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:mese_crystal'] = 3,
|
|
['group:stick'] = 1,
|
|
},
|
|
output = 'default:pick_mese',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:mese_crystal'] = 3,
|
|
['group:stick'] = 1,
|
|
},
|
|
output = 'default:axe_mese',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:mese_crystal'] = 1,
|
|
['group:stick'] = 2,
|
|
},
|
|
output = 'default:shovel_mese',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:mese_crystal'] = 3,
|
|
},
|
|
output = 'default:sword_mese',
|
|
})
|
|
|
|
--Titanium tools
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['epic:titanium_ingot'] = 3,
|
|
['darkage:iron_stick'] = 1,
|
|
},
|
|
output = 'epic:pick_titanium',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['epic:titanium_ingot'] = 1,
|
|
['darkage:iron_stick'] = 2,
|
|
},
|
|
output = 'epic:shovel_titanium',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['epic:titanium_ingot'] = 3,
|
|
['darkage:iron_stick'] = 1,
|
|
},
|
|
output = 'epic:axe_titanium',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['epic:titanium_ingot'] = 3,
|
|
},
|
|
output = 'epic:sword_titanium',
|
|
})
|
|
|
|
--Misc
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['ropes:ropesegment'] = 1,
|
|
['default:steel_ingot'] = 2,
|
|
},
|
|
output = 'epic:sign_post_metal',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['ocean:prismarine_crystals'] = 1,
|
|
['epic:bloodstone'] = 1,
|
|
['default:steel_ingot'] = 1,
|
|
},
|
|
output = 'furniture:lantern_ceiling',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:tin_ingot'] = 3,
|
|
['darkage:iron_stick'] = 2,
|
|
},
|
|
output = 'epic:shovel_soft',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 6,
|
|
},
|
|
output = 'castle_weapons:battleaxe',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['epic:titanium_ingot'] = 2,
|
|
['group:stick'] = 1,
|
|
},
|
|
output = 'farming:scythe',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 4,
|
|
['default:tin_ingot'] = 1,
|
|
},
|
|
output = 'stations:stain',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 1,
|
|
},
|
|
output = 'epic:arrow_tip 20',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 1,
|
|
},
|
|
output = 'mobs:horseshoe_steel',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:bronze_ingot'] = 1,
|
|
},
|
|
output = 'mobs:horseshoe_bronze',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:mese_crystal'] = 1,
|
|
},
|
|
output = 'mobs:horseshoe_mese',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 2,
|
|
},
|
|
output = 'scaffolding:scaffolding_wrench',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['epic:lead_lump'] = 1,
|
|
},
|
|
output = 'epic:lead_wire 10',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 1,
|
|
},
|
|
output = 'furniture:hinge 10',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 1,
|
|
},
|
|
output = 'furniture:lock',
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:steel_ingot'] = 2,
|
|
},
|
|
output = 'default:sign_wall_steel',
|
|
})
|
|
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:diamondblock'] = 1,
|
|
['default:goldblock'] = 1,
|
|
['epic:titanium_ingot'] = 1,
|
|
['epic:glowingdiamond'] = 1,
|
|
},
|
|
output = 'filler:filler',
|
|
})
|
|
|
|
--3d_Armor recipes
|
|
local armor_material = {
|
|
steel = 'default:steel_ingot',
|
|
bronze = 'default:bronze_ingot',
|
|
gold = 'default:gold_ingot',
|
|
titanium = 'epic:titanium_ingot',
|
|
}
|
|
|
|
for name, mat in pairs(armor_material) do
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 5,
|
|
['mobs:leather'] = 1,
|
|
},
|
|
output = '3d_armor:helmet_'..name,
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 8,
|
|
['mobs:leather'] = 1,
|
|
},
|
|
output = '3d_armor:chestplate_'..name,
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 7,
|
|
['mobs:leather'] = 1,
|
|
},
|
|
output = '3d_armor:leggings_'..name,
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 4,
|
|
['mobs:leather'] = 1,
|
|
},
|
|
output = '3d_armor:boots_'..name,
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 7,
|
|
},
|
|
output = 'shields:shield_'..name,
|
|
})
|
|
end
|
|
|
|
--Armor recipes
|
|
local armor_material = {
|
|
titanium = 'epic:titanium_ingot',
|
|
}
|
|
|
|
for name, mat in pairs(armor_material) do
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 5,
|
|
['mobs:leather'] = 1,
|
|
},
|
|
output = 'epic:helmet_'..name,
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 8,
|
|
['mobs:leather'] = 1,
|
|
},
|
|
output = 'epic:chestplate_'..name,
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 7,
|
|
['mobs:leather'] = 1,
|
|
},
|
|
output = 'epic:leggings_'..name,
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 4,
|
|
['mobs:leather'] = 1,
|
|
},
|
|
output = 'epic:boots_'..name,
|
|
})
|
|
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
[mat] = 7,
|
|
},
|
|
output = 'epic:shield_'..name,
|
|
})
|
|
end
|
|
--[[ only needed once I find out how to use the fuel stuff.
|
|
dual_register_recipe('anvil_fuel', {
|
|
input = {['default:coal_lump'] = 1},
|
|
output = 'simplecrafting_lib:heat 20',
|
|
})
|
|
|
|
dual_register_recipe('anvil_fuel', {
|
|
input = {['default:coalblock'] = 1},
|
|
output = 'simplecrafting_lib:heat 180',
|
|
})
|
|
|
|
dual_register_recipe('anvil_fuel', {
|
|
input = {['charcoal:charcoal'] = 1},
|
|
output = 'simplecrafting_lib:heat 15',
|
|
})
|
|
|
|
dual_register_recipe('anvil_fuel', {
|
|
input = {['charcoal:charcoal_block'] = 1},
|
|
output = 'simplecrafting_lib:heat 135',
|
|
})
|
|
--]]
|
|
|
|
--shapes
|
|
dual_register_recipe('anvil', {
|
|
input = {
|
|
['default:gold_ingot'] = 1,
|
|
},
|
|
output = 'shapes:gold_triangle_0',
|
|
})
|