corn.lua 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. -- cornstarch
  30. minetest.register_craftitem("farming:cornstarch", {
  31. description = S("Cornstarch"),
  32. inventory_image = "farming_cornstarch.png",
  33. groups = {food_cornstarch = 1, flammable = 2}
  34. })
  35. minetest.register_craft({
  36. output = "farming:cornstarch",
  37. recipe = {
  38. {"group:food_mortar_pestle", "group:food_corn_cooked", "group:food_baking_tray"},
  39. {"", "group:food_bowl", ""},
  40. },
  41. replacements = {
  42. {"group:food_mortar_pestle", "farming:mortar_pestle"},
  43. {"group:food_baking_tray", "farming:baking_tray"},
  44. }
  45. })
  46. -- ethanol (thanks to JKMurray for this idea)
  47. minetest.register_node("farming:bottle_ethanol", {
  48. description = S("Bottle of Ethanol"),
  49. drawtype = "plantlike",
  50. tiles = {"farming_bottle_ethanol.png"},
  51. inventory_image = "farming_bottle_ethanol.png",
  52. wield_image = "farming_bottle_ethanol.png",
  53. paramtype = "light",
  54. is_ground_content = false,
  55. walkable = false,
  56. selection_box = {
  57. type = "fixed",
  58. fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
  59. },
  60. groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
  61. sounds = default.node_sound_glass_defaults()
  62. })
  63. minetest.register_craft( {
  64. output = "farming:bottle_ethanol",
  65. recipe = {
  66. { "vessels:glass_bottle", "group:food_corn", "group:food_corn"},
  67. { "group:food_corn", "group:food_corn", "group:food_corn"},
  68. { "group:food_corn", "group:food_corn", "group:food_corn"}
  69. }
  70. })
  71. minetest.register_craft({
  72. type = "fuel",
  73. recipe = "farming:bottle_ethanol",
  74. burntime = 80,
  75. replacements = {{ "farming:bottle_ethanol", "vessels:glass_bottle"}}
  76. })
  77. -- corn definition
  78. local def = {
  79. drawtype = "plantlike",
  80. tiles = {"farming_corn_1.png"},
  81. paramtype = "light",
  82. sunlight_propagates = true,
  83. walkable = false,
  84. buildable_to = true,
  85. drop = "",
  86. selection_box = farming.select,
  87. groups = {
  88. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  89. not_in_creative_inventory = 1, growing = 1
  90. },
  91. sounds = default.node_sound_leaves_defaults()
  92. }
  93. -- stage 1
  94. minetest.register_node("farming:corn_1", table.copy(def))
  95. -- stage 2
  96. def.tiles = {"farming_corn_2.png"}
  97. minetest.register_node("farming:corn_2", table.copy(def))
  98. -- stage 3
  99. def.tiles = {"farming_corn_3.png"}
  100. minetest.register_node("farming:corn_3", table.copy(def))
  101. -- stage 4
  102. def.tiles = {"farming_corn_4.png"}
  103. minetest.register_node("farming:corn_4", table.copy(def))
  104. -- stage 5
  105. def.tiles = {"farming_corn_5.png"}
  106. minetest.register_node("farming:corn_5", table.copy(def))
  107. -- stage 6
  108. def.tiles = {"farming_corn_6.png"}
  109. def.visual_scale = 1.9
  110. minetest.register_node("farming:corn_6", table.copy(def))
  111. -- stage 7
  112. def.tiles = {"farming_corn_7.png"}
  113. def.drop = {
  114. items = {
  115. {items = {"farming:corn"}, rarity = 1},
  116. {items = {"farming:corn"}, rarity = 2},
  117. {items = {"farming:corn"}, rarity = 3}
  118. }
  119. }
  120. minetest.register_node("farming:corn_7", table.copy(def))
  121. -- stage 8 (final)
  122. def.tiles = {"farming_corn_8.png"}
  123. def.groups.growing = nil
  124. def.drop = {
  125. items = {
  126. {items = {"farming:corn 2"}, rarity = 1},
  127. {items = {"farming:corn 2"}, rarity = 2},
  128. {items = {"farming:corn 2"}, rarity = 2}
  129. }
  130. }
  131. minetest.register_node("farming:corn_8", table.copy(def))
  132. -- add to registered_plants
  133. farming.registered_plants["farming:corn"] = {
  134. crop = "farming:corn",
  135. seed = "farming:corn",
  136. minlight = farming.min_light,
  137. maxlight = farming.max_light,
  138. steps = 8
  139. }