modified registering roast/grind #8 ; urtica->nettle

master
ademant 2018-10-17 13:39:02 +02:00
parent 94926b754f
commit a91139a55e
6 changed files with 112 additions and 41 deletions

View File

@ -67,14 +67,14 @@ minetest.register_craftitem("farming:flour", {
groups = {food_flour = 1, flammable = 1},
})
minetest.register_craftitem(modname..":urtica_water",{
description = "Urtica Water",
inventory_image = "farming_tool_glass_urtica.png",
minetest.register_craftitem(modname..":nettle_water",{
description = "Nettle Water",
inventory_image = "farming_tool_glass_nettle.png",
groups = {desinfect = 1}
})
minetest.register_craft({
output=modname..":urtica_water 10",
output=modname..":nettle_water 10",
type = "shapeless",
recipe={"vessels:glass_bottle 10","bucket_water",modname..":urtica"},
recipe={"vessels:glass_bottle 10","bucket_water",farming.modname..":nettle"},
replacements = {{"bucket_water", "bucket_empty"}}
})

View File

@ -42,6 +42,8 @@ Actual columns:
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
for_flour void
any value extension to define crafting recipes to craft normal flour out of seed
seed_roastable
any value seed can be roasted in a oven, needs "crop_roasted.png"
value is used as roast time
@ -76,7 +78,8 @@ local crop_cols={
"elevation_min","elevation_max","light_min","light_max",
"infect_rate_base","infect_rate_monoculture","spread_rate","grow_time_mean","roast_time"},
groups_num={"to_culture","to_dig","has_harvest","on_soil","punchable","infectable",
"seed_extractable","use_flail","use_trellis","snappy","infection_defence","seed_roastable","seed_grindable"}}
"seed_extractable","use_flail","use_trellis","snappy","infection_defence","seed_roastable",
"seed_grindable","for_flour","for_coffee"}}
local crop_definition = farming.import_csv(farming.path.."/crops.txt",crop_cols)
print(dump(crop_definition))

View File

