Documentation; correct seed name

master
A. Demant 2018-10-12 07:22:31 +02:00
parent 1632939666
commit 63c3f5e8a1
4 changed files with 20 additions and 8 deletions

View File

@ -1,5 +1,5 @@
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,80,10,80,0,200,11,14,1E-05,0.001,0.001,120,,
default,1,,10,8,2,1,,,,,,,,,,,,,3,15,80,10,80,0,200,11,14,1E-05,0.001,0.001,12,,
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,,,,,,,
@ -14,7 +14,7 @@ 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,
hemp,1,,10,8,2,,,,1,,,,,,,1,,,3,,120,,,,,6,,,,1E-05,9,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,,,,,,,,,,,,,,
@ -25,7 +25,7 @@ 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,
nettle,1,,10,5,2,1,,,1,,,,1,,,1,,,3,5,150,,100,,2000,6,,,,,8,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 80 10 80 0 200 11 14 1E-05 0.001 0.001 120 12
3 barley 1 10 7 2 1 1 1 1 1 3 25 30 farming:straw
4 beetroot 1 10 5 2 2 1 1 3 35 30 9
5 blackberry 1 10 4 2 1 1 3 90 20 9
14 flax 10 7 2 1 1 1 1 3 25 30 farming:flaw
15 garlic 10 5 2 1 1 1 3
16 grapes 1 10 8 2 2 1 1 1 1 1 3
17 hemp 1 10 8 2 1 1 3 120 6 1E-05 90 9 farming:hemp_fibre
18 hop 1 10 7 2 1 1 1 1 1 1 3
19 mustard 1 10 5 2 1 3
20 potato 1 10 4 2 2 1 1 3
25 tea 20 5 2 1 1 1 3 30 70 30 70 50
26 tobaco 1 10 8 2 1 1 1 2 3
27 tomato 1 10 8 2 1 1 1 1 1 1 3
28 nettle 1 10 5 2 1 1 1 1 3 5 150 100 2000 6 80 8 farming:urtica_fibre
29 wheat 1 culturewheat 10 8 2 1 1 1 1 1 3 farming:straw 10
30 wildhop 1 hop 10 6 2 1 3 5
31 wildgrapes 1 grapes 10 4 2 1 1 3 5

View File

@ -61,6 +61,7 @@ local S = farming.intllib
farming.path = minetest.get_modpath("farming")
local function has_value (tab, val)
-- test if val is in tab
for index, value in ipairs(tab) do
if value == val then
return true
@ -70,8 +71,13 @@ local function has_value (tab, val)
end
local crop_definition = {}
local crop_numeric_values = {"rarety","steps","harvest_max","eat_hp","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"}
local crop_groups = {"to_culture","to_dig","has_harvest","on_soil","punchable","infectable","seed_extractable","use_flail","use_trellis","snappy","infection_defence"}
local crop_numeric_values = {"rarety","steps","harvest_max","eat_hp",
"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"}
local crop_groups =
{"to_culture","to_dig","has_harvest","on_soil","punchable","infectable",
"seed_extractable","use_flail","use_trellis","snappy","infection_defence"}
-- import configurations from crops.csv
local file = io.open(farming.path .. "/crops.csv", "r")
@ -126,6 +132,7 @@ end
-- register crops
for i,tdef in pairs(crop_definition) do
if i ~= "default" then
-- only register when crop is enabled
if tdef.enabled then
print("farming registering "..tdef.name)
farming.register_plant(tdef)

View File

@ -83,6 +83,7 @@ minetest.register_node("farming:desert_sand_soil_wet", {
minetest.register_node("farming:straw", {
description = S("Straw"),
tiles = {"farming_straw.png"},
inventory_image = {"farming_straw.png"},
is_ground_content = false,
groups = {snappy=3, flammable=4, fall_damage_add_percent=-30},
sounds = default.node_sound_leaves_defaults(),
@ -90,6 +91,7 @@ minetest.register_node("farming:straw", {
minetest.register_node("farming:hemp_fibre", {
description = S("Hemp Fibre"),
tiles = {"farming_hemp_fibre.png"},
inventory_image = {"farming_hemp_fibre.png"},
is_ground_content = false,
groups = {snappy=3, flammable=4, fall_damage_add_percent=-30},
sounds = default.node_sound_leaves_defaults(),
@ -97,6 +99,7 @@ minetest.register_node("farming:hemp_fibre", {
minetest.register_node("farming:nettle_fibre", {
description = ("Nettle Fibre"),
tiles = {"farming_urtica_fibre.png"},
inventory_image = {"farming_urtica_fibre.png"},
is_ground_content = false,
groups = {snappy=3, flammable=4, fall_damage_add_percent=-30},
sounds = default.node_sound_leaves_defaults(),

View File

@ -169,6 +169,7 @@ end
farming.register_seed=function(sdef)
print(sdef.name:gsub("^%l", string.upper))
local seed_def = {
description=S(sdef.name:gsub("^%l", string.upper).." Seed"),
drawtype = "signlike",
@ -189,7 +190,8 @@ farming.register_seed=function(sdef)
on_place = farming.seed_on_place,
on_timer = farming.seed_on_timer,
}
for i,colu in ipairs({"place_param2","fertility","description","plant_name","seed_name","grow_time_min","grow_time_max","light_min"}) do
print(seed_def.description)
for i,colu in ipairs({"place_param2","fertility","plant_name","seed_name","grow_time_min","grow_time_max","light_min"}) do
seed_def[colu] = sdef[colu]
end
local seed_png = sdef.mod_name.."_"..sdef.name.."_seed.png"
@ -208,6 +210,7 @@ farming.register_seed=function(sdef)
if sdef.eat_hp then
seed_def.on_use=minetest.item_eat(sdef.eat_hp)
end
print(dump(seed_def))
minetest.register_node(":" .. sdef.seed_name, seed_def)
end
@ -257,7 +260,7 @@ farming.register_steps = function(sdef)
end
local lbm_nodes = {sdef.seed_name}
for i=1,sdef.steps do
local ndef={}
local ndef={description=sdef.step_name.."_"..i}
for _,colu in ipairs({"sounds","selection_box","drawtype","waving","paramtype","paramtype2","place_param2","grow_time_min","grow_time_max","light_min",
"walkable","buildable_to","plant_name","drop_item"}) do
ndef[colu]=node_def[colu]
@ -559,7 +562,6 @@ farming.step_on_punch = function(pos, node, puncher, pointed_thing)
puncher:get_inventory():add_item('main',def.seed_name)
-- getting one more when using billhook
local tool_def = puncher:get_wielded_item():get_definition()
-- print(tool_def.max_uses)
if tool_def.groups["billhook"] then
puncher:get_inventory():add_item('main',def.drop_item)
end