Documentation

master
A. Demant 2018-10-12 05:35:35 +02:00
parent 66b12247cb
commit 1632939666
3 changed files with 96 additions and 31 deletions

View File

@ -2,6 +2,13 @@ Minetest Game mod: farming
==========================
See license.txt for license information.
Mod for extending the farming capabilities of minetest.
You have wild crops, which you can cultivate to get faster and more harvest.
The crops can be infected, where you get nothing. And the infection spreads to nearby crops.
A culture of crops can be destroyed by the infection, where the cultured variant of crops
are easier infected than the wild form.
With special plants you can make a curing mixture. And other plants can protect the culture.
Authors of source code
----------------------
Originally by PilzAdam (MIT)

View File

@ -1,31 +1,31 @@
name,enabled,next_plant,rarety,steps,harvest_max,eat_hp,to_culture,to_dig,has_harvest,on_soil,punchable,infectable,infection_defence,seed_extractable,no_seed,use_flail,use_trellis,for_coffee,snappy,temperature_min,temperature_max,humidity_min,humidity_max,elevation_min,elevation_max,light_min,light_max,infect_rate_base,infect_rate_monoculture,spread_rate,grow_time_mean,straw,culture_rate
default,1,,10,8,2,1,,,,,,,,,,,,,3,15,50,10,50,0,31000,11,14,1E-05,0.001,0.001,120,,
barley,1,,10,7,2,,,,1,1,,1,,,,1,,1,3,25,80,30,80,0,100,11,14,1E-05,0.001,0.001,120,farming:straw,
beetroot,1,,10,5,2,2,,1,,1,,,,,,,,,3,35,80,30,80,0,100,9,14,1E-05,0.001,0.001,120,,
blackberry,1,,10,4,2,1,,,,,1,,,,,,,,3,15,90,20,80,0,100,9,14,1E-05,0.001,0.001,120,,
blueberry,1,,10,4,2,1,,,,,1,,,,,,,,3,45,90,40,90,0,100,9,14,1E-05,0.001,0.001,120,,
carrot,1,,10,8,2,2,,1,,1,,,,,,,,,3,45,80,30,90,0,100,8,14,1E-05,0.001,0.001,120,,
chili,1,,20,8,2,1,,,,,1,,,,,,,,3,45,90,10,50,50,1000,11,14,1E-05,0.001,0.001,120,,
coffee,1,,20,5,2,1,,,,,1,,,,,,,1,3,50,120,50,150,50,1000,12,14,1E-05,0.001,0.001,120,,
cocoa,1,,20,4,2,1,,,,,1,,,,,,,1,3,50,120,40,150,50,1000,12,14,1E-05,0.001,0.001,120,,
corn,1,,10,8,2,2,,,,1,,1,,,,,,,3,35,90,30,80,0,100,11,14,1E-05,0.001,0.001,120,,
cotton,1,,10,8,2,,,,1,1,,1,,,,1,,,3,45,90,20,60,0,100,12,14,1E-05,0.001,0.001,120,,
culturewheat,1,,100,4,2,,1,,1,1,,1,,,,1,,1,3,25,80,40,80,0,100,10,14,1E-05,0.001,0.001,100,farming:straw,
flax,,,10,7,2,,,,1,1,,1,,,,1,,,3,25,80,30,80,0,100,11,14,1E-05,0.001,0.001,120,farming:flaw,
garlic,,,10,5,2,1,,1,,1,,,,,,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,,
grapes,1,,10,8,2,2,1,,,1,1,1,,,,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,,
hemp,1,,10,8,2,,,,1,,,,,,,1,,,3,15,120,10,,0,,6,14,1E-05,0.001,1E-05,90,farming:hemp_fibre,
hop,1,,10,7,2,1,1,,,1,1,1,,,,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,,
mustard,1,,10,5,2,,,,,,,1,,,,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,,
potato,1,,10,4,2,2,,,,1,,1,,,,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,,
raspberry,1,,10,4,2,1,,,,,1,,,,,,,,3,15,50,10,50,0,100,9,14,1E-05,0.001,0.001,120,,
rhubarb,1,,10,3,2,2,,1,,1,,,,,,,,,3,15,50,10,50,0,100,9,14,1E-05,0.001,0.001,120,,
spelt,1,,10,7,2,,,,1,1,,1,,,,1,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,farming:straw,
strawberry,1,,10,4,2,1,,,,,1,,,,,,,,3,15,50,10,50,0,100,9,14,1E-05,0.001,0.001,120,,
tea,,,20,5,2,1,,,,,1,,,1,,,,,3,30,70,30,70,50,100,11,14,1E-05,0.001,0.001,120,,
tobaco,1,,10,8,2,,,,1,1,1,,2,,,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,,
tomato,1,,10,8,2,1,,,1,1,1,1,,,,,1,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,,
nettle,1,,10,5,2,1,,,1,,,,1,,,1,,,3,5,150,10,100,0,2000,6,14,1E-05,0.001,0.001,80,farming:urtica_fibre,
wheat,1,culturewheat,10,8,2,,,,1,1,,1,,,,1,,1,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,farming:straw,10
wildhop,1,hop,10,6,2,,,,,,,,,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,,5
wildgrapes,1,grapes,10,4,2,1,,,,,,,,,1,,,,3,15,50,10,50,0,100,11,14,1E-05,0.001,0.001,120,,5
default,1,,10,8,2,1,,,,,,,,,,,,,3,15,80,10,80,0,200,11,14,1E-05,0.001,0.001,120,,
barley,1,,10,7,2,,,,1,1,,1,,,,1,,1,3,25,,30,,,,,,,,,,farming:straw,
beetroot,1,,10,5,2,2,,1,,1,,,,,,,,,3,35,,30,,,,9,,,,,,,
blackberry,1,,10,4,2,1,,,,,1,,,,,,,,3,,90,20,,,,9,,,,,,,
blueberry,1,,10,4,2,1,,,,,1,,,,,,,,3,45,90,40,90,,,9,,,,,,,
carrot,1,,10,8,2,2,,1,,1,,,,,,,,,3,45,,30,90,,,8,,,,,,,
chili,1,,20,8,2,1,,,,,1,,,,,,,,3,45,90,,,50,1000,,,,,,,,
coffee,1,,20,5,2,1,,,,,1,,,,,,,1,3,50,120,50,150,50,1000,12,,,,,,,
cocoa,1,,20,4,2,1,,,,,1,,,,,,,1,3,50,120,40,150,50,1000,12,,,,,,,
corn,1,,10,8,2,2,,,,1,,1,,,,,,,3,35,90,30,,,,,,,,,,,
cotton,1,,10,8,2,,,,1,1,,1,,,,1,,,3,45,90,20,,,,12,,,,,,,
culturewheat,1,,100,4,2,,1,,1,1,,1,,,,1,,1,3,25,,40,,,,10,,,,,100,farming:straw,
flax,,,10,7,2,,,,1,1,,1,,,,1,,,3,25,,30,,,,,,,,,,farming:flaw,
garlic,,,10,5,2,1,,1,,1,,,,,,,,,3,,,,,,,,,,,,,,
grapes,1,,10,8,2,2,1,,,1,1,1,,,,,1,,3,,,,,,,,,,,,,,
hemp,1,,10,8,2,,,,1,,,,,,,1,,,3,,120,,,,,6,,,,1E-05,90,farming:hemp_fibre,
hop,1,,10,7,2,1,1,,,1,1,1,,,,,1,,3,,,,,,,,,,,,,,
mustard,1,,10,5,2,,,,,,,1,,,,,,,3,,,,,,,,,,,,,,
potato,1,,10,4,2,2,,,,1,,1,,,,,,,3,,,,,,,,,,,,,,
raspberry,1,,10,4,2,1,,,,,1,,,,,,,,3,,,,,,,9,,,,,,,
rhubarb,1,,10,3,2,2,,1,,1,,,,,,,,,3,,,,,,,9,,,,,,,
spelt,1,,10,7,2,,,,1,1,,1,,,,1,,,3,,,,,,,,,,,,,farming:straw,
strawberry,1,,10,4,2,1,,,,,1,,,,,,,,3,,,,,,,9,,,,,,,
tea,,,20,5,2,1,,,,,1,,,1,,,,,3,30,70,30,70,50,,,,,,,,,
tobaco,1,,10,8,2,,,,1,1,1,,2,,,,,,3,,,,,,,,,,,,,,
tomato,1,,10,8,2,1,,,1,1,1,1,,,,,1,,3,,,,,,,,,,,,,,
nettle,1,,10,5,2,1,,,1,,,,1,,,1,,,3,5,150,,100,,2000,6,,,,,80,farming:urtica_fibre,
wheat,1,culturewheat,10,8,2,,,,1,1,,1,,,,1,,1,3,,,,,,,,,,,,,farming:straw,10
wildhop,1,hop,10,6,2,,,,,,,,,,1,,,,3,,,,,,,,,,,,,,5
wildgrapes,1,grapes,10,4,2,1,,,,,,,,,1,,,,3,,,,,,,,,,,,,,5

