From bacc98d0a9281cbb4522ab7923c2e894d49b03a4 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 14 May 2019 08:43:55 +0100 Subject: [PATCH 01/13] fix water check for soil (3 horizontal, 1 below) --- README.md | 2 +- soil.lua | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 30e5673..6f57096 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t ### Changelog: -- 1.42 - Soil needs water to be present within 3 blocks horizontally and 2 below to make wet soil, Jack 'o Lanterns now check protection. +- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection. - 1.41 - Each crop has it's own spawn rate (can be changed in farming.conf) - 1.40 - Added Mithril Scythe to quick harvest and replant crops on right-click. Added Hoe's for MoreOres with Toolrank support. - 1.39 - Added Rice, Rye and Oats thanks to Ademants Grains mod. Added Jaffa Cake and multigrain bread. diff --git a/soil.lua b/soil.lua index 6e27d47..d379f5d 100644 --- a/soil.lua +++ b/soil.lua @@ -54,9 +54,9 @@ minetest.register_abm({ -- check if there is water nearby and change soil accordingly -- if minetest.find_node_near(pos, 3, {"group:water"}) then - -- check if water is within 3 nodes horizontally and 2 below + -- check if water is within 3 nodes horizontally and 1 below if #minetest.find_nodes_in_area( - {x = pos.x + 3, y = pos.y + 2, z = pos.z + 3}, + {x = pos.x + 3, y = pos.y - 1, z = pos.z + 3}, {x = pos.x - 3, y = pos.y , z = pos.z - 3}, {"group:water"}) > 0 then From d67b46650614b6bf0bbb2096f3bb9f690dde43fb Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Thu, 23 May 2019 19:29:06 +0100 Subject: [PATCH 02/13] changed ipairs to pairs to cover all crops --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index a19c2df..38626ba 100644 --- a/init.lua +++ b/init.lua @@ -269,7 +269,7 @@ end minetest.after(0, function() - for _, node_def in ipairs(minetest.registered_nodes) do + for _, node_def in pairs(minetest.registered_nodes) do register_plant_node(node_def) end end) From 5decae8261bd54277e6af96dac82a6c2120a4874 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Fri, 24 May 2019 14:26:09 +0100 Subject: [PATCH 03/13] remove duplicate line --- farming.conf_example | 1 - 1 file changed, 1 deletion(-) diff --git a/farming.conf_example b/farming.conf_example index d108bb5..9338142 100644 --- a/farming.conf_example +++ b/farming.conf_example @@ -30,7 +30,6 @@ farming.pineapple = 0.001 farming.peas = 0.001 farming.beetroot = 0.001 farming.grains = true -- true or false only -farming.rarety = 0.002 -- default rarety of crops on map (higher number = more crops) farming.rarety = 0.002 From c770314ddadb4a6250f3ca6674c03d41e1cb14ea Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Mon, 3 Jun 2019 08:47:57 +0100 Subject: [PATCH 04/13] add hoe group to hoes --- hoes.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hoes.lua b/hoes.lua index ed833e5..1b33774 100644 --- a/hoes.lua +++ b/hoes.lua @@ -24,6 +24,10 @@ farming.register_hoe = function(name, def) def.max_uses = 30 end + -- add hoe group + def.groups = def.groups or {} + def.groups.hoe = 1 + -- Register the tool minetest.register_tool(name, { description = def.description, From f187396d259b949ddde5b3f16d56c8b5a52b51b5 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Wed, 19 Jun 2019 11:37:39 +0100 Subject: [PATCH 05/13] add chocolate block --- README.md | 2 +- crops/cocoa.lua | 25 +++++++++++++++++++++++++ textures/farming_chocolate_block.png | Bin 0 -> 144 bytes 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 textures/farming_chocolate_block.png diff --git a/README.md b/README.md index 6f57096..0dfebbb 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t ### Changelog: -- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection. +- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection, add chocolate block - 1.41 - Each crop has it's own spawn rate (can be changed in farming.conf) - 1.40 - Added Mithril Scythe to quick harvest and replant crops on right-click. Added Hoe's for MoreOres with Toolrank support. - 1.39 - Added Rice, Rye and Oats thanks to Ademants Grains mod. Added Jaffa Cake and multigrain bread. diff --git a/crops/cocoa.lua b/crops/cocoa.lua index 7b5e8d4..8ced587 100644 --- a/crops/cocoa.lua +++ b/crops/cocoa.lua @@ -108,6 +108,31 @@ minetest.register_craft( { } }) +-- chocolate block +minetest.register_node("farming:chocolate_block", { + description = S("Chocolate Block"), + tiles = {"farming_chocolate_block.png"}, + is_ground_content = false, + groups = {cracky = 2, oddly_breakable_by_hand = 2}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + output = "farming:chocolate_block 3", + recipe = { + {"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"}, + {"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"}, + {"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"}, + } +}) + +minetest.register_craft({ + output = "farming:chocolate_dark 9", + recipe = { + {"farming:chocolate_block"}, + } +}) + -- cocoa definition local crop_def = { drawtype = "plantlike", diff --git a/textures/farming_chocolate_block.png b/textures/farming_chocolate_block.png new file mode 100644 index 0000000000000000000000000000000000000000..20e5a79ba379376f18e5295e671756671d40f3e9 GIT binary patch literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!93?!50ihlx9oB=)|uI4ffsm4qlE{wkxv8VtA zojhF}LpZJ{M{Lcy>eVL3#^%=6w*~YbEEn~`oD;F*VFuZ>+euBNM Date: Tue, 25 Jun 2019 15:08:08 +0100 Subject: [PATCH 06/13] slightly increase spawn rate of chili and hemp --- farming.conf_example | 4 ++-- init.lua | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/farming.conf_example b/farming.conf_example index 9338142..c2c5de0 100644 --- a/farming.conf_example +++ b/farming.conf_example @@ -21,8 +21,8 @@ farming.rhubarb = 0.001 farming.beans = 0.001 farming.grapes = 0.001 farming.barley = true -- true or false only -farming.chili = 0.002 -farming.hemp = 0.002 +farming.chili = 0.003 +farming.hemp = 0.003 farming.garlic = 0.001 farming.onion = 0.001 farming.pepper = 0.002 diff --git a/init.lua b/init.lua index 38626ba..8e2c9b5 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ farming = { mod = "redo", - version = "20190427", + version = "20190625", path = minetest.get_modpath("farming"), select = { type = "fixed", @@ -614,8 +614,8 @@ farming.rhubarb = 0.001 farming.beans = 0.001 farming.grapes = 0.001 farming.barley = true -farming.chili = 0.002 -farming.hemp = 0.002 +farming.chili = 0.003 +farming.hemp = 0.003 farming.garlic = 0.001 farming.onion = 0.001 farming.pepper = 0.002 From 4465c49a192449904a85223c4c0627fd60019c37 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Tue, 25 Jun 2019 20:27:28 +0100 Subject: [PATCH 07/13] fix crafting bug --- crops/cocoa.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crops/cocoa.lua b/crops/cocoa.lua index 8ced587..6a6ffa6 100644 --- a/crops/cocoa.lua +++ b/crops/cocoa.lua @@ -118,7 +118,7 @@ minetest.register_node("farming:chocolate_block", { }) minetest.register_craft({ - output = "farming:chocolate_block 3", + output = "farming:chocolate_block", recipe = { {"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"}, {"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"}, From d5dab7938a5bae1b727b37815b6ab57c465e98a0 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sun, 28 Jul 2019 08:38:43 +0100 Subject: [PATCH 08/13] add nil check for itemstack when placing and taking seed from inventory --- init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 8e2c9b5..77e43ff 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ farming = { mod = "redo", - version = "20190625", + version = "20190728", path = minetest.get_modpath("farming"), select = { type = "fixed", @@ -461,7 +461,8 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) - if placer and not farming.is_creative(placer:get_player_name()) then + if placer and itemstack + and not farming.is_creative(placer:get_player_name()) then local name = itemstack:get_name() From faed117a6ddfaf3bbac39d0301954b9e4919af84 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Mon, 5 Aug 2019 09:12:06 +0100 Subject: [PATCH 09/13] code tidy ' to " --- crops/barley.lua | 16 ++++++++-------- crops/beans.lua | 24 ++++++++++++------------ crops/beetroot.lua | 8 ++++---- crops/blueberry.lua | 6 +++--- crops/carrot.lua | 8 ++++---- crops/chili.lua | 6 +++--- crops/cocoa.lua | 10 +++++----- crops/coffee.lua | 6 +++--- crops/corn.lua | 12 ++++++------ crops/cucumber.lua | 4 ++-- crops/garlic.lua | 12 ++++++------ crops/grapes.lua | 24 ++++++++++++------------ crops/hemp.lua | 22 +++++++++++----------- crops/onion.lua | 10 +++++----- crops/peas.lua | 9 ++++----- crops/pepper.lua | 6 +++--- crops/pineapple.lua | 4 ++-- crops/potato.lua | 8 ++++---- crops/pumpkin.lua | 2 +- crops/raspberry.lua | 6 +++--- crops/rhubarb.lua | 6 +++--- crops/tomato.lua | 8 ++++---- crops/wheat.lua | 24 ++++++++++++------------ food.lua | 8 ++++---- grass.lua | 18 +++++++++--------- 25 files changed, 133 insertions(+), 134 deletions(-) diff --git a/crops/barley.lua b/crops/barley.lua index cc5ca0f..d896031 100644 --- a/crops/barley.lua +++ b/crops/barley.lua @@ -75,8 +75,8 @@ minetest.register_node("farming:barley_4", table.copy(crop_def)) crop_def.tiles = {"farming_barley_5.png"} crop_def.drop = { items = { - {items = {'farming:barley'}, rarity = 2}, - {items = {'farming:seed_barley'}, rarity = 2}, + {items = {"farming:barley"}, rarity = 2}, + {items = {"farming:seed_barley"}, rarity = 2}, } } minetest.register_node("farming:barley_5", table.copy(crop_def)) @@ -85,8 +85,8 @@ minetest.register_node("farming:barley_5", table.copy(crop_def)) crop_def.tiles = {"farming_barley_6.png"} crop_def.drop = { items = { - {items = {'farming:barley'}, rarity = 2}, - {items = {'farming:seed_barley'}, rarity = 1}, + {items = {"farming:barley"}, rarity = 2}, + {items = {"farming:seed_barley"}, rarity = 1}, } } minetest.register_node("farming:barley_6", table.copy(crop_def)) @@ -96,10 +96,10 @@ crop_def.tiles = {"farming_barley_7.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:barley'}, rarity = 1}, - {items = {'farming:barley'}, rarity = 3}, - {items = {'farming:seed_barley'}, rarity = 1}, - {items = {'farming:seed_barley'}, rarity = 3}, + {items = {"farming:barley"}, rarity = 1}, + {items = {"farming:barley"}, rarity = 3}, + {items = {"farming:seed_barley"}, rarity = 1}, + {items = {"farming:seed_barley"}, rarity = 3}, } } minetest.register_node("farming:barley_7", table.copy(crop_def)) diff --git a/crops/beans.lua b/crops/beans.lua index bd3b8ee..d02cff5 100644 --- a/crops/beans.lua +++ b/crops/beans.lua @@ -84,7 +84,7 @@ minetest.register_craftitem("farming:beans", { minetest.register_craft({ output = "dye:green", recipe = { - {'farming:beans'}, + {"farming:beans"}, } }) @@ -162,9 +162,9 @@ minetest.register_node("farming:beanpole", { minetest.register_craft({ output = "farming:beanpole", recipe = { - {'', '', ''}, - {'default:stick', '', 'default:stick'}, - {'default:stick', '', 'default:stick'}, + {"", "", ""}, + {"default:stick", "", "default:stick"}, + {"default:stick", "", "default:stick"}, } }) @@ -185,7 +185,7 @@ local crop_def = { sunlight_propagates = true, drop = { items = { - {items = {'farming:beanpole'}, rarity = 1}, + {items = {"farming:beanpole"}, rarity = 1}, } }, selection_box = farming.select, @@ -216,10 +216,10 @@ crop_def.tiles = {"farming_beanpole_5.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:beanpole'}, rarity = 1}, - {items = {'farming:beans 3'}, rarity = 1}, - {items = {'farming:beans 2'}, rarity = 2}, - {items = {'farming:beans 2'}, rarity = 3}, + {items = {"farming:beanpole"}, rarity = 1}, + {items = {"farming:beans 3"}, rarity = 1}, + {items = {"farming:beans 2"}, rarity = 2}, + {items = {"farming:beans 2"}, rarity = 3}, } } minetest.register_node("farming:beanpole_5", table.copy(crop_def)) @@ -244,9 +244,9 @@ minetest.register_node("farming:beanbush", { sunlight_propagates = true, drop = { items = { - {items = {'farming:beans 1'}, rarity = 1}, - {items = {'farming:beans 1'}, rarity = 2}, - {items = {'farming:beans 1'}, rarity = 3}, + {items = {"farming:beans 1"}, rarity = 1}, + {items = {"farming:beans 1"}, rarity = 2}, + {items = {"farming:beans 1"}, rarity = 3}, } }, selection_box = farming.select, diff --git a/crops/beetroot.lua b/crops/beetroot.lua index 8f7069b..e1aa58e 100644 --- a/crops/beetroot.lua +++ b/crops/beetroot.lua @@ -76,10 +76,10 @@ crop_def.tiles = {"farming_beetroot_5.png"} crop_def.groups.growing = 0 crop_def.drop = { max_items = 4, items = { - {items = {'farming:beetroot'}, rarity = 1}, - {items = {'farming:beetroot'}, rarity = 2}, - {items = {'farming:beetroot'}, rarity = 3}, - {items = {'farming:beetroot'}, rarity = 4}, + {items = {"farming:beetroot"}, rarity = 1}, + {items = {"farming:beetroot"}, rarity = 2}, + {items = {"farming:beetroot"}, rarity = 3}, + {items = {"farming:beetroot"}, rarity = 4}, } } minetest.register_node("farming:beetroot_5", table.copy(crop_def)) diff --git a/crops/blueberry.lua b/crops/blueberry.lua index 6752e35..0b35343 100644 --- a/crops/blueberry.lua +++ b/crops/blueberry.lua @@ -78,9 +78,9 @@ crop_def.tiles = {"farming_blueberry_4.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:blueberries 2'}, rarity = 1}, - {items = {'farming:blueberries'}, rarity = 2}, - {items = {'farming:blueberries'}, rarity = 3}, + {items = {"farming:blueberries 2"}, rarity = 1}, + {items = {"farming:blueberries"}, rarity = 2}, + {items = {"farming:blueberries"}, rarity = 3}, } } minetest.register_node("farming:blueberry_4", table.copy(crop_def)) diff --git a/crops/carrot.lua b/crops/carrot.lua index 6ec1994..ec3ff8b 100644 --- a/crops/carrot.lua +++ b/crops/carrot.lua @@ -97,8 +97,8 @@ minetest.register_node("farming:carrot_6", table.copy(crop_def)) crop_def.tiles = {"farming_carrot_7.png"} crop_def.drop = { items = { - {items = {'farming:carrot'}, rarity = 1}, - {items = {'farming:carrot 2'}, rarity = 3}, + {items = {"farming:carrot"}, rarity = 1}, + {items = {"farming:carrot 2"}, rarity = 3}, } } minetest.register_node("farming:carrot_7", table.copy(crop_def)) @@ -108,8 +108,8 @@ crop_def.tiles = {"farming_carrot_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:carrot 2'}, rarity = 1}, - {items = {'farming:carrot 3'}, rarity = 2}, + {items = {"farming:carrot 2"}, rarity = 1}, + {items = {"farming:carrot 3"}, rarity = 2}, } } minetest.register_node("farming:carrot_8", table.copy(crop_def)) diff --git a/crops/chili.lua b/crops/chili.lua index 429d256..cade3b2 100644 --- a/crops/chili.lua +++ b/crops/chili.lua @@ -32,7 +32,7 @@ minetest.register_craft({ minetest.register_craft({ output = "dye:red", recipe = { - {'farming:chili_pepper'}, + {"farming:chili_pepper"}, } }) @@ -85,8 +85,8 @@ crop_def.tiles = {"farming_chili_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:chili_pepper 3'}, rarity = 1}, - {items = {'farming:chili_pepper 2'}, rarity = 2}, + {items = {"farming:chili_pepper 3"}, rarity = 1}, + {items = {"farming:chili_pepper 2"}, rarity = 2}, } } minetest.register_node("farming:chili_8", table.copy(crop_def)) diff --git a/crops/cocoa.lua b/crops/cocoa.lua index 6a6ffa6..fc044e4 100644 --- a/crops/cocoa.lua +++ b/crops/cocoa.lua @@ -141,7 +141,7 @@ local crop_def = { walkable = false, drop = { items = { - {items = {'farming:cocoa_beans 1'}, rarity = 2}, + {items = {"farming:cocoa_beans 1"}, rarity = 2}, } }, selection_box = { @@ -172,7 +172,7 @@ minetest.register_node("farming:cocoa_2", table.copy(crop_def)) crop_def.tiles = {"farming_cocoa_3.png"} crop_def.drop = { items = { - {items = {'farming:cocoa_beans 1'}, rarity = 1}, + {items = {"farming:cocoa_beans 1"}, rarity = 1}, } } minetest.register_node("farming:cocoa_3", table.copy(crop_def)) @@ -183,9 +183,9 @@ crop_def.groups.growing = 0 crop_def.growth_check = nil crop_def.drop = { items = { - {items = {'farming:cocoa_beans 2'}, rarity = 1}, - {items = {'farming:cocoa_beans 1'}, rarity = 2}, - {items = {'farming:cocoa_beans 1'}, rarity = 4}, + {items = {"farming:cocoa_beans 2"}, rarity = 1}, + {items = {"farming:cocoa_beans 1"}, rarity = 2}, + {items = {"farming:cocoa_beans 1"}, rarity = 4}, } } minetest.register_node("farming:cocoa_4", table.copy(crop_def)) diff --git a/crops/coffee.lua b/crops/coffee.lua index c4528e2..6d2fad8 100644 --- a/crops/coffee.lua +++ b/crops/coffee.lua @@ -80,9 +80,9 @@ crop_def.tiles = {"farming_coffee_5.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:coffee_beans 2'}, rarity = 1}, - {items = {'farming:coffee_beans 2'}, rarity = 2}, - {items = {'farming:coffee_beans 2'}, rarity = 3}, + {items = {"farming:coffee_beans 2"}, rarity = 1}, + {items = {"farming:coffee_beans 2"}, rarity = 2}, + {items = {"farming:coffee_beans 2"}, rarity = 3}, } } minetest.register_node("farming:coffee_5", table.copy(crop_def)) diff --git a/crops/corn.lua b/crops/corn.lua index 52f8b94..1d3e21a 100644 --- a/crops/corn.lua +++ b/crops/corn.lua @@ -129,9 +129,9 @@ minetest.register_node("farming:corn_6", table.copy(crop_def)) crop_def.tiles = {"farming_corn_7.png"} crop_def.drop = { items = { - {items = {'farming:corn'}, rarity = 1}, - {items = {'farming:corn'}, rarity = 2}, - {items = {'farming:corn'}, rarity = 3}, + {items = {"farming:corn"}, rarity = 1}, + {items = {"farming:corn"}, rarity = 2}, + {items = {"farming:corn"}, rarity = 3}, } } minetest.register_node("farming:corn_7", table.copy(crop_def)) @@ -141,9 +141,9 @@ crop_def.tiles = {"farming_corn_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:corn 2'}, rarity = 1}, - {items = {'farming:corn 2'}, rarity = 2}, - {items = {'farming:corn 2'}, rarity = 2}, + {items = {"farming:corn 2"}, rarity = 1}, + {items = {"farming:corn 2"}, rarity = 2}, + {items = {"farming:corn 2"}, rarity = 2}, } } minetest.register_node("farming:corn_8", table.copy(crop_def)) diff --git a/crops/cucumber.lua b/crops/cucumber.lua index d7178b8..b3761bd 100644 --- a/crops/cucumber.lua +++ b/crops/cucumber.lua @@ -49,8 +49,8 @@ crop_def.tiles = {"farming_cucumber_4.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:cucumber 2'}, rarity = 1}, - {items = {'farming:cucumber 2'}, rarity = 2}, + {items = {"farming:cucumber 2"}, rarity = 1}, + {items = {"farming:cucumber 2"}, rarity = 2}, } } minetest.register_node("farming:cucumber_4", table.copy(crop_def)) diff --git a/crops/garlic.lua b/crops/garlic.lua index 09ab375..83884d0 100644 --- a/crops/garlic.lua +++ b/crops/garlic.lua @@ -65,7 +65,7 @@ minetest.register_node("farming:garlic_braid", { minetest.register_craft({ output = "farming:garlic_braid", - recipe = { + recipe = { {"farming:garlic", "farming:garlic", "farming:garlic"}, {"farming:garlic", "farming:garlic", "farming:garlic"}, {"farming:garlic", "farming:garlic", "farming:garlic"} @@ -118,11 +118,11 @@ crop_def.tiles = {"crops_garlic_plant_5.png"} crop_def.groups.growing = 0 crop_def.drop = { max_items = 5, items = { - {items = {'farming:garlic'}, rarity = 1}, - {items = {'farming:garlic'}, rarity = 1}, - {items = {'farming:garlic'}, rarity = 1}, - {items = {'farming:garlic'}, rarity = 2}, - {items = {'farming:garlic'}, rarity = 5}, + {items = {"farming:garlic"}, rarity = 1}, + {items = {"farming:garlic"}, rarity = 1}, + {items = {"farming:garlic"}, rarity = 1}, + {items = {"farming:garlic"}, rarity = 2}, + {items = {"farming:garlic"}, rarity = 5}, } } minetest.register_node("farming:garlic_5", table.copy(crop_def)) diff --git a/crops/grapes.lua b/crops/grapes.lua index 2b33427..af57345 100644 --- a/crops/grapes.lua +++ b/crops/grapes.lua @@ -79,7 +79,7 @@ minetest.register_craftitem("farming:grapes", { minetest.register_craft({ output = "dye:violet", recipe = { - {'farming:grapes'}, + {"farming:grapes"}, } }) @@ -157,9 +157,9 @@ minetest.register_node("farming:trellis", { minetest.register_craft({ output = "farming:trellis", recipe = { - {'default:stick', 'default:stick', 'default:stick'}, - {'default:stick', 'default:stick', 'default:stick'}, - {'default:stick', 'default:stick', 'default:stick'}, + {"default:stick", "default:stick", "default:stick"}, + {"default:stick", "default:stick", "default:stick"}, + {"default:stick", "default:stick", "default:stick"}, } }) @@ -180,7 +180,7 @@ local crop_def = { sunlight_propagates = true, drop = { items = { - {items = {'farming:trellis'}, rarity = 1}, + {items = {"farming:trellis"}, rarity = 1}, } }, selection_box = farming.select, @@ -223,10 +223,10 @@ crop_def.tiles = {"farming_grapes_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:trellis'}, rarity = 1}, - {items = {'farming:grapes 3'}, rarity = 1}, - {items = {'farming:grapes 1'}, rarity = 2}, - {items = {'farming:grapes 1'}, rarity = 3}, + {items = {"farming:trellis"}, rarity = 1}, + {items = {"farming:grapes 3"}, rarity = 1}, + {items = {"farming:grapes 1"}, rarity = 2}, + {items = {"farming:grapes 1"}, rarity = 3}, } } minetest.register_node("farming:grapes_8", table.copy(crop_def)) @@ -251,9 +251,9 @@ minetest.register_node("farming:grapebush", { sunlight_propagates = true, drop = { items = { - {items = {'farming:grapes 1'}, rarity = 1}, - {items = {'farming:grapes 1'}, rarity = 2}, - {items = {'farming:grapes 1'}, rarity = 3}, + {items = {"farming:grapes 1"}, rarity = 1}, + {items = {"farming:grapes 1"}, rarity = 2}, + {items = {"farming:grapes 1"}, rarity = 3}, } }, selection_box = farming.select, diff --git a/crops/hemp.lua b/crops/hemp.lua index 931a586..e08384c 100644 --- a/crops/hemp.lua +++ b/crops/hemp.lua @@ -69,7 +69,7 @@ minetest.register_craft({ }) -- hemp fibre -minetest.register_craftitem("farming:hemp_fibre", { +minetest.register_craftitem("farming:hemp_fibre", { description = S("Hemp Fibre"), inventory_image = "farming_hemp_fibre.png", }) @@ -219,8 +219,8 @@ minetest.register_node("farming:hemp_5", table.copy(crop_def)) crop_def.tiles = {"farming_hemp_6.png"} crop_def.drop = { items = { - {items = {'farming:hemp_leaf'}, rarity = 2}, - {items = {'farming:seed_hemp'}, rarity = 1}, + {items = {"farming:hemp_leaf"}, rarity = 2}, + {items = {"farming:seed_hemp"}, rarity = 1}, } } minetest.register_node("farming:hemp_6", table.copy(crop_def)) @@ -229,10 +229,10 @@ minetest.register_node("farming:hemp_6", table.copy(crop_def)) crop_def.tiles = {"farming_hemp_7.png"} crop_def.drop = { items = { - {items = {'farming:hemp_leaf'}, rarity = 1}, - {items = {'farming:hemp_leaf'}, rarity = 3}, - {items = {'farming:seed_hemp'}, rarity = 1}, - {items = {'farming:seed_hemp'}, rarity = 3}, + {items = {"farming:hemp_leaf"}, rarity = 1}, + {items = {"farming:hemp_leaf"}, rarity = 3}, + {items = {"farming:seed_hemp"}, rarity = 1}, + {items = {"farming:seed_hemp"}, rarity = 3}, } } minetest.register_node("farming:hemp_7", table.copy(crop_def)) @@ -242,10 +242,10 @@ crop_def.tiles = {"farming_hemp_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:hemp_leaf 2'}, rarity = 1}, - {items = {'farming:hemp_leaf'}, rarity = 2}, - {items = {'farming:seed_hemp'}, rarity = 1}, - {items = {'farming:seed_hemp'}, rarity = 2}, + {items = {"farming:hemp_leaf 2"}, rarity = 1}, + {items = {"farming:hemp_leaf"}, rarity = 2}, + {items = {"farming:seed_hemp"}, rarity = 1}, + {items = {"farming:seed_hemp"}, rarity = 2}, } } minetest.register_node("farming:hemp_8", table.copy(crop_def)) diff --git a/crops/onion.lua b/crops/onion.lua index f4291a5..ae36d0d 100644 --- a/crops/onion.lua +++ b/crops/onion.lua @@ -58,11 +58,11 @@ crop_def.tiles = {"crops_onion_plant_5.png"} crop_def.groups.growing = 0 crop_def.drop = { max_items = 5, items = { - {items = {'farming:onion'}, rarity = 1}, - {items = {'farming:onion'}, rarity = 1}, - {items = {'farming:onion'}, rarity = 2}, - {items = {'farming:onion'}, rarity = 2}, - {items = {'farming:onion'}, rarity = 5}, + {items = {"farming:onion"}, rarity = 1}, + {items = {"farming:onion"}, rarity = 1}, + {items = {"farming:onion"}, rarity = 2}, + {items = {"farming:onion"}, rarity = 2}, + {items = {"farming:onion"}, rarity = 5}, } } minetest.register_node("farming:onion_5", table.copy(crop_def)) diff --git a/crops/peas.lua b/crops/peas.lua index 93e9232..e12253b 100644 --- a/crops/peas.lua +++ b/crops/peas.lua @@ -79,11 +79,10 @@ crop_def.tiles = {"farming_pea_5.png"} crop_def.groups.growing = 0 crop_def.drop = { max_items = 5, items = { - {items = {'farming:pea_pod'}, rarity = 1}, - {items = {'farming:pea_pod'}, rarity = 2}, - {items = {'farming:pea_pod'}, rarity = 3}, - {items = {'farming:pea_pod'}, rarity = 4}, - {items = {'farming:pea_pod'}, rarity = 5}, + {items = {"farming:pea_pod"}, rarity = 1}, + {items = {"farming:pea_pod"}, rarity = 2}, + {items = {"farming:pea_pod"}, rarity = 3}, + {items = {"farming:pea_pod"}, rarity = 5}, } } minetest.register_node("farming:pea_5", table.copy(crop_def)) diff --git a/crops/pepper.lua b/crops/pepper.lua index 8f5e29e..19c7b05 100644 --- a/crops/pepper.lua +++ b/crops/pepper.lua @@ -98,9 +98,9 @@ crop_def.tiles = {"crops_pepper_plant_5.png"} crop_def.groups.growing = 0 crop_def.drop = { max_items = 2, items = { - {items = {'farming:pepper 2'}, rarity = 1}, - {items = {'farming:pepper'}, rarity = 2}, - {items = {'farming:pepper'}, rarity = 3}, + {items = {"farming:pepper 2"}, rarity = 1}, + {items = {"farming:pepper"}, rarity = 2}, + {items = {"farming:pepper"}, rarity = 3}, } } minetest.register_node("farming:pepper_5", table.copy(crop_def)) diff --git a/crops/pineapple.lua b/crops/pineapple.lua index f62042e..62d8216 100644 --- a/crops/pineapple.lua +++ b/crops/pineapple.lua @@ -123,8 +123,8 @@ crop_def.tiles = {"farming_pineapple_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:pineapple'}, rarity = 1}, - {items = {'farming:pineapple'}, rarity = 15}, + {items = {"farming:pineapple"}, rarity = 1}, + {items = {"farming:pineapple"}, rarity = 15}, } } minetest.register_node("farming:pineapple_8", table.copy(crop_def)) diff --git a/crops/potato.lua b/crops/potato.lua index 256ce97..e81cce6 100644 --- a/crops/potato.lua +++ b/crops/potato.lua @@ -85,8 +85,8 @@ minetest.register_node("farming:potato_2", table.copy(crop_def)) crop_def.tiles = {"farming_potato_3.png"} crop_def.drop = { items = { - {items = {'farming:potato'}, rarity = 1}, - {items = {'farming:potato'}, rarity = 3}, + {items = {"farming:potato"}, rarity = 1}, + {items = {"farming:potato"}, rarity = 3}, } } minetest.register_node("farming:potato_3", table.copy(crop_def)) @@ -96,8 +96,8 @@ crop_def.tiles = {"farming_potato_4.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:potato 2'}, rarity = 1}, - {items = {'farming:potato 3'}, rarity = 2}, + {items = {"farming:potato 2"}, rarity = 1}, + {items = {"farming:potato 3"}, rarity = 2}, } } minetest.register_node("farming:potato_4", table.copy(crop_def)) diff --git a/crops/pumpkin.lua b/crops/pumpkin.lua index 3960a26..508c2b2 100644 --- a/crops/pumpkin.lua +++ b/crops/pumpkin.lua @@ -189,7 +189,7 @@ crop_def.tiles = {"farming_pumpkin_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:pumpkin_slice 9'}, rarity = 1}, + {items = {"farming:pumpkin_slice 9"}, rarity = 1}, } } minetest.register_node("farming:pumpkin_8", table.copy(crop_def)) diff --git a/crops/raspberry.lua b/crops/raspberry.lua index 979bdfb..a72137b 100644 --- a/crops/raspberry.lua +++ b/crops/raspberry.lua @@ -62,9 +62,9 @@ crop_def.tiles = {"farming_raspberry_4.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:raspberries 2'}, rarity = 1}, - {items = {'farming:raspberries'}, rarity = 2}, - {items = {'farming:raspberries'}, rarity = 3}, + {items = {"farming:raspberries 2"}, rarity = 1}, + {items = {"farming:raspberries"}, rarity = 2}, + {items = {"farming:raspberries"}, rarity = 3}, } } minetest.register_node("farming:raspberry_4", table.copy(crop_def)) diff --git a/crops/rhubarb.lua b/crops/rhubarb.lua index 9471733..fdcd11b 100644 --- a/crops/rhubarb.lua +++ b/crops/rhubarb.lua @@ -58,9 +58,9 @@ crop_def.tiles = {"farming_rhubarb_3.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:rhubarb 2'}, rarity = 1}, - {items = {'farming:rhubarb'}, rarity = 2}, - {items = {'farming:rhubarb'}, rarity = 3}, + {items = {"farming:rhubarb 2"}, rarity = 1}, + {items = {"farming:rhubarb"}, rarity = 2}, + {items = {"farming:rhubarb"}, rarity = 3}, } } minetest.register_node("farming:rhubarb_3", table.copy(crop_def)) diff --git a/crops/tomato.lua b/crops/tomato.lua index bab0e47..573661d 100644 --- a/crops/tomato.lua +++ b/crops/tomato.lua @@ -61,8 +61,8 @@ minetest.register_node("farming:tomato_6", table.copy(crop_def)) crop_def.tiles = {"farming_tomato_7.png"} crop_def.drop = { items = { - {items = {'farming:tomato'}, rarity = 1}, - {items = {'farming:tomato'}, rarity = 3}, + {items = {"farming:tomato"}, rarity = 1}, + {items = {"farming:tomato"}, rarity = 3}, } } minetest.register_node("farming:tomato_7", table.copy(crop_def)) @@ -72,8 +72,8 @@ crop_def.tiles = {"farming_tomato_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:tomato 3'}, rarity = 1}, - {items = {'farming:tomato 3'}, rarity = 2}, + {items = {"farming:tomato 3"}, rarity = 1}, + {items = {"farming:tomato 3"}, rarity = 2}, } } minetest.register_node("farming:tomato_8", table.copy(crop_def)) diff --git a/crops/wheat.lua b/crops/wheat.lua index 7c77d11..b047561 100644 --- a/crops/wheat.lua +++ b/crops/wheat.lua @@ -189,8 +189,8 @@ minetest.register_node("farming:wheat_4", table.copy(crop_def)) crop_def.tiles = {"farming_wheat_5.png"} crop_def.drop = { items = { - {items = {'farming:wheat'}, rarity = 2}, - {items = {'farming:seed_wheat'}, rarity = 2}, + {items = {"farming:wheat"}, rarity = 2}, + {items = {"farming:seed_wheat"}, rarity = 2}, } } minetest.register_node("farming:wheat_5", table.copy(crop_def)) @@ -199,8 +199,8 @@ minetest.register_node("farming:wheat_5", table.copy(crop_def)) crop_def.tiles = {"farming_wheat_6.png"} crop_def.drop = { items = { - {items = {'farming:wheat'}, rarity = 2}, - {items = {'farming:seed_wheat'}, rarity = 1}, + {items = {"farming:wheat"}, rarity = 2}, + {items = {"farming:seed_wheat"}, rarity = 1}, } } minetest.register_node("farming:wheat_6", table.copy(crop_def)) @@ -209,10 +209,10 @@ minetest.register_node("farming:wheat_6", table.copy(crop_def)) crop_def.tiles = {"farming_wheat_7.png"} crop_def.drop = { items = { - {items = {'farming:wheat'}, rarity = 1}, - {items = {'farming:wheat'}, rarity = 3}, - {items = {'farming:seed_wheat'}, rarity = 1}, - {items = {'farming:seed_wheat'}, rarity = 3}, + {items = {"farming:wheat"}, rarity = 1}, + {items = {"farming:wheat"}, rarity = 3}, + {items = {"farming:seed_wheat"}, rarity = 1}, + {items = {"farming:seed_wheat"}, rarity = 3}, } } minetest.register_node("farming:wheat_7", table.copy(crop_def)) @@ -222,10 +222,10 @@ crop_def.tiles = {"farming_wheat_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {'farming:wheat'}, rarity = 1}, - {items = {'farming:wheat'}, rarity = 3}, - {items = {'farming:seed_wheat'}, rarity = 1}, - {items = {'farming:seed_wheat'}, rarity = 3}, + {items = {"farming:wheat"}, rarity = 1}, + {items = {"farming:wheat"}, rarity = 3}, + {items = {"farming:seed_wheat"}, rarity = 1}, + {items = {"farming:seed_wheat"}, rarity = 3}, } } minetest.register_node("farming:wheat_8", table.copy(crop_def)) diff --git a/food.lua b/food.lua index 1670f1f..00f3267 100644 --- a/food.lua +++ b/food.lua @@ -139,8 +139,8 @@ minetest.register_craftitem("farming:donut_chocolate", { minetest.register_craft({ output = "farming:donut_chocolate", recipe = { - {'group:food_cocoa'}, - {'farming:donut'}, + {"group:food_cocoa"}, + {"farming:donut"}, } }) @@ -153,8 +153,8 @@ minetest.register_craftitem("farming:donut_apple", { minetest.register_craft({ output = "farming:donut_apple", recipe = { - {'default:apple'}, - {'farming:donut'}, + {"default:apple"}, + {"farming:donut"}, } }) diff --git a/grass.lua b/grass.lua index 53ea606..6a9e94f 100644 --- a/grass.lua +++ b/grass.lua @@ -7,9 +7,9 @@ for i = 4, 5 do drop = { max_items = 1, items = { - {items = {'farming:seed_wheat'}, rarity = 5}, - {items = {'farming:seed_oat'},rarity = 5}, - {items = {'default:grass_1'}}, + {items = {"farming:seed_wheat"}, rarity = 5}, + {items = {"farming:seed_oat"},rarity = 5}, + {items = {"default:grass_1"}}, } }, }) @@ -22,9 +22,9 @@ for i = 4, 5 do drop = { max_items = 1, items = { - {items = {'farming:seed_barley'}, rarity = 5}, - {items = {'farming:seed_rye'},rarity = 5}, - {items = {'default:dry_grass_1'}}, + {items = {"farming:seed_barley"}, rarity = 5}, + {items = {"farming:seed_rye"},rarity = 5}, + {items = {"default:dry_grass_1"}}, } }, }) @@ -38,9 +38,9 @@ minetest.override_item("default:junglegrass", { drop = { max_items = 1, items = { - {items = {'farming:seed_cotton'}, rarity = 8}, - {items = {'farming:seed_rice'},rarity = 8}, - {items = {'default:junglegrass'}}, + {items = {"farming:seed_cotton"}, rarity = 8}, + {items = {"farming:seed_rice"},rarity = 8}, + {items = {"default:junglegrass"}}, } }, }) From d780097a4881bbbbdf3c573582529195142ae5b8 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Wed, 2 Oct 2019 19:13:55 +0100 Subject: [PATCH 10/13] add some nil checks for itemstack when right clicking on_rightclick nodes --- crops/beans.lua | 2 +- crops/cocoa.lua | 2 +- crops/grapes.lua | 2 +- init.lua | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crops/beans.lua b/crops/beans.lua index d02cff5..5017248 100644 --- a/crops/beans.lua +++ b/crops/beans.lua @@ -27,7 +27,7 @@ local function place_beans(itemstack, placer, pointed_thing, plantname) -- am I right-clicking on something that has a custom on_place set? -- thanks to Krock for helping with this issue :) local def = minetest.registered_nodes[under.name] - if placer and def and def.on_rightclick then + if placer and itemstack and def and def.on_rightclick then return def.on_rightclick(pt.under, under, placer, itemstack) end diff --git a/crops/cocoa.lua b/crops/cocoa.lua index fc044e4..3f54a89 100644 --- a/crops/cocoa.lua +++ b/crops/cocoa.lua @@ -21,7 +21,7 @@ local function place_cocoa(itemstack, placer, pointed_thing, plantname) -- am I right-clicking on something that has a custom on_place set? -- thanks to Krock for helping with this issue :) local def = minetest.registered_nodes[under.name] - if placer and def and def.on_rightclick then + if placer and itemstack and def and def.on_rightclick then return def.on_rightclick(pt.under, under, placer, itemstack) end diff --git a/crops/grapes.lua b/crops/grapes.lua index af57345..a41bb88 100644 --- a/crops/grapes.lua +++ b/crops/grapes.lua @@ -22,7 +22,7 @@ local function place_grapes(itemstack, placer, pointed_thing, plantname) -- am I right-clicking on something that has a custom on_place set? -- thanks to Krock for helping with this issue :) local def = minetest.registered_nodes[under.name] - if placer and def and def.on_rightclick then + if placer and itemstack and def and def.on_rightclick then return def.on_rightclick(pt.under, under, placer, itemstack) end diff --git a/init.lua b/init.lua index 77e43ff..0769709 100644 --- a/init.lua +++ b/init.lua @@ -421,7 +421,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) -- am I right-clicking on something that has a custom on_place set? -- thanks to Krock for helping with this issue :) local def = minetest.registered_nodes[under.name] - if placer and def and def.on_rightclick then + if placer and itemstack and def and def.on_rightclick then return def.on_rightclick(pt.under, under, placer, itemstack) end From df1cee3b6e71804f727a26ac080b923935319b73 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Mon, 21 Oct 2019 11:24:20 +0100 Subject: [PATCH 11/13] code tidy --- hoes.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/hoes.lua b/hoes.lua index 1b33774..27928cf 100644 --- a/hoes.lua +++ b/hoes.lua @@ -308,7 +308,6 @@ local function throw_potion(itemstack, player) z = dir.z * -3 }) - obj:setyaw(player:get_look_yaw() + math.pi) obj:get_luaentity().player = player end From cc0fc2c763bdf4773837cf8ed4f799647b3653e3 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Wed, 20 Nov 2019 20:51:34 +0000 Subject: [PATCH 12/13] scythe works on use instead of right click (thanks OgelGames) --- README.md | 2 +- hoes.lua | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0dfebbb..f19550a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t ### Changelog: -- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection, add chocolate block +- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection, add chocolate block, scythe works on use instead of right-click - 1.41 - Each crop has it's own spawn rate (can be changed in farming.conf) - 1.40 - Added Mithril Scythe to quick harvest and replant crops on right-click. Added Hoe's for MoreOres with Toolrank support. - 1.39 - Added Rice, Rye and Oats thanks to Ademants Grains mod. Added Jaffa Cake and multigrain bread. diff --git a/hoes.lua b/hoes.lua index 27928cf..5716128 100644 --- a/hoes.lua +++ b/hoes.lua @@ -343,20 +343,11 @@ farming.add_to_scythe_not_drops = function(item) end minetest.register_tool("farming:scythe_mithril", { - description = S("Mithril Scythe (Right-click crop to harvest and replant)"), + description = S("Mithril Scythe (Use to harvest and replant crops)"), inventory_image = "farming_scythe_mithril.png", - tool_capabilities = { - full_punch_interval = 0.8, - max_drop_level = 2, - groupcaps = { - fleshy = {times = {[2] = 0.65, [3] = 0.25}, uses = 150, maxlevel = 2}, - snappy = {times = {[2] = 0.70, [3] = 0.25}, uses = 150, maxlevel = 2}, - }, - damage_groups = {fleshy = 8}, - }, sound = {breaks = "default_tool_breaks"}, - on_place = function(itemstack, placer, pointed_thing) + on_use = function(itemstack, placer, pointed_thing) if pointed_thing.type ~= "node" then return From 02d10c376e593053a6f7dd837b4b48b04e6a3231 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Mon, 2 Dec 2019 10:23:20 +0000 Subject: [PATCH 13/13] added seed=2 group to plantable food items --- README.md | 3 ++- crops/beans.lua | 2 +- crops/beetroot.lua | 2 +- crops/blueberry.lua | 3 ++- crops/carrot.lua | 2 +- crops/chili.lua | 2 +- crops/cocoa.lua | 2 +- crops/coffee.lua | 2 +- crops/corn.lua | 2 +- crops/cucumber.lua | 2 +- crops/garlic.lua | 2 +- crops/grapes.lua | 2 +- crops/melon.lua | 2 +- crops/onion.lua | 2 +- crops/peas.lua | 2 +- crops/pepper.lua | 2 +- crops/pineapple.lua | 1 + crops/potato.lua | 2 +- crops/pumpkin.lua | 2 +- crops/raspberry.lua | 3 ++- crops/rhubarb.lua | 2 +- crops/tomato.lua | 2 +- init.lua | 4 ++-- 23 files changed, 27 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index f19550a..128bf76 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ This mod works by adding your new plant to the {growing=1} group and numbering t ### Changelog: -- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection, add chocolate block, scythe works on use instead of right-click +- 1.43 - Scythe works on use instead of right-click, added seed=1 groups to actual seeds and seed=2 group for plantable food items. +- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection, add chocolate block. - 1.41 - Each crop has it's own spawn rate (can be changed in farming.conf) - 1.40 - Added Mithril Scythe to quick harvest and replant crops on right-click. Added Hoe's for MoreOres with Toolrank support. - 1.39 - Added Rice, Rye and Oats thanks to Ademants Grains mod. Added Jaffa Cake and multigrain bread. diff --git a/crops/beans.lua b/crops/beans.lua index 5017248..c35b2cf 100644 --- a/crops/beans.lua +++ b/crops/beans.lua @@ -72,7 +72,7 @@ end minetest.register_craftitem("farming:beans", { description = S("Green Beans"), inventory_image = "farming_beans.png", - groups = {food_beans = 1, flammable = 2}, + groups = {seed = 2, food_beans = 1, flammable = 2}, on_use = minetest.item_eat(1), on_place = function(itemstack, placer, pointed_thing) diff --git a/crops/beetroot.lua b/crops/beetroot.lua index e1aa58e..0a20d88 100644 --- a/crops/beetroot.lua +++ b/crops/beetroot.lua @@ -5,7 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:beetroot", { description = S("Beetroot"), inventory_image = "farming_beetroot.png", - groups = {food_beetroot = 1, flammable = 2}, + groups = {seed = 2, food_beetroot = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:beetroot_1") end, diff --git a/crops/blueberry.lua b/crops/blueberry.lua index 0b35343..fec0c12 100644 --- a/crops/blueberry.lua +++ b/crops/blueberry.lua @@ -5,7 +5,8 @@ local S = farming.intllib minetest.register_craftitem("farming:blueberries", { description = S("Blueberries"), inventory_image = "farming_blueberries.png", - groups = {food_blueberries = 1, food_blueberry = 1, food_berry = 1, flammable = 2}, + groups = {seed = 2, food_blueberries = 1, food_blueberry = 1, + food_berry = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1") end, diff --git a/crops/carrot.lua b/crops/carrot.lua index ec3ff8b..7df88ac 100644 --- a/crops/carrot.lua +++ b/crops/carrot.lua @@ -10,7 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:carrot", { description = S("Carrot"), inventory_image = "farming_carrot.png", - groups = {food_carrot = 1, flammable = 2}, + groups = {seed = 2, food_carrot = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1") end, diff --git a/crops/chili.lua b/crops/chili.lua index cade3b2..cdcfa7e 100644 --- a/crops/chili.lua +++ b/crops/chili.lua @@ -5,7 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:chili_pepper", { description = S("Chili Pepper"), inventory_image = "farming_chili_pepper.png", - groups = {food_chili_pepper = 1, flammable = 4}, + groups = {seed = 2, food_chili_pepper = 1, flammable = 4}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1") end, diff --git a/crops/cocoa.lua b/crops/cocoa.lua index 3f54a89..243814b 100644 --- a/crops/cocoa.lua +++ b/crops/cocoa.lua @@ -67,7 +67,7 @@ end minetest.register_craftitem("farming:cocoa_beans", { description = S("Cocoa Beans"), inventory_image = "farming_cocoa_beans.png", - groups = {food_cocoa = 1, flammable = 2}, + groups = {seed = 2, food_cocoa = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1") end, diff --git a/crops/coffee.lua b/crops/coffee.lua index 6d2fad8..2e2ed73 100644 --- a/crops/coffee.lua +++ b/crops/coffee.lua @@ -5,7 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:coffee_beans", { description = S("Coffee Beans"), inventory_image = "farming_coffee_beans.png", - groups = {food_coffee = 1, flammable = 2}, + groups = {seed = 2, food_coffee = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1") end, diff --git a/crops/corn.lua b/crops/corn.lua index 1d3e21a..eef547a 100644 --- a/crops/corn.lua +++ b/crops/corn.lua @@ -10,7 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:corn", { description = S("Corn"), inventory_image = "farming_corn.png", - groups = {food_corn = 1, flammable = 2}, + groups = {seed = 2, food_corn = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1") end, diff --git a/crops/cucumber.lua b/crops/cucumber.lua index b3761bd..8bd679a 100644 --- a/crops/cucumber.lua +++ b/crops/cucumber.lua @@ -10,7 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:cucumber", { description = S("Cucumber"), inventory_image = "farming_cucumber.png", - groups = {food_cucumber = 1, flammable = 2}, + groups = {seed = 2, food_cucumber = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1") end, diff --git a/crops/garlic.lua b/crops/garlic.lua index 83884d0..ee841e5 100644 --- a/crops/garlic.lua +++ b/crops/garlic.lua @@ -11,7 +11,7 @@ local S = farming.intllib minetest.register_craftitem("farming:garlic_clove", { description = S("Garlic clove"), inventory_image = "crops_garlic_clove.png", - groups = {food_garlic_clove = 1, flammable = 3}, + groups = {seed = 2, food_garlic_clove = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:garlic_1") end, diff --git a/crops/grapes.lua b/crops/grapes.lua index a41bb88..cc9d8aa 100644 --- a/crops/grapes.lua +++ b/crops/grapes.lua @@ -68,7 +68,7 @@ minetest.register_craftitem("farming:grapes", { description = S("Grapes"), inventory_image = "farming_grapes.png", on_use = minetest.item_eat(2), - groups = {food_grapes = 1, flammable = 3}, + groups = {seed = 2, food_grapes = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return place_grapes(itemstack, placer, pointed_thing, "farming:grapes_1") diff --git a/crops/melon.lua b/crops/melon.lua index 06056a0..3fda9f6 100644 --- a/crops/melon.lua +++ b/crops/melon.lua @@ -5,7 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:melon_slice", { description = S("Melon Slice"), inventory_image = "farming_melon_slice.png", - groups = {food_melon_slice = 1, flammable = 3}, + groups = {seed = 2, food_melon_slice = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1") end, diff --git a/crops/onion.lua b/crops/onion.lua index ae36d0d..72a425e 100644 --- a/crops/onion.lua +++ b/crops/onion.lua @@ -11,7 +11,7 @@ local S = farming.intllib minetest.register_craftitem("farming:onion", { description = S("Onion"), inventory_image = "crops_onion.png", - groups = {food_onion = 1, flammable = 3}, + groups = {seed = 2, food_onion = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1") end, diff --git a/crops/peas.lua b/crops/peas.lua index e12253b..ffe21b3 100644 --- a/crops/peas.lua +++ b/crops/peas.lua @@ -7,7 +7,7 @@ local S = farming.intllib minetest.register_craftitem("farming:pea_pod", { description = S("Pea Pod"), inventory_image = "farming_pea_pod.png", - groups = {food_pea_pod = 1, flammable = 2}, + groups = {seed = 2, food_pea_pod = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:pea_1") end diff --git a/crops/pepper.lua b/crops/pepper.lua index 19c7b05..6770888 100644 --- a/crops/pepper.lua +++ b/crops/pepper.lua @@ -11,7 +11,7 @@ local S = farming.intllib minetest.register_craftitem("farming:peppercorn", { description = S("Peppercorn"), inventory_image = "crops_peppercorn.png", - groups = {food_peppercorn = 1, flammable = 3}, + groups = {seed = 1, food_peppercorn = 1, flammable = 3}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1") end, diff --git a/crops/pineapple.lua b/crops/pineapple.lua index 62d8216..5f3e078 100644 --- a/crops/pineapple.lua +++ b/crops/pineapple.lua @@ -5,6 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:pineapple_top", { description = S("Pineapple Top"), inventory_image = "farming_pineapple_top.png", + groups = {seed = 2, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:pineapple_1") end, diff --git a/crops/potato.lua b/crops/potato.lua index e81cce6..d9f3e14 100644 --- a/crops/potato.lua +++ b/crops/potato.lua @@ -10,7 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:potato", { description = S("Potato"), inventory_image = "farming_potato.png", - groups = {food_potato = 1, flammable = 2}, + groups = {seed = 2, food_potato = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1") end, diff --git a/crops/pumpkin.lua b/crops/pumpkin.lua index 508c2b2..1e937db 100644 --- a/crops/pumpkin.lua +++ b/crops/pumpkin.lua @@ -9,7 +9,7 @@ local S = farming.intllib minetest.register_craftitem("farming:pumpkin_slice", { description = S("Pumpkin Slice"), inventory_image = "farming_pumpkin_slice.png", - groups = {food_pumpkin_slice = 1, flammable = 2}, + groups = {seed = 2, food_pumpkin_slice = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1") end, diff --git a/crops/raspberry.lua b/crops/raspberry.lua index a72137b..8c909e4 100644 --- a/crops/raspberry.lua +++ b/crops/raspberry.lua @@ -5,7 +5,8 @@ local S = farming.intllib minetest.register_craftitem("farming:raspberries", { description = S("Raspberries"), inventory_image = "farming_raspberries.png", - groups = {food_raspberries = 1, food_raspberry = 1, food_berry = 1, flammable = 2}, + groups = {seed = 2, food_raspberries = 1, food_raspberry = 1, + food_berry = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1") end, diff --git a/crops/rhubarb.lua b/crops/rhubarb.lua index fdcd11b..dafb7e7 100644 --- a/crops/rhubarb.lua +++ b/crops/rhubarb.lua @@ -5,7 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:rhubarb", { description = S("Rhubarb"), inventory_image = "farming_rhubarb.png", - groups = {food_rhubarb = 1, flammable = 2}, + groups = {seed = 2, food_rhubarb = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1") end, diff --git a/crops/tomato.lua b/crops/tomato.lua index 573661d..c082328 100644 --- a/crops/tomato.lua +++ b/crops/tomato.lua @@ -10,7 +10,7 @@ local S = farming.intllib minetest.register_craftitem("farming:tomato", { description = S("Tomato"), inventory_image = "farming_tomato.png", - groups = {food_tomato = 1, flammable = 2}, + groups = {seed = 2, food_tomato = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1") end, diff --git a/init.lua b/init.lua index 0769709..0625f0a 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ farming = { mod = "redo", - version = "20190728", + version = "20191202", path = minetest.get_modpath("farming"), select = { type = "fixed", @@ -278,7 +278,7 @@ end) -- Just in case a growing type or added node is missed (also catches existing -- nodes added to map before timers were incorporated). minetest.register_abm({ - nodenames = { "group:growing" }, + nodenames = {"group:growing"}, interval = 300, chance = 1, catch_up = false,