#7; wild form modified to use harvest functions and use trellis to craft seed

master
ademant 2018-10-19 10:35:45 +02:00
parent 8b4c1a6a95
commit 30d44c9f33
3 changed files with 26 additions and 12 deletions

View File

@ -12,9 +12,9 @@ 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,,
grapes,1,,10,8,3,2,1,,,1,1,1,,,,,1,,,,,3,,,,,,,,,,,,,,,farming:seed_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,,
hop,1,,10,7,3,1,1,,,1,1,1,,,,,1,,4,,,3,,,,,,,,,,,,,,,farming:seed_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,,,,,,,,,,
@ -26,5 +26,5 @@ 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,farming:culturewheat,10,8,2,,,,1,1,,1,,,,1,,1,3,,1,3,,,,,,,,,,,,,farming:straw,10,,farming:flour,
wildhop,1,hop,10,6,2,,,,,,,,,,1,,1,,4,,,3,,,,,,,,,,,,,,5,,,
wildgrapes,1,,10,4,2,1,,,,,,,,,1,,1,,,,,3,,,,,,,,,,,,,,5,,,
wildhop,1,hop,10,6,2,,,,,,,,,,1,,,,4,,,3,,,,,,,,,,,,,,5,,,
wildgrapes,1,,10,4,2,1,,,,,,,,,1,,,,,,,3,,,,,,,,,,,,,,5,,,

View File

@ -35,6 +35,16 @@ local register_plant_check_def = function(def)
def.roast = minetest.get_current_modname()..":"..def.description.."_roasted"
end
end
-- check if seed_drop is set and check if it is a node name
if def.seed_drop then
local mname=def.seed_drop:split(":")[1]
local sname=def.seed_drop:split(":")[2]
if mname=="" then
mname=minetest.get_current_modname()
def.seed_drop=mname..":"..sname
end
def.groups["has_harvest"] = 1
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
@ -51,15 +61,15 @@ farming.register_plant = function(def)
-- local definitions
def.step_name=def.mod_name..":"..def.name
def.seed_name=def.mod_name..":seed_"..def.name
-- check if seed to drop exist
if def.seed_drop ~= nil then
def.seed_name = def.mod_name..":seed_"..def.seed_drop
end
def.plant_name = def.name
-- if plant has harvest then registering
if def.groups["has_harvest"] ~= nil then
-- def.harvest_png=def.mod_name.."_"..def.name..".png"
def.harvest_name = def.step_name
if def.seed_drop ~= nil then
def.harvest_name = def.seed_drop
else
def.harvest_name = def.step_name
end
farming.register_harvest(def)
else
def.harvest_name=def.seed_name
@ -286,8 +296,8 @@ farming.register_steps = function(sdef)
if has_harvest then
node_def.drop_item = sdef.step_name
else
if sdef.drop_seed_name ~= nil then
node_def.drop_item = sdef.drop_seed_name
if sdef.seed_drop ~= nil then
node_def.drop_item = sdef.seed_drop
end
end
local lbm_nodes = {sdef.seed_name}
@ -860,12 +870,16 @@ farming.trellis_seed = function(gdef)
if gdef.seed_name == nil then
return
end
if gdef.harvest_name == nil then
return
end
minetest.register_craft({
type = "shapeless",
output = gdef.seed_name.." 1",
recipe = {
farming.modname..":trellis",gdef.seed_name
farming.modname..":trellis",gdef.harvest_name
},
})
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 774 B