@ -1,30 +1,30 @@
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,seed_roastable,seed_grindable,flour,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,seed_drop,grind
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,,1,3,25,,30,,,,,,,,,,farming:straw,,,farming:flour
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,,,,,,,,,2,,,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,4,,,3,50,120,50,150,50,1000,12,,,,,,,,,
corn,1,,10,8,2,2,,,,1,,1,,,,,,,4,1,,3,35,90,30,,,,,,,,,,,,,
cotton,1,,10,8,2,,,,1,1,,1,,,,1,,,,,,3,45,90,20,,,,12,,,,,,,,,
culturewheat,1,,100,4,3,,1,,1,1,,1,,,,1,,1,3,,1,3,25,,40,,,,10,,,,,100,farming:straw,,,farming:flour
flax,,,10,7,2,,,,1,1,,1,,,,1,,,,,,3,25,,30,,,,,,,,,,farming:flaw,,,
garlic,,,10,5,2,1,,1,,1,,,,,,,,,3,,,3,,,,,,,,,,,,,,,,
grapes,1,,10,8,3,2,1,,,1,1,1,,,,,1,,,,,3,,,,,,,,,,,,,,,wildgrapes,
hemp,1,,10,8,2,,,,1,,,,,,,1,,,,,,3,,120,,,,,6,,,,1E-05,9,farming:hemp_fibre,,,
hop,1,,10,7,3,1,1,,,1,1,1,,,,,1,,4,,,3,,,,,,,,,,,,,,,wildhop,
mustard,1,,10,5,2,,,,,,,1,,,,,,,,1,,3,,,,,,,,,,,,,,,,
potato,1,,10,4,2,2,,,,1,,1,,,,,,,4,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,,1,3,,,,,,,,,,,,,farming:straw,,,farming:flour
strawberry,1,,10,4,2,1,,,,,1,,,,,,,,,,,3,,,,,,,9,,,,,,,,,
tea,,,20,5,2,1,,,,,1,,,1,,,,,4,,,3,30,70,30,70,50,,,,,,,,,,,
tobaco,1,,10,8,2,,,,1,1,1,,2,,,,,,4,,,3,,,,,,,,,,,,,,,,
tomato,,,10,8,2,1,,,1,1,1,1,,,,,1,,,,,3,,,,,,,,,,,,,,,,
nettle,1,,10,5,2,1,,,1,,,,1,,,1,,,2,,,3,5,150,,100,,2000,6,,,,,8,farming:nettle_fibre,,,
wheat,1,culturewheat,10,8,2,,,,1,1,,1,,,,1,,1,3,,1,3,,,,,,,,,,,,,farming:straw,10,,farming:flour
wildhop,1,hop,10,6,2,,,,,,,,,,1,,,,4,,,3,,,,,,,,,,,,,,5,,
wildgrapes,1,grapes,10,4,2,1,,,,,,,,,1,,,,,,,3,,,,,,,,,,,,,,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,seed_roastable,seed_grindable,for_flour,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,seed_drop,grind,roast
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,,1,3,25,,30,,,,,,,,,,farming:straw,,,farming:flour,
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,,,,,,,,,2,,,3,45,,30,90,,,8,,,,,,,,,,farming:carrot_baked
chili,1,,20,8,2,1,,,,,1,,,,,,,,,,,3,45,90,,,50,1000,,,,,,,,,,,
coffee,1,,20,5,2,1,,,,,1,,,,,,,1,4,,,3,50,120,50,150,50,1000,12,,,,,,,,,,
corn,1,,10,8,2,2,,,,1,,1,,,,,,,4,1,,3,35,90,30,,,,,,,,,,,,,,farming:corn_baked
cotton,1,,10,8,2,,,,1,1,,1,,,,1,,,,,,3,45,90,20,,,,12,,,,,,,,,,
culturewheat,1,,100,4,3,,1,,1,1,,1,,,,1,,1,3,,1,3,25,,40,,,,10,,,,,100,farming:straw,,,farming:flour,
flax,,,10,7,2,,,,1,1,,1,,,,1,,,,,,3,25,,30,,,,,,,,,,farming:flaw,,,,
garlic,,,10,5,2,1,,1,,1,,,,,,,,,3,,,3,,,,,,,,,,,,,,,,,
grapes,1,,10,8,3,2,1,,,1,1,1,,,,,1,,,,,3,,,,,,,,,,,,,,,wildgrapes,,
hemp,1,,10,8,2,,,,1,,,,,,,1,,,,,,3,,120,,,,,6,,,,1E-05,9,farming:hemp_fibre,,,,
hop,1,,10,7,3,1,1,,,1,1,1,,,,,1,,4,,,3,,,,,,,,,,,,,,,wildhop,,
mustard,1,,10,5,2,,,,,,,1,,,,,,,,2,,3,,,,,,,,,,,,,,,,,
potato,1,,10,4,2,2,,,,1,,1,,,,,,,4,1,,3,,,,,,,,,,,,,,,,,farming:potato_baked
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,,1,3,,,,,,,,,,,,,farming:straw,,,farming:flour,
strawberry,1,,10,4,2,1,,,,,1,,,,,,,,,,,3,,,,,,,9,,,,,,,,,,
tea,,,20,5,2,1,,,,,1,,,1,,,,,4,,,3,30,70,30,70,50,,,,,,,,,,,,
tobaco,1,,10,8,2,,,,1,1,1,,2,,,,,,4,,,3,,,,,,,,,,,,,,,,,
tomato,,,10,8,2,1,,,1,1,1,1,,,,,1,,,,,3,,,,,,,,,,,,,,,,,
nettle,1,,10,5,2,1,,,1,,,,1,,,1,,,2,,,3,5,150,,100,,2000,6,,,,,8,farming:nettle_fibre,,,,
wheat,1,culturewheat,10,8,2,,,,1,1,,1,,,,1,,1,3,,1,3,,,,,,,,,,,,,farming:straw,10,,farming:flour,
wildhop,1,hop,10,6,2,,,,,,,,,,1,,,,4,,,3,,,,,,,,,,,,,,5,,,
wildgrapes,1,grapes,10,4,2,1,,,,,,,,,1,,,,,,,3,,,,,,,,,,,,,,5,,,

