alloy_recipes.lua 766 B

123456789101112131415161718192021222324
  1. local recipes = {
  2. {"default:ice", tf_recipes.glass.." 4",tf_recipes.glasswater.." 4",3},
  3. {"default:snowblock", tf_recipes.glass.." 4",tf_recipes.glasswater.." 4",1},
  4. {"moreblocks:micro_ice 2", tf_recipes.glass,tf_recipes.glasswater,1},
  5. }
  6. -- register recipes
  7. for _, data in pairs(recipes) do
  8. local alloy_time = data[4] or 1
  9. local b_registered = true
  10. for i=1,3 do
  11. if data[i] then
  12. local item_name = string.split(data[i],' ')[1]
  13. b_registered = b_registered and (minetest.registered_items[item_name] ~= nil)
  14. else
  15. b_registered = false
  16. end
  17. end
  18. if b_registered then
  19. technic.register_alloy_recipe({input = {data[1], data[2]}, output = data[3], time = alloy_time})
  20. end
  21. end