corn.lua 4.7 KB

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