1 name enabled next_plant rarety steps harvest_max eat_hp to_culture to_dig has_harvest on_soil punchable infectable infection_defence seed_extractable no_seed use_flail use_trellis for_coffee snappy temperature_min temperature_max humidity_min humidity_max elevation_min elevation_max light_min light_max infect_rate_base infect_rate_monoculture spread_rate grow_time_mean straw culture_rate
2 default 1 10 8 2 1 3 15 50 80 10 50 80 0 31000 200 11 14 1E-05 0.001 0.001 120
3 barley 1 10 7 2 1 1 1 1 1 3 25 80 30 80 0 100 11 14 1E-05 0.001 0.001 120 farming:straw
4 beetroot 1 10 5 2 2 1 1 3 35 80 30 80 0 100 9 14 1E-05 0.001 0.001 120
5 blackberry 1 10 4 2 1 1 3 15 90 20 80 0 100 9 14 1E-05 0.001 0.001 120
6 blueberry 1 10 4 2 1 1 3 45 90 40 90 0 100 9 14 1E-05 0.001 0.001 120
7 carrot 1 10 8 2 2 1 1 3 45 80 30 90 0 100 8 14 1E-05 0.001 0.001 120
8 chili 1 20 8 2 1 1 3 45 90 10 50 50 1000 11 14 1E-05 0.001 0.001 120
9 coffee 1 20 5 2 1 1 1 3 50 120 50 150 50 1000 12 14 1E-05 0.001 0.001 120
10 cocoa 1 20 4 2 1 1 1 3 50 120 40 150 50 1000 12 14 1E-05 0.001 0.001 120
11 corn 1 10 8 2 2 1 1 3 35 90 30 80 0 100 11 14 1E-05 0.001 0.001 120
12 cotton 1 10 8 2 1 1 1 1 3 45 90 20 60 0 100 12 14 1E-05 0.001 0.001 120
13 culturewheat 1 100 4 2 1 1 1 1 1 1 3 25 80 40 80 0 100 10 14 1E-05 0.001 0.001 100 farming:straw
14 flax 10 7 2 1 1 1 1 3 25 80 30 80 0 100 11 14 1E-05 0.001 0.001 120 farming:flaw
15 garlic 10 5 2 1 1 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120
16 grapes 1 10 8 2 2 1 1 1 1 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120
17 hemp 1 10 8 2 1 1 3 15 120 10 0 6 14 1E-05 0.001 1E-05 90 farming:hemp_fibre
18 hop 1 10 7 2 1 1 1 1 1 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120
19 mustard 1 10 5 2 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120
20 potato 1 10 4 2 2 1 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120
21 raspberry 1 10 4 2 1 1 3 15 50 10 50 0 100 9 14 1E-05 0.001 0.001 120
22 rhubarb 1 10 3 2 2 1 1 3 15 50 10 50 0 100 9 14 1E-05 0.001 0.001 120
23 spelt 1 10 7 2 1 1 1 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120 farming:straw
24 strawberry 1 10 4 2 1 1 3 15 50 10 50 0 100 9 14 1E-05 0.001 0.001 120
25 tea 20 5 2 1 1 1 3 30 70 30 70 50 100 11 14 1E-05 0.001 0.001 120
26 tobaco 1 10 8 2 1 1 1 2 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120
27 tomato 1 10 8 2 1 1 1 1 1 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120
28 nettle 1 10 5 2 1 1 1 1 3 5 150 10 100 0 2000 6 14 1E-05 0.001 0.001 80 farming:urtica_fibre
29 wheat 1 culturewheat 10 8 2 1 1 1 1 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120 farming:straw 10
30 wildhop 1 hop 10 6 2 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120 5
31 wildgrapes 1 grapes 10 4 2 1 1 3 15 50 10 50 0 100 11 14 1E-05 0.001 0.001 120 5

