crafting_prepare.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. -- Registering some dummy items and recipes for the crafting tests
  2. minetest.register_craftitem("unittests:torch", {
  3. description = "Crafting Test Item: Torch",
  4. inventory_image = "unittests_torch.png",
  5. groups = { dummy = 1 },
  6. })
  7. minetest.register_craftitem("unittests:coal_lump", {
  8. description = "Crafting Test Item: Coal Lump",
  9. inventory_image = "unittests_coal_lump.png",
  10. groups = { dummy = 1 },
  11. })
  12. minetest.register_craftitem("unittests:stick", {
  13. description = "Crafting Test Item: Stick",
  14. inventory_image = "unittests_stick.png",
  15. groups = { dummy = 1 },
  16. })
  17. minetest.register_craftitem("unittests:iron_lump", {
  18. description = "Crafting Test Item: Iron Lump",
  19. inventory_image = "unittests_iron_lump.png",
  20. groups = { dummy = 1 },
  21. })
  22. minetest.register_craftitem("unittests:steel_ingot", {
  23. description = "Crafting Test Item: Steel Ingot",
  24. inventory_image = "unittests_steel_ingot.png",
  25. groups = { dummy = 1 },
  26. })
  27. -- Recipes for tests: Normal crafting, cooking and fuel
  28. minetest.register_craft({
  29. output = 'unittests:torch 4',
  30. recipe = {
  31. {'unittests:coal_lump'},
  32. {'unittests:stick'},
  33. }
  34. })
  35. minetest.register_craft({
  36. type = "cooking",
  37. output = "unittests:steel_ingot",
  38. recipe = "unittests:iron_lump",
  39. })
  40. minetest.register_craft({
  41. type = "fuel",
  42. recipe = "unittests:coal_lump",
  43. burntime = 40,
  44. })
  45. -- Test tool repair
  46. minetest.register_craft({
  47. type = "toolrepair",
  48. additional_wear = -0.05,
  49. })
  50. -- Test the disable_repair=1 group
  51. minetest.register_tool("unittests:unrepairable_tool", {
  52. description = "Crafting Test Item: Unrepairable Tool",
  53. inventory_image = "unittests_unrepairable_tool.png",
  54. tool_capabilities = {
  55. groupcaps = {
  56. cracky = {
  57. times = {3, 2, 1},
  58. }
  59. }
  60. },
  61. groups = { disable_repair = 1, dummy = 1 }
  62. })
  63. minetest.register_tool("unittests:repairable_tool", {
  64. description = "Crafting Test Item: Repairable Tool",
  65. inventory_image = "unittests_repairable_tool.png",
  66. tool_capabilities = {
  67. groupcaps = {
  68. cracky = {
  69. times = {3, 2, 1},
  70. }
  71. }
  72. },
  73. groups = { dummy = 1 },
  74. })