diff options
| -rw-r--r-- | api.txt | 5 | ||||
| -rw-r--r-- | crops/barley.lua | 9 | ||||
| -rw-r--r-- | crops/beans.lua | 9 | ||||
| -rw-r--r-- | crops/beetroot.lua | 9 | ||||
| -rw-r--r-- | crops/blueberry.lua | 9 | ||||
| -rw-r--r-- | crops/carrot.lua | 9 | ||||
| -rw-r--r-- | crops/chili.lua | 9 | ||||
| -rw-r--r-- | crops/cocoa.lua | 9 | ||||
| -rw-r--r-- | crops/coffee.lua | 9 | ||||
| -rw-r--r-- | crops/corn.lua | 9 | ||||
| -rw-r--r-- | crops/cotton.lua | 9 | ||||
| -rw-r--r-- | crops/cucumber.lua | 9 | ||||
| -rw-r--r-- | crops/garlic.lua | 13 | ||||
| -rw-r--r-- | crops/grapes.lua | 9 | ||||
| -rw-r--r-- | crops/hemp.lua | 9 | ||||
| -rw-r--r-- | crops/melon.lua | 9 | ||||
| -rw-r--r-- | crops/onion.lua | 9 | ||||
| -rw-r--r-- | crops/peas.lua | 9 | ||||
| -rw-r--r-- | crops/pepper.lua | 9 | ||||
| -rw-r--r-- | crops/pineapple.lua | 9 | ||||
| -rw-r--r-- | crops/potato.lua | 9 | ||||
| -rw-r--r-- | crops/pumpkin.lua | 14 | ||||
| -rw-r--r-- | crops/raspberry.lua | 9 | ||||
| -rw-r--r-- | crops/rhubarb.lua | 9 | ||||
| -rw-r--r-- | crops/tomato.lua | 9 | ||||
| -rw-r--r-- | crops/wheat.lua | 9 | ||||
| -rw-r--r-- | init.lua | 2 | 
27 files changed, 233 insertions, 8 deletions
@@ -11,6 +11,11 @@ The farming API allows you to easily register plants and hoes.  `farming.registered_plants[name] = definition`   * Table of registered plants, indexed by plant name +    'crop' holds name of growing crop node minus _step-number at end +    'seed' has name of seed required to plant crop +    'minlight' min light level needed to grow +    'maxlight' max light level needed to grow +    'steps' number of steps crop has in growth cycle  ### Hoe Definition diff --git a/crops/barley.lua b/crops/barley.lua index f509335..6f3cb97 100644 --- a/crops/barley.lua +++ b/crops/barley.lua @@ -103,3 +103,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:barley_7", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:barley"] = { +	crop = "farming:barley", +	seed = "farming:seed_barley", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} diff --git a/crops/beans.lua b/crops/beans.lua index a575956..a75030a 100644 --- a/crops/beans.lua +++ b/crops/beans.lua @@ -224,6 +224,15 @@ crop_def.drop = {  }  minetest.register_node("farming:beanpole_5", table.copy(crop_def)) +-- add to registered_plants +farming.registered_plants["farming:beans"] = { +	crop = "farming:beanpole", +	seed = "farming:beans", +	minlight = 13, +	maxlight = 15, +	steps = 5 +} +  -- wild green bean bush (this is what you find on the map)  minetest.register_node("farming:beanbush", {  	drawtype = "plantlike", diff --git a/crops/beetroot.lua b/crops/beetroot.lua index e683a94..8f7069b 100644 --- a/crops/beetroot.lua +++ b/crops/beetroot.lua @@ -83,3 +83,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:beetroot_5", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:beetroot"] = { +	crop = "farming:beetroot", +	seed = "farming:beetroot", +	minlight = 13, +	maxlight = 15, +	steps = 5 +} diff --git a/crops/blueberry.lua b/crops/blueberry.lua index 9a30387..64aee3e 100644 --- a/crops/blueberry.lua +++ b/crops/blueberry.lua @@ -83,3 +83,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:blueberry_4", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:blueberries"] = { +	crop = "farming:blueberry", +	seed = "farming:blueberries", +	minlight = 13, +	maxlight = 15, +	steps = 4 +} diff --git a/crops/carrot.lua b/crops/carrot.lua index 0aefcfd..b9cf535 100644 --- a/crops/carrot.lua +++ b/crops/carrot.lua @@ -94,3 +94,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:carrot_8", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:carrot"] = { +	crop = "farming:carrot", +	seed = "farming:carrot", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} diff --git a/crops/chili.lua b/crops/chili.lua index 9889162..429d256 100644 --- a/crops/chili.lua +++ b/crops/chili.lua @@ -90,3 +90,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:chili_8", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:chili_pepper"] = { +	crop = "farming:chili", +	seed = "farming:chili_pepper", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} diff --git a/crops/cocoa.lua b/crops/cocoa.lua index ecefcea..7b5e8d4 100644 --- a/crops/cocoa.lua +++ b/crops/cocoa.lua @@ -165,6 +165,15 @@ crop_def.drop = {  }  minetest.register_node("farming:cocoa_4", table.copy(crop_def)) +-- add to registered_plants +farming.registered_plants["farming:cocoa_beans"] = { +	crop = "farming:cocoa", +	seed = "farming:cocoa_beans", +	minlight = 13, +	maxlight = 15, +	steps = 4 +} +  -- add random cocoa pods to jungle tree's  minetest.register_on_generated(function(minp, maxp) diff --git a/crops/coffee.lua b/crops/coffee.lua index f98694b..c4528e2 100644 --- a/crops/coffee.lua +++ b/crops/coffee.lua @@ -86,3 +86,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:coffee_5", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:coffee"] = { +	crop = "farming:coffee", +	seed = "farming:coffee_beans", +	minlight = 13, +	maxlight = 15, +	steps = 5 +} diff --git a/crops/corn.lua b/crops/corn.lua index 4847903..52f8b94 100644 --- a/crops/corn.lua +++ b/crops/corn.lua @@ -147,3 +147,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:corn_8", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:corn"] = { +	crop = "farming:corn", +	seed = "farming:corn", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} diff --git a/crops/cotton.lua b/crops/cotton.lua index 7f893ec..24dc7bb 100644 --- a/crops/cotton.lua +++ b/crops/cotton.lua @@ -142,6 +142,15 @@ crop_def.drop = {  }  minetest.register_node("farming:cotton_8", table.copy(crop_def)) +-- add to registered_plants +farming.registered_plants["farming:cotton"] = { +	crop = "farming:cotton", +	seed = "farming:seed_cotton", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} +  --[[ Cotton (example, is already registered in cotton.lua)  farming.register_plant("farming:cotton", {  	description = "Cotton seed", diff --git a/crops/cucumber.lua b/crops/cucumber.lua index 4e6981c..d7178b8 100644 --- a/crops/cucumber.lua +++ b/crops/cucumber.lua @@ -54,3 +54,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:cucumber_4", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:cucumber"] = { +	crop = "farming:cucumber", +	seed = "farming:cucumber", +	minlight = 13, +	maxlight = 15, +	steps = 4 +} diff --git a/crops/garlic.lua b/crops/garlic.lua index f2bb16d..09ab375 100644 --- a/crops/garlic.lua +++ b/crops/garlic.lua @@ -27,7 +27,7 @@ minetest.register_craftitem("farming:garlic", {  minetest.register_craft({  	type = "shapeless", -	output = "farming:garlic_clove 9", +	output = "farming:garlic_clove 8",  	recipe = { "farming:garlic" }  }) @@ -35,7 +35,7 @@ minetest.register_craft({  	output = "farming:garlic",  	recipe = {  		{"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"}, -		{"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"}, +		{"farming:garlic_clove", "", "farming:garlic_clove"},  		{"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"}  	}  }) @@ -126,3 +126,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:garlic_5", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:garlic"] = { +	crop = "farming:garlic", +	seed = "farming:garlic_clove", +	minlight = 13, +	maxlight = 15, +	steps = 5 +} diff --git a/crops/grapes.lua b/crops/grapes.lua index d8c6c3f..c341075 100644 --- a/crops/grapes.lua +++ b/crops/grapes.lua @@ -231,6 +231,15 @@ crop_def.drop = {  }  minetest.register_node("farming:grapes_8", table.copy(crop_def)) +-- add to registered_plants +farming.registered_plants["farming:grapes"] = { +	crop = "farming:grapes", +	seed = "farming:grapes", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} +  -- wild grape vine (this is what you find on the map)  minetest.register_node("farming:grapebush", {  	drawtype = "plantlike", diff --git a/crops/hemp.lua b/crops/hemp.lua index eb522a9..931a586 100644 --- a/crops/hemp.lua +++ b/crops/hemp.lua @@ -249,3 +249,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:hemp_8", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:hemp"] = { +	crop = "farming:hemp", +	seed = "farming:seed_hemp", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} diff --git a/crops/melon.lua b/crops/melon.lua index 43c0809..06056a0 100644 --- a/crops/melon.lua +++ b/crops/melon.lua @@ -84,3 +84,12 @@ crop_def.groups = {  --crop_def.drop = "farming:melon_slice 9"  crop_def.drop = "farming:melon_8"  minetest.register_node("farming:melon_8", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:melon"] = { +	crop = "farming:melon", +	seed = "farming:melon_slice", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} diff --git a/crops/onion.lua b/crops/onion.lua index d9268f8..f4291a5 100644 --- a/crops/onion.lua +++ b/crops/onion.lua @@ -66,3 +66,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:onion_5", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:onion"] = { +	crop = "farming:onion", +	seed = "farming:onion", +	minlight = 13, +	maxlight = 15, +	steps = 5 +} diff --git a/crops/peas.lua b/crops/peas.lua index e50564e..93e9232 100644 --- a/crops/peas.lua +++ b/crops/peas.lua @@ -87,3 +87,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:pea_5", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:pea_pod"] = { +	crop = "farming:pea", +	seed = "farming:pea_pod", +	minlight = 13, +	maxlight = 15, +	steps = 5 +} diff --git a/crops/pepper.lua b/crops/pepper.lua index 498556e..8f5e29e 100644 --- a/crops/pepper.lua +++ b/crops/pepper.lua @@ -104,3 +104,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:pepper_5", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:pepper"] = { +	crop = "farming:pepper", +	seed = "farming:peppercorn", +	minlight = 13, +	maxlight = 15, +	steps = 5 +} diff --git a/crops/pineapple.lua b/crops/pineapple.lua index 3525136..8a60310 100644 --- a/crops/pineapple.lua +++ b/crops/pineapple.lua @@ -127,3 +127,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:pineapple_8", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:pineapple"] = { +	crop = "farming:pineapple", +	seed = "farming:pineapple_top", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} diff --git a/crops/potato.lua b/crops/potato.lua index a1512c2..1547fc0 100644 --- a/crops/potato.lua +++ b/crops/potato.lua @@ -92,3 +92,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:potato_4", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:potato"] = { +	crop = "farming:potato", +	seed = "farming:potato", +	minlight = 13, +	maxlight = 15, +	steps = 4 +} diff --git a/crops/pumpkin.lua b/crops/pumpkin.lua index c864d55..c362449 100644 --- a/crops/pumpkin.lua +++ b/crops/pumpkin.lua @@ -202,12 +202,16 @@ minetest.register_node("farming:pumpkin_8", {  		food_pumpkin = 1, choppy = 1, oddly_breakable_by_hand = 1,  		flammable = 2, plant = 1  	}, ---	drop = { ---		items = { ---			{items = {'farming:pumpkin_slice 9'}, rarity = 1}, ---		} ---	},  	sounds = default.node_sound_wood_defaults(),  })  minetest.register_alias("farming:pumpkin", "farming:pumpkin_8") + +-- add to registered_plants +farming.registered_plants["farming:pumpkin"] = { +	crop = "farming:pumpkin", +	seed = "farming:pumpkin_slice", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} diff --git a/crops/raspberry.lua b/crops/raspberry.lua index 713ea2f..4938658 100644 --- a/crops/raspberry.lua +++ b/crops/raspberry.lua @@ -67,3 +67,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:raspberry_4", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:raspberries"] = { +	crop = "farming:raspberry", +	seed = "farming:raspberries", +	minlight = 13, +	maxlight = 15, +	steps = 4 +} diff --git a/crops/rhubarb.lua b/crops/rhubarb.lua index 90a2d8b..9471733 100644 --- a/crops/rhubarb.lua +++ b/crops/rhubarb.lua @@ -64,3 +64,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:rhubarb_3", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:rhubarb"] = { +	crop = "farming:rhubarb", +	seed = "farming:rhubarb", +	minlight = 13, +	maxlight = 15, +	steps = 3 +} diff --git a/crops/tomato.lua b/crops/tomato.lua index 53012a8..bab0e47 100644 --- a/crops/tomato.lua +++ b/crops/tomato.lua @@ -77,3 +77,12 @@ crop_def.drop = {  	}  }  minetest.register_node("farming:tomato_8", table.copy(crop_def)) + +-- add to registered_plants +farming.registered_plants["farming:tomato"] = { +	crop = "farming:tomato", +	seed = "farming:tomato", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} diff --git a/crops/wheat.lua b/crops/wheat.lua index abf3ada..7c77d11 100644 --- a/crops/wheat.lua +++ b/crops/wheat.lua @@ -230,6 +230,15 @@ crop_def.drop = {  }  minetest.register_node("farming:wheat_8", table.copy(crop_def)) +-- add to registered_plants +farming.registered_plants["farming:wheat"] = { +	crop = "farming:wheat", +	seed = "farming:seed_wheat", +	minlight = 13, +	maxlight = 15, +	steps = 8 +} +  -- fuels  minetest.register_craft({  	type = "fuel", @@ -585,7 +585,7 @@ farming.register_plant = function(name, def)  -- add to farming.registered_plants  farming.registered_plants[mname .. ":" .. pname] = { -	name = mname .. ":" .. pname, +	crop = mname .. ":" .. pname,  	seed = mname .. ":seed_" .. pname,  	steps = def.steps,  	minlight = def.minlight,  | 
