crafts.lua 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. -- internationalization boilerplate
  2. local MP = minetest.get_modpath(minetest.get_current_modname())
  3. local S, NS = dofile(MP.."/intllib.lua")
  4. if minetest.get_modpath("farming") then
  5. -- this doesn't work reliably due to side effects of https://github.com/minetest/minetest/issues/5518
  6. -- local old_def = minetest.registered_craftitems["farming:cotton"]
  7. -- if old_def then
  8. -- old_def.groups["thread"] = 1
  9. -- minetest.override_item("farming:cotton", {
  10. -- groups = old_def.groups
  11. -- })
  12. -- end
  13. minetest.register_craft({
  14. output = 'ropes:ropesegment',
  15. recipe = {
  16. {'farming:cotton','farming:cotton'},
  17. {'farming:cotton','farming:cotton'},
  18. {'farming:cotton','farming:cotton'},
  19. }
  20. })
  21. end
  22. if minetest.get_modpath("hemp") then
  23. minetest.register_craft({
  24. output = 'ropes:ropesegment',
  25. recipe = {
  26. {'hemp:hemp_rope'},
  27. {'hemp:hemp_rope'},
  28. }
  29. })
  30. end
  31. if minetest.get_modpath("cottages") then
  32. minetest.register_craft({
  33. output = 'ropes:ropesegment',
  34. recipe = {
  35. {'cottages:rope'},
  36. {'cottages:rope'},
  37. }
  38. })
  39. end
  40. minetest.register_craft({
  41. output = 'ropes:ropesegment',
  42. recipe = {
  43. {'group:thread','group:thread'},
  44. {'group:thread','group:thread'},
  45. {'group:thread','group:thread'},
  46. }
  47. })
  48. minetest.register_craftitem("ropes:ropesegment", {
  49. description = S("Rope Segment"),
  50. _doc_items_longdesc = ropes.doc.ropesegment_longdesc,
  51. _doc_items_usagehelp = ropes.doc.ropesegment_usage,
  52. groups = {vines = 1},
  53. inventory_image = "ropes_item.png",
  54. })
  55. local cotton_burn_time = 1
  56. ropes.wood_burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack("default:wood")}}).time
  57. ropes.rope_burn_time = cotton_burn_time * 6
  58. local stick_burn_time = minetest.get_craft_result({method="fuel", width=1, items={ItemStack("default:stick")}}).time
  59. ropes.ladder_burn_time = ropes.rope_burn_time * 2 + stick_burn_time * 3
  60. minetest.register_craft({
  61. type = "fuel",
  62. recipe = "ropes:ropesegment",
  63. burntime = ropes.rope_burn_time,
  64. })