View File

@ -98,8 +98,8 @@ 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"},
tiles = {"farming_nettle_fibre.png"},
inventory_image = {"farming_nettle_fibre.png"},
is_ground_content = false,
groups = {snappy=3, flammable=4, fall_damage_add_percent=-30},
sounds = default.node_sound_leaves_defaults(),

View File

@ -25,6 +25,16 @@ local register_plant_check_def = function(def)
if not def.fertility then
def.fertility = {"grassland"}
end
if def.groups["seed_grindable"] then
if def.grind == nil then
def.grind = "Grinded "..def.description
end
end
if def.groups["seed_roastable"] then
if def.roast == nil then
def.roast = "Roasted "..def.description
end
end
def.grow_time_min=math.floor(def.grow_time_mean*0.75)
def.grow_time_max=math.floor(def.grow_time_mean*1.2)
return def
@ -84,6 +94,12 @@ farming.register_plant = function(def)
if def.groups["use_trellis"] then
farming.trellis_seed(def.step_name,def.drop_seed_name or def.seed_name)
end
if def.groups["seed_grindable"] then
farming.register_grind(def)
end
if def.groups["seed_roastable"] then
farming.register_roast(def)
end
end
-- helping function for getting biomes
@ -212,8 +228,10 @@ farming.register_seed=function(sdef)
for k, v in pairs(sdef.fertility) do
seed_def.groups[v] = 1
end
if sdef.groups["on_soil"] then
seed_def.groups["on_soil"] = sdef.groups["on_soil"]
for i,colu in ipairs({"on_soil","for_flour"}) do
if sdef.groups[colu] then
seed_def.groups[colu] = sdef.groups[colu]
end
end
if sdef.eat_hp then
seed_def.on_use=minetest.item_eat(sdef.eat_hp)
@ -888,7 +906,7 @@ function farming.register_roast(rdef)
if rdef.mod_name then
mname = rdef.mod_name
end
local roast_png = mname.."_"..rdef.plant_name.."_roasted.png"
local roast_png = roastitem:gsub(":","_")..".pnd"
local roast_def={
description = S(rdef.description:gsub("^%l", string.upper).." roasted"),
@ -921,3 +939,53 @@ function farming.register_roast(rdef)
})
end
function farming.register_grind(rdef)
if rdef.seed_name == nil then
return
end
if rdef.step_name == nil then
return
end
local grinditem = rdef.step_name.."_flour"
if rdef.grind_name then
grinditem = rdef.grind_name
end
local mname = minetest.get_current_modname()
if rdef.mod_name then
mname = rdef.mod_name
end
local grind_png = grinditem:gsub(":","_")..".png"
local grind_def={
description = S(rdef.description:gsub("^%l", string.upper).." roasted"),
inventory_image = grind_png,
groups = rdef.groups or {flammable = 2},
}
for _,coln in ipairs({"plant_name"}) do
grind_def[coln] = rdef[coln]
end
for _,coln in ipairs({"seed_roastable"}) do
if rdef.groups[coln] then
grind_def.groups[coln] = rdef.groups[coln]
end
end
if rdef.eat_hp then
grind_def.on_use=minetest.item_eat(rdef.eat_hp)
end
minetest.register_craftitem(":" .. grinditem, grind_def)
local cooktime = 3
if rdef.roast_time then
cooktime = rdef.roast_time
end
minetest.register_craft({
type = "shapeless",
output = grinditem,
recipe = {rdef.seed_name.." "..rdef.groups["seed_grindable"],
farming.modname..":mortar_pestle"},
replacements = {{"group:food_mortar_pestle", farming.modname..":mortar_pestle"}},
})
end

View File

Before

Width:  |  Height:  |  Size: 181 B

After

Width:  |  Height:  |  Size: 181 B