api.txt 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Farming API
  2. -----------
  3. The farming API allows you to easily register plants.
  4. A new plant is created by insert a new line in crops.txt and fill the columns. During loading each row is interpreted and the necessary items and craft recipes are registered.
  5. The description of the column is stated in file crops.lua, where the table is read.
  6. The initialisation is done via main function farming.register_plant(plant_def). Depending on definition it calls several helping functions.
  7. -- Table Definition --
  8. def={
  9. name = Name of plant,
  10. steps = Count of growing steps,
  11. harvest_max = Max. amount of harvest for last step with no special tools,
  12. rarity_grass_drop = Rarity to find seed in drop table of normal grass,
  13. rarity_junglegrass_drop = Rarity to find seed in drop table of jungle grass,
  14. eat_hp = HP-change during eating,
  15. drink = for thirst mod: How much thirst is reduced
  16. temperature_min = Minimum Temperature for plant,
  17. temperature_max = Maximum Temperature for plant,
  18. humidity_min = Min. Humidity,
  19. humidity_max = Max. Humidity,
  20. elevation_min = Min. elevetion where plant can be found,
  21. elevation_max = Max. elevation where plant can be found,
  22. light_min = Min. amount of light needed for planting and growing,
  23. light_max = Max. amount of light, where growing can occur,
  24. infect_rate_base = Infection rate of plant,
  25. infect_rate_monoculture = Infection rate, when plant is in monoculture,
  26. spread_rate = Rate for spreading plant,
  27. grow_time_mean = Mean time between steps in second,
  28. wilt_time = Time of last step to wild,
  29. straw = If plant has harvest to get seed out of with a flail, which kind of straw is given back,
  30. seed_drop = name of dropped seed,
  31. grind = name of grindes item,
  32. roast = name of roasted item
  33. group = {
  34. to_culture = Plant can not be found in the world, it has to be planted,
  35. to_dig = Plant has to be digged to give harves,
  36. has_harvest = Plant give harvest instead of seed. Out of harvest the seed has to be crafted,
  37. on_soil = Has to be planted on soil; otherwise can be planted on earth, where temperature/humidity is fullfilled,
  38. is_bush = has own mesh,
  39. punchable = can give seed by punching, where the plant is going back one step and regrow after grow_mean_time,
  40. wiltable = plant can wilt,
  41. infectable = plant can be infected,
  42. infection_defence = distance, where plant protect other plants,
  43. seed_extractable = seed has to be extracted by special tool,
  44. use_flail = the seed has to be crafted with farming:flail
  45. use_trellis = for planting you have to craft seed with a trellis,
  46. for_coffee = plant is used for coffee, where roasting and grinding is considered,
  47. seed_roastable = seed can be roasted and eated,
  48. seed_grindable = seed can be grinded,
  49. for_flour = seed is grindable and can be used to craft flour for bread,
  50. damage_per_second = amount of damage per second a player feel if staying inside node,
  51. liquid_viscosity = viscosity for walking through node
  52. }
  53. }