View File

@ -1,5 +1,63 @@
local S = farming.intllib
--[[
Loading of crop definition stored in a csv file.
The import is extendable, so new columns in the config file are imported to new field in the table.
First line: Header
Second line should be default crop, where several default values are stored.
Actual columns:
Name Name of the crop. Is used for registering all nodes and craftitems
Enabled void crop is not registered in the game
an value crop is registered with configured features
next_plant text For wild crop the name of the cultured crop. By change you get the seed or harvest of the cultured one
Should be a name of another crop in this list
Rarety How often the crop spawn in the wild
Steps Amount of steps the growing needs till full grown plant. Must be set
harvest_max Max. amount of harvest or seed you can dig out of full grown plant
eat_hp eat health point: How many HP you get by eating the seed.
to_culture void crop can be generated during mapgen and spawn randomly on grassland
any value crop can not be find randomly on the map. The seed has to be found in the wild form or crafted.
to_dig void
any value
has_harvest void drops seed which can be used for planting new crops
any value drops harvest, where the seed has to be crafted out of the harvest
on_soil void can be planted everywhere where the conditions are met (temperature etc.)
any value crap can be found in the wild, but planted only on wet soil,
without checking for temperature etc.
punchable void the plant has to be dug to get harvest or seed
any value by punching the last step of the crop, you get one seed and the plant change
to second last stage
infectable void
any value the plant can be infected, where the crop does not give any seed or harvest
and may infect other crops nearby
infection_defense
any value can protect nearby crop against infection. value give range of protection
seed_extractable
any value crop gives normally only harvest, out of which no seeds can be crafted, like tea.
no_seed void
any value
use_flail void
any value extension to define crafting recipe: With flail you get the seeds out of harvest
and kind of fibres/straw
use_trellis void
any value the crop needs kind of trellis for growing. the trellis is recyclable:
You get the trellis back by digging the plant at any stage.
for_coffee void
any value extension to define crafting recipes to brew coffee out of seed
temperature_min/_max Range of temperature inside the crop can grow.
humidity_min/_max Range of humidity
elevation_min/_max Height range the crop can be found
light_min Minimun amount of light needed for growing. Crop can be planted only on placed
where light_min is reached at midday. It is also needed for calculating the grow_time.
With more light at midday the crop grows faster.
light_max If node light exceed this value after grow time, the timer starts again without growing.
infect_rate_base Normal infect rate for crops
infect_rate_monoculture Infect rate if many crops are standing nearby.
spread_rate Full grown crops can spread to neighbor block
grow_time_mean mean grow time to next step
straw text extension for using flail: item name of fibre to craft out of harvest beside seeds
culture_rate rate to get cultured variant out of wild form.
]]
local S = farming.intllib
farming.path = minetest.get_modpath("farming")
local function has_value (tab, val)