hoes.lua 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. --
  2. -- Hoes
  3. --
  4. minetest.register_tool("farming:hoe_wood", {
  5. description = "Wood Hoe",
  6. inventory_image = "farming_hoe_wood.png",
  7. tool_capabilities = {
  8. full_punch_interval = 1.2,
  9. groupcaps={
  10. crumbly = {times={[2]=2.2, [3]=1.00}, uses=10-1, maxlevel=0},
  11. }
  12. },
  13. sound = {breaks = "default_tool_breaks"},
  14. on_place = function(itemstack, placer, pointed_thing)
  15. return farming.hoe_on_use(itemstack, placer, pointed_thing.under, 30)
  16. end
  17. })
  18. minetest.register_tool("farming:hoe_stone", {
  19. description = "Stone Hoe",
  20. inventory_image = "farming_hoe_stone.png",
  21. tool_capabilities = {
  22. full_punch_interval = 1.4,
  23. groupcaps={
  24. crumbly = {times={[1]=2.00, [2]=1.40, [3]=0.80}, uses=40-1, maxlevel=0},
  25. }
  26. },
  27. sound = {breaks = "default_tool_breaks"},
  28. on_place = function(itemstack, placer, pointed_thing)
  29. return farming.hoe_on_use(itemstack, placer, pointed_thing.under, 60)
  30. end
  31. })
  32. minetest.register_tool("farming:hoe_copper", {
  33. description = "Copper Hoe",
  34. inventory_image = "farming_hoe_copper.png",
  35. tool_capabilities = {
  36. full_punch_interval = 1.2,
  37. groupcaps={
  38. crumbly = {times={[1]=1.40, [2]=1.10, [3]=0.60}, uses=30-1, maxlevel=0},
  39. }
  40. },
  41. sound = {breaks = "default_tool_breaks"},
  42. on_place = function(itemstack, placer, pointed_thing)
  43. return farming.hoe_on_use(itemstack, placer, pointed_thing.under, 40)
  44. end
  45. })
  46. minetest.register_tool(":farming:hoe_bronze", {
  47. description = "Bronze Hoe",
  48. inventory_image = "farming_hoe_bronze.png",
  49. tool_capabilities = {
  50. full_punch_interval = 1.2,
  51. groupcaps={
  52. crumbly = {times={[1]=1.20, [2]=1.00, [3]=0.50}, uses=40-1, maxlevel=0},
  53. }
  54. },
  55. sound = {breaks = "default_tool_breaks"},
  56. on_place = function(itemstack, placer, pointed_thing)
  57. return farming.hoe_on_use(itemstack, placer, pointed_thing.under, 40)
  58. end
  59. })
  60. minetest.register_tool("farming:hoe_steel", {
  61. description = "Steel Hoe",
  62. inventory_image = "farming_hoe_steel.png",
  63. tool_capabilities = {
  64. full_punch_interval = 1.1,
  65. groupcaps={
  66. crumbly = {times={[1]=1.00, [2]=0.80, [3]=0.40}, uses=60-1, maxlevel=0},
  67. }
  68. },
  69. sound = {breaks = "default_tool_breaks"},
  70. on_place = function(itemstack, placer, pointed_thing)
  71. return farming.hoe_on_use(itemstack, placer, pointed_thing.under, 120)
  72. end
  73. })
  74. minetest.register_tool("farming:hoe_mese", {
  75. description = "Mese Hoe",
  76. inventory_image = "farming_hoe_mese.png",
  77. tool_capabilities = {
  78. full_punch_interval = 1.0,
  79. groupcaps={
  80. crumbly = {times={[1]=1.0, [2]=0.60, [3]=0.20}, uses=30-1, maxlevel=0},
  81. }
  82. },
  83. sound = {breaks = "default_tool_breaks"},
  84. on_place = function(itemstack, placer, pointed_thing)
  85. d = 1
  86. for xi = -d, d do
  87. for zi = -d, d do
  88. pos = {x=pointed_thing.under.x+xi, y=pointed_thing.under.y, z=pointed_thing.under.z+zi}
  89. farming.hoe_on_use(itemstack, placer, pos, 240)
  90. end
  91. end
  92. end
  93. })
  94. --
  95. -- Crafts
  96. --
  97. minetest.register_craft({
  98. output = "farming:hoe_wood",
  99. recipe = {
  100. {"group:tree", "group:tree"},
  101. {"", "group:stick"},
  102. {"", "group:stick"}
  103. }
  104. })
  105. minetest.register_craft({
  106. output = "farming:hoe_stone",
  107. recipe = {
  108. {"default:cobble", "default:cobble"},
  109. {"", "group:stick"},
  110. {"", "group:stick"}
  111. }
  112. })
  113. minetest.register_craft({
  114. output = "farming:hoe_copper",
  115. recipe = {
  116. {"default:copper_ingot", "default:copper_ingot"},
  117. {"", "group:stick"},
  118. {"", "group:stick"}
  119. }
  120. })
  121. minetest.register_craft({
  122. output = "farming:hoe_bronze",
  123. recipe = {
  124. {"default:bronze_ingot", "default:bronze_ingot"},
  125. {"", "group:stick"},
  126. {"", "group:stick"}
  127. }
  128. })
  129. minetest.register_craft({
  130. output = "farming:hoe_steel",
  131. recipe = {
  132. {"default:steel_ingot", "default:steel_ingot"},
  133. {"", "group:stick"},
  134. {"", "group:stick"}
  135. }
  136. })
  137. minetest.register_craft({
  138. output = "farming:hoe_mese",
  139. recipe = {
  140. {"default:mese_crystal", "default:mese_crystal"},
  141. {"", "group:stick"},
  142. {"", "group:stick"}
  143. }
  144. })