corn.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. --[[
  2. Original textures from GeMinecraft
  3. http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1440575-1-2-5-generation-minecraft-beta-1-2-farming-and
  4. ]]
  5. local S = farming.intllib
  6. -- corn
  7. minetest.register_craftitem("farming:corn", {
  8. description = S("Corn"),
  9. inventory_image = "farming_corn.png",
  10. groups = {seed = 2, food_corn = 1, flammable = 2},
  11. on_place = function(itemstack, placer, pointed_thing)
  12. return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1")
  13. end,
  14. on_use = minetest.item_eat(3)
  15. })
  16. -- corn on the cob (texture by TenPlus1)
  17. minetest.register_craftitem("farming:corn_cob", {
  18. description = S("Corn on the Cob"),
  19. inventory_image = "farming_corn_cob.png",
  20. groups = {food_corn_cooked = 1, flammable = 2},
  21. on_use = minetest.item_eat(5)
  22. })
  23. minetest.register_craft({
  24. type = "cooking",
  25. cooktime = 10,
  26. output = "farming:corn_cob",
  27. recipe = "group:food_corn"
  28. })
  29. -- popcorn
  30. minetest.register_craftitem("farming:popcorn", {
  31. description = S("Popcorn"),
  32. inventory_image = "farming_popcorn.png",
  33. groups = {food_popcorn = 1, flammable = 2},
  34. on_use = minetest.item_eat(4)
  35. })
  36. minetest.register_craft({
  37. output = "farming:popcorn",
  38. recipe = {
  39. {"group:food_pot", "group:food_oil", "group:food_corn"}
  40. },
  41. replacements = {
  42. {"group:food_pot", "farming:pot"},
  43. {"group:food_oil", "vessels:glass_bottle"}
  44. }
  45. })
  46. -- cornstarch
  47. minetest.register_craftitem("farming:cornstarch", {
  48. description = S("Cornstarch"),
  49. inventory_image = "farming_cornstarch.png",
  50. groups = {food_cornstarch = 1, food_gelatin = 1, food_flammable = 2}
  51. })
  52. minetest.register_craft({
  53. output = "farming:cornstarch",
  54. recipe = {
  55. {"group:food_mortar_pestle", "group:food_corn_cooked", "group:food_baking_tray"},
  56. {"", "group:food_bowl", ""},
  57. },
  58. replacements = {
  59. {"group:food_mortar_pestle", "farming:mortar_pestle"},
  60. {"group:food_baking_tray", "farming:baking_tray"}
  61. }
  62. })
  63. -- ethanol (thanks to JKMurray for this idea)
  64. minetest.register_node("farming:bottle_ethanol", {
  65. description = S("Bottle of Ethanol"),
  66. drawtype = "plantlike",
  67. tiles = {"farming_bottle_ethanol.png"},
  68. inventory_image = "farming_bottle_ethanol.png",
  69. wield_image = "farming_bottle_ethanol.png",
  70. paramtype = "light",
  71. is_ground_content = false,
  72. walkable = false,
  73. selection_box = {
  74. type = "fixed",
  75. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  76. },
  77. groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
  78. sounds = default.node_sound_glass_defaults()
  79. })
  80. minetest.register_craft( {
  81. output = "farming:bottle_ethanol",
  82. recipe = {
  83. {"group:food_corn", "group:food_corn", "group:food_corn"},
  84. {"group:food_corn", "vessels:glass_bottle", "group:food_corn"},
  85. {"group:food_corn", "group:food_corn", "group:food_corn"}
  86. }
  87. })
  88. minetest.register_craft({
  89. type = "fuel",
  90. recipe = "farming:bottle_ethanol",
  91. burntime = 80,
  92. replacements = {{"farming:bottle_ethanol", "vessels:glass_bottle"}}
  93. })
  94. -- corn definition
  95. local def = {
  96. drawtype = "plantlike",
  97. tiles = {"farming_corn_1.png"},
  98. paramtype = "light",
  99. sunlight_propagates = true,
  100. walkable = false,
  101. buildable_to = true,
  102. drop = "",
  103. selection_box = farming.select,
  104. groups = {
  105. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  106. not_in_creative_inventory = 1, growing = 1
  107. },
  108. sounds = default.node_sound_leaves_defaults()
  109. }
  110. -- stage 1
  111. minetest.register_node("farming:corn_1", table.copy(def))
  112. -- stage 2
  113. def.tiles = {"farming_corn_2.png"}
  114. minetest.register_node("farming:corn_2", table.copy(def))
  115. -- stage 3
  116. def.tiles = {"farming_corn_3.png"}
  117. minetest.register_node("farming:corn_3", table.copy(def))
  118. -- stage 4
  119. def.tiles = {"farming_corn_4.png"}
  120. minetest.register_node("farming:corn_4", table.copy(def))
  121. -- stage 5
  122. def.tiles = {"farming_corn_5.png"}
  123. minetest.register_node("farming:corn_5", table.copy(def))
  124. -- stage 6
  125. def.tiles = {"farming_corn_6.png"}
  126. def.visual_scale = 1.9
  127. minetest.register_node("farming:corn_6", table.copy(def))
  128. -- stage 7
  129. def.tiles = {"farming_corn_7.png"}
  130. def.drop = {
  131. items = {
  132. {items = {"farming:corn"}, rarity = 1},
  133. {items = {"farming:corn"}, rarity = 2},
  134. {items = {"farming:corn"}, rarity = 3}
  135. }
  136. }
  137. minetest.register_node("farming:corn_7", table.copy(def))
  138. -- stage 8 (final)
  139. def.tiles = {"farming_corn_8.png"}
  140. def.groups.growing = nil
  141. def.drop = {
  142. items = {
  143. {items = {"farming:corn 2"}, rarity = 1},
  144. {items = {"farming:corn 2"}, rarity = 2},
  145. {items = {"farming:corn 2"}, rarity = 2}
  146. }
  147. }
  148. minetest.register_node("farming:corn_8", table.copy(def))
  149. -- add to registered_plants
  150. farming.registered_plants["farming:corn"] = {
  151. crop = "farming:corn",
  152. seed = "farming:corn",
  153. minlight = farming.min_light,
  154. maxlight = farming.max_light,
  155. steps = 8
  156. }