fermenter_recipes.lua 1008 B

12345678910111213141516171819202122232425262728
  1. local S = minetest.get_translator("default")
  2. local recipes = {
  3. {"animalworld:bucket_milk", "animalworld:cheese", 16},
  4. }
  5. for _,fruit in pairs(tf_recipes.fruits) do
  6. if minetest.registered_items[fruit[4]] then
  7. if tf_recipes.bucket ~= nil then
  8. if minetest.registered_items["technic_farming:bucket_must_"..fruit[1]] and minetest.registered_items["technic_farming:bucket_vinegar_"..fruit[1]] then
  9. table.insert(recipes,{"technic_farming:bucket_must_"..fruit[1],"technic_farming:bucket_vinegar_"..fruit[1],16})
  10. end
  11. end
  12. end
  13. end
  14. for _, data in pairs(recipes) do
  15. local fermenting_time = data[3] or 1
  16. local b_registered = true
  17. for i=1,2 do
  18. local item_name = string.split(data[i],' ')[1]
  19. b_registered = b_registered and (minetest.registered_items[item_name] ~= nil)
  20. end
  21. if b_registered then
  22. technic_farming.register_fermenting_recipe({input = {data[1]}, output = data[2], time = fermenting_time})
  23. end
  24. end