corn.lua 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. }
  69. })
  70. minetest.register_craft({
  71. type = "fuel",
  72. recipe = "farming:bottle_ethanol",
  73. burntime = 80, --240,
  74. replacements = {{ "farming:bottle_ethanol", "vessels:glass_bottle"}}
  75. })
  76. -- corn definition
  77. local crop_def = {
  78. drawtype = "plantlike",
  79. tiles = {"farming_corn_1.png"},
  80. paramtype = "light",
  81. sunlight_propagates = true,
  82. walkable = false,
  83. buildable_to = true,
  84. drop = "",
  85. selection_box = farming.select,
  86. groups = {
  87. snappy = 3, flammable = 2, plant = 1, attached_node = 1,
  88. not_in_creative_inventory = 1, growing = 1
  89. },
  90. sounds = default.node_sound_leaves_defaults()
  91. }
  92. -- stage 1
  93. minetest.register_node("farming:corn_1", table.copy(crop_def))
  94. -- stage 2
  95. crop_def.tiles = {"farming_corn_2.png"}
  96. minetest.register_node("farming:corn_2", table.copy(crop_def))
  97. -- stage 3
  98. crop_def.tiles = {"farming_corn_3.png"}
  99. minetest.register_node("farming:corn_3", table.copy(crop_def))
  100. -- stage 4
  101. crop_def.tiles = {"farming_corn_4.png"}
  102. minetest.register_node("farming:corn_4", table.copy(crop_def))
  103. -- stage 5
  104. crop_def.tiles = {"farming_corn_5.png"}
  105. minetest.register_node("farming:corn_5", table.copy(crop_def))
  106. -- stage 6
  107. crop_def.tiles = {"farming_corn_6.png"}
  108. crop_def.visual_scale = 1.9 -- 1.45
  109. minetest.register_node("farming:corn_6", table.copy(crop_def))
  110. -- stage 7
  111. crop_def.tiles = {"farming_corn_7.png"}
  112. crop_def.drop = {
  113. items = {
  114. {items = {"farming:corn"}, rarity = 1},
  115. {items = {"farming:corn"}, rarity = 2},
  116. {items = {"farming:corn"}, rarity = 3},
  117. }
  118. }
  119. minetest.register_node("farming:corn_7", table.copy(crop_def))
  120. -- stage 8 (final)
  121. crop_def.tiles = {"farming_corn_8.png"}
  122. crop_def.groups.growing = 0
  123. crop_def.drop = {
  124. items = {
  125. {items = {"farming:corn 2"}, rarity = 1},
  126. {items = {"farming:corn 2"}, rarity = 2},
  127. {items = {"farming:corn 2"}, rarity = 2},
  128. }
  129. }
  130. minetest.register_node("farming:corn_8", table.copy(crop_def))
  131. -- add to registered_plants
  132. farming.registered_plants["farming:corn"] = {
  133. crop = "farming:corn",
  134. seed = "farming:corn",
  135. minlight = 13,
  136. maxlight = 15,
  137. steps = 8
  138. }