init.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. stations = {}
  2. local is_uninv = minetest.global_exists("unified_inventory") or false
  3. function stations.dual_register_recipe(craft_type, def)
  4. if is_uninv then
  5. local input_list = {}
  6. for item, count in pairs(def.input) do
  7. table.insert(input_list, item..' '..count)
  8. end
  9. local output_name
  10. if def.output then
  11. def.output = ItemStack(def.output)
  12. output_name = def.output:get_name()
  13. else
  14. output_name = "none" -- special value for recipes with no output.
  15. end
  16. unified_inventory.register_craft({
  17. type = craft_type,
  18. items = input_list,
  19. output = output_name
  20. })
  21. end
  22. simplecrafting_lib.register(craft_type, def)
  23. end
  24. dofile(minetest.get_modpath('stations')..'/craftitems.lua')
  25. dofile(minetest.get_modpath('stations')..'/recipes_anvil.lua')
  26. dofile(minetest.get_modpath('stations')..'/recipes_crystal_w.lua')
  27. dofile(minetest.get_modpath('stations')..'/recipes_mortar.lua')
  28. dofile(minetest.get_modpath('stations')..'/recipes_glazier.lua')
  29. dofile(minetest.get_modpath('stations')..'/recipes_sewing.lua')
  30. dofile(minetest.get_modpath('stations')..'/recipes_spinning_wheel.lua')
  31. dofile(minetest.get_modpath('stations')..'/recipes_woodworking.lua')
  32. dofile(minetest.get_modpath('stations')..'/recipes.lua')
  33. dofile(minetest.get_modpath('stations')..'/scrolls.lua')
  34. dofile(minetest.get_modpath('stations')..'/station_anvil.lua')
  35. dofile(minetest.get_modpath('stations')..'/station_crystals.lua')
  36. dofile(minetest.get_modpath('stations')..'/station_dying.lua')
  37. dofile(minetest.get_modpath('stations')..'/station_fuel_pucks.lua')
  38. dofile(minetest.get_modpath('stations')..'/station_mortar.lua')
  39. dofile(minetest.get_modpath('stations')..'/station_printing.lua')
  40. dofile(minetest.get_modpath('stations')..'/station_glazier.lua')
  41. dofile(minetest.get_modpath('stations')..'/station_spinning_wheel.lua')
  42. dofile(minetest.get_modpath('stations')..'/station_sewing.lua')
  43. dofile(minetest.get_modpath('stations')..'/station_stain.lua')
  44. dofile(minetest.get_modpath('stations')..'/station_weaving_loom.lua')
  45. dofile(minetest.get_modpath('stations')..'/station_woodworking.lua')