diff options
Diffstat (limited to 'farming')
72 files changed, 1345 insertions, 126 deletions
diff --git a/farming/README.txt b/farming/README.txt index 591fca0..211367c 100644 --- a/farming/README.txt +++ b/farming/README.txt @@ -13,7 +13,12 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: -1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water +1.36 - Added Beetroot, Beetroot Soup (6x beetroot, 1x bowl) +1.35 - Deprecated bronze/mese/diamond hoe's, added hoe bomb and deprecated hoe's as lucky block prizes +1.34 - Added scarecrow Base (5x sticks in a cross shape) +1.33 - Added cooking utensils (wooden bowl, saucepan, cooking pot, baking tray, skillet, cutting board, mortar & pestle, juicer, glass mixing bowl) for easier food crafts. +1.32 - Added Pea plant (textures by Andrey01) - also added Wooden Bowl and Pea Soup crafts +1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water, added food groups so it's more compatible with Ruben's food mods. 1.30 - Added Garlic, Pepper and Onions thanks to Grizzly Adam for sharing textures 1.29 - Updating functions so requires Minetest 0.4.16 and above to run 1.28 - Added chili peppers and bowl of chili, optimized code and fixed a few bugs, added porridge @@ -53,7 +58,7 @@ Changelog: 0.1 - Fixed growing bug 0.0 - Initial release -Lucky Blocks: 16 +Lucky Blocks: 28 License of media (textures): diff --git a/farming/barley.lua b/farming/barley.lua index 8611ee5..4005d2c 100644 --- a/farming/barley.lua +++ b/farming/barley.lua @@ -23,13 +23,18 @@ minetest.register_node("farming:seed_barley", { minetest.register_craftitem("farming:barley", { description = S("Barley"), inventory_image = "farming_barley.png", + groups = {food_barley = 1, flammable = 2}, }) -- flour minetest.register_craft({ type = "shapeless", output = "farming:flour", - recipe = {"farming:barley", "farming:barley", "farming:barley", "farming:barley"} + recipe = { + "farming:barley", "farming:barley", "farming:barley", + "farming:barley", "farming:mortar_pestle" + }, + replacements = {{"farming:mortar_pestle", "farming:mortar_pestle"}}, }) -- barley definition diff --git a/farming/beanpole.lua b/farming/beanpole.lua index 5bd0448..1e81dac 100644 --- a/farming/beanpole.lua +++ b/farming/beanpole.lua @@ -64,6 +64,7 @@ end minetest.register_craftitem("farming:beans", { description = S("Green Beans"), inventory_image = "farming_beans.png", + groups = {food_beans = 1, flammable = 2}, on_use = minetest.item_eat(1), on_place = function(itemstack, placer, pointed_thing) @@ -97,11 +98,32 @@ minetest.register_node("farming:beanpole", { on_place = function(itemstack, placer, pointed_thing) - if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then + local pt = pointed_thing + + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end + + -- 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 def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack) + end + + if minetest.is_protected(pt.under, placer:get_player_name()) then return end - local nodename = minetest.get_node(pointed_thing.under).name + local nodename = under.name if minetest.get_item_group(nodename, "soil") < 2 then return diff --git a/farming/beetroot.lua b/farming/beetroot.lua new file mode 100644 index 0000000..1510a76 --- /dev/null +++ b/farming/beetroot.lua @@ -0,0 +1,85 @@ + +local S = farming.intllib + +-- beetroot +minetest.register_craftitem("farming:beetroot", { + description = S("Beetroot"), + inventory_image = "farming_beetroot.png", + groups = {food_beetroot = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:beetroot_1") + end, + on_use = minetest.item_eat(1), +}) + +-- beetroot soup +minetest.register_craftitem("farming:beetroot_soup", { + description = S("Beetroot Soup"), + inventory_image = "farming_beetroot_soup.png", + groups = {flammable = 2}, + on_use = minetest.item_eat(6, "farming:bowl"), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:beetroot_soup", + recipe = { + "group:food_beetroot", "group:food_beetroot", + "group:food_beetroot", "group:food_beetroot", + "group:food_beetroot", "group:food_beetroot","group:food_bowl" + } +}) + +-- red dye +minetest.register_craft({ + type = "shapeless", + output = "dye:red", + recipe = {"group:food_beetroot"}, +}) + +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_beetroot_1.png"}, + paramtype = "light", +-- paramtype2 = "meshoptions", +-- place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, flora = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:beetroot_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_beetroot_2.png"} +minetest.register_node("farming:beetroot_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_beetroot_3.png"} +minetest.register_node("farming:beetroot_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_beetroot_4.png"} +minetest.register_node("farming:beetroot_4", table.copy(crop_def)) + +-- stage 5 +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}, + } +} +minetest.register_node("farming:beetroot_5", table.copy(crop_def)) diff --git a/farming/blueberry.lua b/farming/blueberry.lua index 82ce7ff..f2f0147 100644 --- a/farming/blueberry.lua +++ b/farming/blueberry.lua @@ -5,6 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:blueberries", { description = S("Blueberries"), inventory_image = "farming_blueberries.png", + groups = {food_blueberries = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1") end, @@ -22,7 +23,7 @@ minetest.register_craftitem("farming:muffin_blueberry", { minetest.register_craft({ output = "farming:muffin_blueberry 2", recipe = { - {"farming:blueberries", "farming:bread", "farming:blueberries"}, + {"group:food_blueberries", "group:food_bread", "group:food_blueberries"}, } }) diff --git a/farming/carrot.lua b/farming/carrot.lua index 9cfcee0..0aefcfd 100644 --- a/farming/carrot.lua +++ b/farming/carrot.lua @@ -10,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1") end, @@ -27,7 +28,7 @@ minetest.register_craft({ output = "farming:carrot_gold", recipe = { {"", "default:gold_lump", ""}, - {"default:gold_lump", "farming:carrot", "default:gold_lump"}, + {"default:gold_lump", "group:food_carrot", "default:gold_lump"}, {"", "default:gold_lump", ""}, } }) diff --git a/farming/chili.lua b/farming/chili.lua index ec2a1a9..9889162 100644 --- a/farming/chili.lua +++ b/farming/chili.lua @@ -5,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1") end, @@ -15,13 +16,16 @@ minetest.register_craftitem("farming:chili_pepper", { minetest.register_craftitem("farming:chili_bowl", { description = S("Bowl of Chili"), inventory_image = "farming_chili_bowl.png", - on_use = minetest.item_eat(8), + on_use = minetest.item_eat(8, "farming:bowl"), }) minetest.register_craft({ type = "shapeless", output = "farming:chili_bowl", - recipe = {"farming:chili_pepper", "farming:barley", "farming:tomato", "farming:beans"} + recipe = { + "group:food_chili_pepper", "group:food_barley", + "group:food_tomato", "group:food_beans", "group:food_bowl" + }, }) -- chili can be used for red dye diff --git a/farming/cocoa.lua b/farming/cocoa.lua index b394ab2..a8491ac 100644 --- a/farming/cocoa.lua +++ b/farming/cocoa.lua @@ -59,6 +59,7 @@ end minetest.register_craftitem("farming:cocoa_beans", { description = S("Cocoa Beans"), inventory_image = "farming_cocoa_beans.png", + groups = {food_cocoa = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1") end, @@ -81,7 +82,7 @@ minetest.register_craftitem("farming:cookie", { minetest.register_craft( { output = "farming:cookie 8", recipe = { - { "farming:wheat", "farming:cocoa_beans", "farming:wheat" }, + {"group:food_wheat", "group:food_cocoa", "group:food_wheat" }, } }) @@ -95,7 +96,7 @@ minetest.register_craftitem("farming:chocolate_dark", { minetest.register_craft( { output = "farming:chocolate_dark", recipe = { - { "farming:cocoa_beans", "farming:cocoa_beans", "farming:cocoa_beans" }, + {"group:food_cocoa", "group:food_cocoa", "group:food_cocoa"}, } }) @@ -124,25 +125,30 @@ local crop_def = { -- stage 1 minetest.register_node("farming:cocoa_1", table.copy(crop_def)) --- stage2 +-- stage 2 crop_def.tiles = {"farming_cocoa_2.png"} +minetest.register_node("farming:cocoa_2", table.copy(crop_def)) + +-- stage3 +crop_def.tiles = {"farming_cocoa_3.png"} crop_def.drop = { items = { {items = {'farming:cocoa_beans 1'}, rarity = 1}, } } -minetest.register_node("farming:cocoa_2", table.copy(crop_def)) +minetest.register_node("farming:cocoa_3", table.copy(crop_def)) --- stage 3 (final) -crop_def.tiles = {"farming_cocoa_3.png"} +-- stage 4 (final) +crop_def.tiles = {"farming_cocoa_4.png"} crop_def.groups.growing = 0 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}, } } -minetest.register_node("farming:cocoa_3", table.copy(crop_def)) +minetest.register_node("farming:cocoa_4", table.copy(crop_def)) -- add random cocoa pods to jungle tree's minetest.register_on_generated(function(minp, maxp) @@ -180,7 +186,7 @@ minetest.register_on_generated(function(minp, maxp) --print ("Cocoa Pod added at " .. minetest.pos_to_string(pos)) minetest.swap_node(pos, { - name = "farming:cocoa_" .. tostring(math.random(1, 3)) + name = "farming:cocoa_" .. tostring(math.random(1, 4)) }) end diff --git a/farming/coffee.lua b/farming/coffee.lua index f9632d2..ab93d06 100644 --- a/farming/coffee.lua +++ b/farming/coffee.lua @@ -5,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1") end, @@ -57,7 +58,7 @@ minetest.register_node("farming:coffee_cup", { minetest.register_craft( { output = "farming:coffee_cup", recipe = { - {"farming:drinking_cup", "farming:coffee_beans","bucket:bucket_water"}, + {"farming:drinking_cup", "group:food_coffee","bucket:bucket_water"}, }, replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} }) diff --git a/farming/compatibility.lua b/farming/compatibility.lua index b7c906c..ccc46a5 100644 --- a/farming/compatibility.lua +++ b/farming/compatibility.lua @@ -1,3 +1,16 @@ +-- add food group to default apple and brown mushroom +minetest.override_item("default:apple", { + groups = {food_apple = 1, fleshy = 3, dig_immediate = 3, flammable = 2, + leafdecay = 3, leafdecay_drop = 1}, +}) + +if minetest.registered_nodes["flowers:mushroom_brown"] then +minetest.override_item("flowers:mushroom_brown", { + light_source = 1, + groups = {food_mushroom = 1, snappy = 3, attached_node = 1, flammable = 2}, +}) +end + -- is Ethereal mod installed? local eth = minetest.get_modpath("ethereal") or nil @@ -20,7 +33,7 @@ else type = "fixed", fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2} }, - groups = {fleshy = 3, dig_immediate = 3, flammable = 2}, + groups = {food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2}, on_use = minetest.item_eat(2), sounds = default.node_sound_leaves_defaults(), }) @@ -68,7 +81,7 @@ else type = "fixed", fixed = {-0.2, -0.3, -0.2, 0.2, 0.2, 0.2} }, - groups = {fleshy = 3, dig_immediate = 3, flammable = 2}, + groups = {food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2}, on_use = minetest.item_eat(4), sounds = default.node_sound_leaves_defaults(), }) @@ -94,7 +107,6 @@ minetest.register_alias("farming:big_pumpkin_side", "air") minetest.register_alias("farming:big_pumpkin_corner", "air") minetest.register_alias("farming:big_pumpkin_top", "air") minetest.register_alias("farming:scarecrow", "farming:jackolantern") -minetest.register_alias("farming:scarecrow_bottom", "default:fence_wood") minetest.register_alias("farming:scarecrow_light", "farming:jackolantern_on") minetest.register_alias("farming:pumpkin_flour", "farming:pumpkin_dough") @@ -118,6 +130,7 @@ else description = "Strawberry", inventory_image = "strawberry.png", wield_image = "strawberry.png", + groups = {food_strawberry = 1, flammable = 2}, on_use = minetest.item_eat(1), }) diff --git a/farming/corn.lua b/farming/corn.lua index 1149a00..8afa16a 100644 --- a/farming/corn.lua +++ b/farming/corn.lua @@ -10,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1") end, @@ -27,7 +28,7 @@ minetest.register_craft({ type = "cooking", cooktime = 10, output = "farming:corn_cob", - recipe = "farming:corn" + recipe = "group:food_corn" }) -- ethanol (thanks to JKMurray for this idea) @@ -51,8 +52,8 @@ minetest.register_node("farming:bottle_ethanol", { minetest.register_craft( { output = "farming:bottle_ethanol", recipe = { - { "vessels:glass_bottle", "farming:corn", "farming:corn"}, - { "farming:corn", "farming:corn", "farming:corn"}, + { "vessels:glass_bottle", "group:food_corn", "group:food_corn"}, + { "group:food_corn", "group:food_corn", "group:food_corn"}, } }) diff --git a/farming/cotton.lua b/farming/cotton.lua index bf0412e..7f893ec 100644 --- a/farming/cotton.lua +++ b/farming/cotton.lua @@ -146,5 +146,6 @@ minetest.register_node("farming:cotton_8", table.copy(crop_def)) farming.register_plant("farming:cotton", { description = "Cotton seed", inventory_image = "farming_cotton_seed.png", + groups = {flammable = 2}, steps = 8, })]] diff --git a/farming/cucumber.lua b/farming/cucumber.lua index eb29347..4e6981c 100644 --- a/farming/cucumber.lua +++ b/farming/cucumber.lua @@ -10,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1") end, diff --git a/farming/donut.lua b/farming/donut.lua index be2e9b8..9b29d27 100644 --- a/farming/donut.lua +++ b/farming/donut.lua @@ -11,9 +11,9 @@ minetest.register_craftitem("farming:donut", { minetest.register_craft({ output = "farming:donut 3", recipe = { - {'', 'farming:wheat', ''}, - {'farming:wheat', 'farming:sugar', 'farming:wheat'}, - {'', 'farming:wheat', ''}, + {"", "group:food_wheat", ""}, + {"group:food_wheat", "group:food_sugar", "group:food_wheat"}, + {"", "group:food_wheat", ""}, } }) @@ -27,7 +27,7 @@ minetest.register_craftitem("farming:donut_chocolate", { minetest.register_craft({ output = "farming:donut_chocolate", recipe = { - {'farming:cocoa_beans'}, + {'group:food_cocoa'}, {'farming:donut'}, } }) @@ -51,31 +51,26 @@ minetest.register_craft({ minetest.register_craftitem("farming:porridge", { description = S("Porridge"), inventory_image = "farming_porridge.png", - on_use = minetest.item_eat(6), + on_use = minetest.item_eat(6, "farming:bowl"), }) minetest.after(0, function() + local fluid = "bucket:bucket_water" + local fluid_return = "bucket:bucket_water" + if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then + fluid = "group:food_milk" + fluid_return = "mobs:bucket_milk" + end minetest.register_craft({ - output = "farming:porridge", type = "shapeless", - recipe = { - "farming:barley", "farming:barley", "farming:wheat", - "farming:wheat", "mobs:bucket_milk" - }, - replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"}} - }) -else - minetest.register_craft({ output = "farming:porridge", - type = "shapeless", recipe = { - "farming:barley", "farming:barley", "farming:wheat", - "farming:wheat", "bucket:bucket_water" + "group:food_barley", "group:food_barley", "group:food_wheat", + "group:food_wheat", "group:food_bowl", fluid }, - replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} + replacements = {{fluid_return, "bucket:bucket_empty"}} }) - end end) diff --git a/farming/farming.conf_example b/farming/farming.conf_example index 7a08b24..2505054 100644 --- a/farming/farming.conf_example +++ b/farming/farming.conf_example @@ -12,7 +12,6 @@ farming.tomato = true farming.cucumber = true farming.corn = true farming.coffee = true -farming.coffee = true farming.melon = true farming.sugar = true farming.pumpkin = true @@ -29,7 +28,9 @@ farming.onion = true farming.garlic = true farming.pepper = true farming.pineapple = true +farming.peas = true +farming.beetroot = true farming.donuts = true --- rarety of crops on map, default is 0.006 (higher number = more crops) -farming.rarety = 0.006 +-- rarety of crops on map, default is 0.001 (higher number = more crops) +farming.rarety = 0.002 diff --git a/farming/garlic.lua b/farming/garlic.lua index ffbf3ec..52ae25f 100644 --- a/farming/garlic.lua +++ b/farming/garlic.lua @@ -11,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:garlic_1") end, @@ -21,7 +22,7 @@ minetest.register_craftitem("farming:garlic", { description = S("Garlic"), inventory_image = "crops_garlic.png", on_use = minetest.item_eat(1), - groups = {garlic = 1}, + groups = {food_garlic = 1, flammable = 3}, }) minetest.register_craft({ @@ -52,7 +53,7 @@ minetest.register_node("farming:garlic_braid", { "crops_garlic_braid_side.png^[transformFx","crops_garlic_braid_side.png", "crops_garlic_braid.png","crops_garlic_braid.png" }, - groups = {vessel = 1, dig_immediate = 3}, + groups = {vessel = 1, dig_immediate = 3, flammable = 3}, sounds = default.node_sound_leaves_defaults(), node_box = { type = "fixed", diff --git a/farming/grapes.lua b/farming/grapes.lua index baedb4e..9a6ab9e 100644 --- a/farming/grapes.lua +++ b/farming/grapes.lua @@ -60,6 +60,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}, on_place = function(itemstack, placer, pointed_thing) return place_grapes(itemstack, placer, pointed_thing, "farming:grapes_1") @@ -92,11 +93,32 @@ minetest.register_node("farming:trellis", { on_place = function(itemstack, placer, pointed_thing) - if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then + local pt = pointed_thing + + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end + + -- 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 def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack) + end + + if minetest.is_protected(pt.under, placer:get_player_name()) then return end - local nodename = minetest.get_node(pointed_thing.under).name + local nodename = under.name if minetest.get_item_group(nodename, "soil") < 2 then return diff --git a/farming/grass.lua b/farming/grass.lua index f6f777b..9644254 100644 --- a/farming/grass.lua +++ b/farming/grass.lua @@ -1,5 +1,5 @@ -for i = 3, 5 do +for i = 4, 5 do -- Override default grass and have it drop Wheat Seeds diff --git a/farming/hemp.lua b/farming/hemp.lua index 29b6a42..34dd56d 100644 --- a/farming/hemp.lua +++ b/farming/hemp.lua @@ -39,7 +39,7 @@ minetest.register_node("farming:hemp_oil", { type = "fixed", fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} }, - groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, + groups = {food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1}, sounds = default.node_sound_glass_defaults(), }) @@ -94,6 +94,23 @@ minetest.register_craft( { replacements = {{ "bucket:bucket_river_water", "bucket:bucket_empty"}} }) +-- hemp block +minetest.register_node("farming:hemp_block", { + description = S("Hemp Block"), + tiles = {"farming_hemp_block.png"}, + paramtype = "light", + groups = {snappy = 1, oddly_breakable_by_hand = 1, flammable = 2} +}) + +minetest.register_craft( { + output = "farming:hemp_block", + recipe = { + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"} + }, +}) + -- paper minetest.register_craft( { output = "default:paper", diff --git a/farming/hoebomb.lua b/farming/hoebomb.lua new file mode 100644 index 0000000..05e939b --- /dev/null +++ b/farming/hoebomb.lua @@ -0,0 +1,149 @@ + +-- load support for intllib. +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + + +-- creative check +local creative_mode_cache = minetest.settings:get_bool("creative_mode") +function is_creative(name) + return creative_mode_cache or minetest.check_player_privs(name, {creative = true}) +end + + +-- hoe bomb function +local function hoe_area(pos, player) + + -- check for protection + if minetest.is_protected(pos, player:get_player_name()) then + minetest.record_protection_violation(pos, player:get_player_name()) + return + end + + local r = 5 -- radius + + -- remove flora (grass, flowers etc.) + local res = minetest.find_nodes_in_area( + {x = pos.x - r, y = pos.y - 1, z = pos.z - r}, + {x = pos.x + r, y = pos.y + 2, z = pos.z + r}, + {"group:flora"}) + + for n = 1, #res do + minetest.swap_node(res[n], {name = "air"}) + end + + -- replace dirt with tilled soil + res = nil + res = minetest.find_nodes_in_area_under_air( + {x = pos.x - r, y = pos.y - 1, z = pos.z - r}, + {x = pos.x + r, y = pos.y + 2, z = pos.z + r}, + {"group:soil"}) + + for n = 1, #res do + minetest.swap_node(res[n], {name = "farming:soil"}) + end +end + + +-- throwable hoe bomb +minetest.register_entity("farming:hoebomb_entity", { + physical = true, + visual = "sprite", + visual_size = {x = 1.0, y = 1.0}, + textures = {"farming_hoe_bomb.png"}, + collisionbox = {0,0,0,0,0,0}, + lastpos = {}, + player = "", + + on_step = function(self, dtime) + + if not self.player then + + self.object:remove() + + return + end + + local pos = self.object:get_pos() + + if self.lastpos.x ~= nil then + + local vel = self.object:getvelocity() + + -- only when potion hits something physical + if vel.x == 0 + or vel.y == 0 + or vel.z == 0 then + + if self.player ~= "" then + + -- round up coords to fix glitching through doors + self.lastpos = vector.round(self.lastpos) + + hoe_area(self.lastpos, self.player) + end + + self.object:remove() + + return + + end + end + + self.lastpos = pos + end +}) + + +-- actual throwing function +local function throw_potion(itemstack, player) + + local playerpos = player:get_pos() + + local obj = minetest.add_entity({ + x = playerpos.x, + y = playerpos.y + 1.5, + z = playerpos.z + }, "farming:hoebomb_entity") + + local dir = player:get_look_dir() + local velocity = 20 + + obj:setvelocity({ + x = dir.x * velocity, + y = dir.y * velocity, + z = dir.z * velocity + }) + + obj:setacceleration({ + x = dir.x * -3, + y = -9.5, + z = dir.z * -3 + }) + + obj:setyaw(player:get_look_yaw() + math.pi) + obj:get_luaentity().player = player +end + + +-- hoe bomb item +minetest.register_craftitem("farming:hoe_bomb", { + description = S("Hoe Bomb (use or throw on grassy areas to hoe land"), + inventory_image = "farming_hoe_bomb.png", + groups = {flammable = 2, not_in_creative_inventory = 1}, + on_use = function(itemstack, user, pointed_thing) + + if pointed_thing.type == "node" then + hoe_area(pointed_thing.above, user) + else + throw_potion(itemstack, user) + + if not is_creative(user:get_player_name()) then + + itemstack:take_item() + + return itemstack + end + end + end, +}) diff --git a/farming/hoes.lua b/farming/hoes.lua index 3dd14f1..eaacb29 100644 --- a/farming/hoes.lua +++ b/farming/hoes.lua @@ -20,14 +20,6 @@ farming.register_hoe = function(name, def) def.inventory_image = "unknown_item.png" end - if def.recipe == nil then - def.recipe = { - {"air","air",""}, - {"","group:stick",""}, - {"","group:stick",""} - } - end - if def.max_uses == nil then def.max_uses = 30 end @@ -38,16 +30,18 @@ farming.register_hoe = function(name, def) inventory_image = def.inventory_image, on_use = function(itemstack, user, pointed_thing) return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses) - end + end, + groups = def.groups, + sound = {breaks = "default_tool_breaks"}, }) -- Register its recipe - if def.material == nil then + if def.recipe then minetest.register_craft({ output = name:sub(2), recipe = def.recipe }) - else + elseif def.material then minetest.register_craft({ output = name:sub(2), recipe = { @@ -153,22 +147,22 @@ farming.register_hoe(":farming:hoe_steel", { farming.register_hoe(":farming:hoe_bronze", { description = S("Bronze Hoe"), inventory_image = "farming_tool_bronzehoe.png", - max_uses = 220, - material = "default:bronze_ingot" + max_uses = 500, + groups = {not_in_creative_inventory = 1}, }) farming.register_hoe(":farming:hoe_mese", { description = S("Mese Hoe"), inventory_image = "farming_tool_mesehoe.png", max_uses = 350, - material = "default:mese_crystal" + groups = {not_in_creative_inventory = 1}, }) farming.register_hoe(":farming:hoe_diamond", { description = S("Diamond Hoe"), inventory_image = "farming_tool_diamondhoe.png", max_uses = 500, - material = "default:diamond" + groups = {not_in_creative_inventory = 1}, }) -- Toolranks support diff --git a/farming/init.lua b/farming/init.lua index 407537d..33a9ca7 100644 --- a/farming/init.lua +++ b/farming/init.lua @@ -7,7 +7,7 @@ farming = {} farming.mod = "redo" -farming.version = "1.31" +farming.version = "1.33" farming.path = minetest.get_modpath("farming") farming.select = { type = "fixed", @@ -211,7 +211,7 @@ local function reg_plant_stages(plant_name, stage, force_last) end -register_plant_node = function(node) +local register_plant_node = function(node) local plant_name, stage = plant_name_stage(node) @@ -513,6 +513,7 @@ farming.register_plant = function(name, def) minetest.register_craftitem(":" .. mname .. ":" .. pname, { description = pname:gsub("^%l", string.upper), inventory_image = mname .. "_" .. pname .. ".png", + groups = def.groups or {flammable = 2}, }) -- Register growing steps @@ -554,8 +555,8 @@ farming.register_plant = function(name, def) waving = 1, tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"}, paramtype = "light", - paramtype2 = def.paramtype2 or nil, - place_param2 = def.place_param2 or nil, + paramtype2 = def.paramtype2, + place_param2 = def.place_param2, walkable = false, buildable_to = true, drop = drop, @@ -582,7 +583,6 @@ farming.tomato = true farming.cucumber = true farming.corn = true farming.coffee = true -farming.coffee = true farming.melon = true farming.sugar = true farming.pumpkin = true @@ -599,8 +599,10 @@ farming.garlic = true farming.onion = true farming.pepper = true farming.pineapple = true +farming.peas = true +farming.beetroot = true farming.donuts = true -farming.rarety = 0.006 +farming.rarety = 0.002 -- 0.006 -- Load new global settings if found inside mod folder @@ -625,6 +627,7 @@ end dofile(farming.path.."/soil.lua") dofile(farming.path.."/hoes.lua") dofile(farming.path.."/grass.lua") +dofile(farming.path.."/utensils.lua") -- default crops dofile(farming.path.."/wheat.lua") @@ -647,14 +650,17 @@ if farming.rhubarb then dofile(farming.path.."/rhubarb.lua") end if farming.beans then dofile(farming.path.."/beanpole.lua") end if farming.grapes then dofile(farming.path.."/grapes.lua") end if farming.barley then dofile(farming.path.."/barley.lua") end -if farming.chili then dofile(farming.path.."/chili.lua") end if farming.hemp then dofile(farming.path.."/hemp.lua") end -if farming.donuts then dofile(farming.path.."/donut.lua") end if farming.garlic then dofile(farming.path.."/garlic.lua") end if farming.onion then dofile(farming.path.."/onion.lua") end if farming.pepper then dofile(farming.path.."/pepper.lua") end if farming.pineapple then dofile(farming.path.."/pineapple.lua") end +if farming.peas then dofile(farming.path.."/pea.lua") end +if farming.beetroot then dofile(farming.path.."/beetroot.lua") end +if farming.chili then dofile(farming.path.."/chili.lua") end +if farming.donuts then dofile(farming.path.."/donut.lua") end dofile(farming.path.."/mapgen.lua") dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility +dofile(farming.path.."/hoebomb.lua") dofile(farming.path.."/lucky_block.lua") diff --git a/farming/locale/fr.po b/farming/locale/fr.po new file mode 100644 index 0000000..7b50640 --- /dev/null +++ b/farming/locale/fr.po @@ -0,0 +1,259 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-27 20:21+0200\n" +"PO-Revision-Date: 2018-03-27 22:16+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"Last-Translator: \n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"Language: fr\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "Graine d'orge" + +#: barley.lua +msgid "Barley" +msgstr "Orge" + +#: beanpole.lua +msgid "Green Beans" +msgstr "Haricots verts" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "Tuteur pour haricots (placer sur le sol avant de planter des haricots)" + +#: blueberry.lua +msgid "Blueberries" +msgstr "Myrtilles" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "GΓ’teau aux myrtilles" + +#: carrot.lua +msgid "Carrot" +msgstr "Carotte" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "Carotte dorΓ©e" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "FΓ¨ves de chocolat" + +#: cocoa.lua +msgid "Cookie" +msgstr "Biscuit" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "Barre de chocolat noir" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "Grains de cafΓ©" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "Tasse (vide)" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "Tasse de cafΓ© froid" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "Tasse de cafΓ© chaud" + +#: corn.lua +msgid "Corn" +msgstr "MaΓ―s" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Γpi de maΓ―s" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "Bouteille de'Γ©thanol" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "Graines de coton" + +#: cotton.lua +msgid "Cotton" +msgstr "Coton" + +#: cucumber.lua +msgid "Cucumber" +msgstr "Concombre" + +#: donut.lua +msgid "Donut" +msgstr "Beignet" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "Beignet au chocolat" + +#: donut.lua +msgid "Apple Donut" +msgstr "Beignet aux pommes" + +#: grapes.lua +msgid "Grapes" +msgstr "Raisins" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "Treillis (placer sur le sol avant de planter les raisins)" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "Graines de chanvre" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "Feuille de chanvre" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "Bouteille d'huile de chanvre" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "Fibre de chanvre" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "Corde de chanvre" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "Houe en bois" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "Houe en pierre" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "Houe en acier" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "Houe en bronze" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "Houe en mese" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "Houe en diamant" + +#: init.lua +msgid "Seed" +msgstr "Graine" + +#: melon.lua +msgid "Melon Slice" +msgstr "Tranche de melon" + +#: melon.lua +msgid "Melon" +msgstr "Melon" + +#: potato.lua +msgid "Potato" +msgstr "Pomme de terre" + +#: potato.lua +msgid "Baked Potato" +msgstr "Pomme de terre cuite" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Citrouille" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "Tranche de citrouille" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "Jack 'O Lantern (tapΓ© pour allumer et Γ©teindre)" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "Pain Γ la citrouille" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "PΓ’te Γ la citrouille" + +#: raspberry.lua +msgid "Raspberries" +msgstr "Framboises" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "Smoothie aux framboises" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "Rhubarbe" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "Tarte Γ la rhubarbe" + +#: soil.lua +msgid "Soil" +msgstr "Sol" + +#: soil.lua +msgid "Wet Soil" +msgstr "Sol humide" + +#: sugar.lua +msgid "Sugar" +msgstr "Sucre" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "Graine de blΓ©" + +#: wheat.lua +msgid "Wheat" +msgstr "BlΓ©" + +#: wheat.lua +msgid "Straw" +msgstr "Paille" + +#: wheat.lua +msgid "Flour" +msgstr "Farine" + +#: wheat.lua +msgid "Bread" +msgstr "Pain" diff --git a/farming/locale/ru.po b/farming/locale/ru.po new file mode 100644 index 0000000..607c96d --- /dev/null +++ b/farming/locale/ru.po @@ -0,0 +1,262 @@ +# Russian translation for farming mod. +# Copyright (C) 2018 +# This file is distributed under the same license as the farming package. +# codexp <codexp@gmx.net>, 2018. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.27\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-03-22 01:25+0100\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: Russian\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "ΡΠ΅ΠΌΠ΅Π½Π° ΡΡΠΌΠ΅Π½Ρ" + +#: barley.lua +msgid "Barley" +msgstr "ΡΡΠΌΠ΅Π½Ρ" + +#: beanpole.lua +msgid "Green Beans" +msgstr "Π·Π΅Π»Π΅Π½Π°Ρ ΡΠ°ΡΠΎΠ»Ρ" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "ΠΆΠ΅ΡΠ΄Ρ Π΄Π»Ρ Π±ΠΎΠ±ΠΎΠ²ΡΡ
(ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΠ΅ Π½Π° ΠΏΠΎΡΠ²Ρ ΠΏΠ΅ΡΠ΅Π΄ ΠΏΠΎΡΠ°Π΄ΠΊΠΎΠΉ Π±ΠΎΠ±ΠΎΠ²ΡΡ
)" + +#: blueberry.lua +msgid "Blueberries" +msgstr "Π³ΠΎΠ»ΡΠ±ΠΈΠΊΠ°" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "ΠΊΠ΅ΠΊΡ ΠΈΠ· Π³ΠΎΠ»ΡΠ±ΠΈΠΊΠΈ" + +#: carrot.lua +msgid "Carrot" +msgstr "ΠΌΠΎΡΠΊΠΎΠ²Ρ" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "Π·ΠΎΠ»ΠΎΡΠ°Ρ ΠΌΠΎΡΠΊΠΎΠ²Ρ" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "Π±ΠΎΠ±Ρ ΠΊΠ°ΠΊΠ°ΠΎ" + +#: cocoa.lua +msgid "Cookie" +msgstr "ΠΏΠ΅ΡΠ΅Π½ΡΠ΅" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "ΠΏΠ»ΠΈΡΠΊΠ° ΡΠ΅ΠΌΠ½ΠΎΠ³ΠΎ ΡΠΎΠΊΠΎΠ»Π°Π΄Π°" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "ΠΊΠΎΡΠ΅ Π² Π·Π΅ΡΠ½Π°Ρ
" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "ΡΠ°ΡΠΊΠ° (ΠΏΡΡΡΠ°Ρ)" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "Ρ
ΠΎΠ»ΠΎΠ΄Π½Π°Ρ ΡΠ°ΡΠΊΠ° ΠΊΠΎΡΠ΅" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "Π³ΠΎΡΡΡΠ°Ρ ΡΠ°ΡΠΊΠ° ΠΊΠΎΡΠ΅" + +#: corn.lua +msgid "Corn" +msgstr "ΠΊΡΠΊΡΡΡΠ·Π°" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "ΠΏΠΎΡΠ°ΡΠΎΠΊ ΠΊΡΠΊΡΡΡΠ·Ρ" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "Π±ΡΡΡΠ»ΠΊΠ° ΡΡΠΈΠ»ΠΎΠ²ΠΎΠ³ΠΎ ΡΠΏΠΈΡΡΠ°" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "ΡΠ΅ΠΌΠ΅Π½Π° Ρ
Π»ΠΎΠΏΠΊΠ°" + +#: cotton.lua +msgid "Cotton" +msgstr "Ρ
Π»ΠΎΠΏΠΎΠΊ" + +#: cucumber.lua +msgid "Cucumber" +msgstr "ΠΎΠ³ΡΡΠ΅Ρ" + +#: donut.lua +msgid "Donut" +msgstr "ΠΏΠΎΠ½ΡΠΈΠΊ" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "ΡΠΎΠΊΠΎΠ»Π°Π΄Π½ΡΠΉ ΠΏΠΎΠ½ΡΠΈΠΊ" + +#: donut.lua +msgid "Apple Donut" +msgstr "ΡΠ±Π»ΠΎΡΠ½ΡΠΉ ΠΏΠΎΠ½ΡΠΈΠΊ" + +#: grapes.lua +msgid "Grapes" +msgstr "Π²ΠΈΠ½ΠΎΠ³ΡΠ°Π΄" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "ΡΠ΅ΡΠ΅ΡΠΊΠ° (ΠΏΠΎΡΡΠ°Π²ΡΡΠ΅ Π½Π° ΠΏΠΎΡΠ²Ρ Π΄Π»Ρ ΠΏΠΎΡΠ°Π΄ΠΊΠΈ Π²ΠΈΠ½ΠΎΠ³ΡΠ°Π΄Π°)" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "ΡΠ΅ΠΌΠ΅Π½Π° ΠΊΠΎΠ½ΠΎΠΏΠ»ΠΈ" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "Π»ΠΈΡΡΡΡ ΠΊΠΎΠ½ΠΎΠΏΠ»ΠΈ" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "Π±ΡΡΡΠ»ΠΊΠ° ΠΊΠΎΠ½ΠΎΠΏΠ»ΡΠ½ΠΎΠ³ΠΎ ΠΌΠ°ΡΠ»Π°" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "ΠΠ΅Π½ΡΠΊΠ°" + +#: hoes.lua +msgid "Hoe" +msgstr "ΠΌΠΎΡΡΠ³Π°" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "Π΄Π΅ΡΠ΅Π²ΡΠ½Π½Π°Ρ ΠΌΠΎΡΡΠ³Π°" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "ΠΊΠ°ΠΌΠ΅Π½Π½Π°Ρ ΠΌΠΎΡΡΠ³Π°" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "ΡΡΠ°Π»ΡΠ½Π°Ρ ΠΌΠΎΡΡΠ³Π°" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "Π±ΡΠΎΠ½Π·ΠΎΠ²Π°Ρ ΠΌΠΎΡΡΠ³Π°" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "ΠΌΠ°Π³ΠΈΡΠ΅ΡΠΊΠ°Ρ ΠΌΠΎΡΡΠ³Π°" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "Π°Π»ΠΌΠ°Π·Π½Π°Ρ ΠΌΠΎΡΡΠ³Π°" + +#: init.lua +msgid "Seed" +msgstr "ΡΠ΅ΠΌΠ΅Π½Π°" + +#: melon.lua +msgid "Melon Slice" +msgstr "Π»ΠΎΠΌΡΠΈΠΊ Π°ΡΠ±ΡΠ·Π°" + +#: melon.lua +msgid "Melon" +msgstr "Π°ΡΠ±ΡΠ·" + +#: potato.lua +msgid "Potato" +msgstr "ΠΊΠ°ΡΡΠΎΡΠ΅Π»Ρ" + +#: potato.lua +msgid "Baked Potato" +msgstr "Π·Π°ΠΏΠ΅ΡΠ΅Π½Π½ΡΠΉ ΠΊΠ°ΡΡΠΎΡΠ΅Π»Ρ" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "ΡΡΠΊΠ²Π°" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "Π»ΠΎΠΌΡΠΈΠΊ ΡΡΠΊΠ²Ρ" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "ΡΠ²Π΅ΡΠΈΠ»ΡΠ½ΠΈΠΊ Π΄ΠΆΠ΅ΠΊΠ° (ΡΠ΄Π°Ρ Π΄Π»Ρ Π²ΠΊΠ»ΡΡΠ΅Π½ΠΈΡ ΠΈ ΠΎΡΠΊΠ»ΡΡΠ΅Π½ΠΈΡ)" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "ΡΡΠΊΠ²Π΅Π½Π½ΡΠΉ Ρ
Π»Π΅Π±" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "ΡΡΠΊΠ²Π΅Π½Π½ΠΎΠ΅ ΡΠ΅ΡΡΠΎ" + +#: raspberry.lua +msgid "Raspberries" +msgstr "ΠΌΠ°Π»ΠΈΠ½Π°" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "ΠΌΠ°Π»ΠΈΠ½ΠΎΠ²ΡΠΉ ΠΊΠΎΠΊΡΠ΅ΠΉΠ»Ρ" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "ΡΠ΅Π²Π΅Π½Ρ" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "ΠΏΠΈΡΠΎΠ³ ΠΈΠ· ΡΠ΅Π²Π΅Π½Ρ" + +#: soil.lua +msgid "Soil" +msgstr "Π·Π΅ΠΌΠ»Ρ" + +#: soil.lua +msgid "Wet Soil" +msgstr "ΠΌΠΎΠΊΡΠ°Ρ Π·Π΅ΠΌΠ»Ρ" + +#: sugar.lua +msgid "Sugar" +msgstr "ΡΠ°Ρ
Π°Ρ" + +#: tomato.lua +msgid "Tomato" +msgstr "ΠΏΠΎΠΌΠΈΠ΄ΠΎΡ" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "" + +#: wheat.lua +msgid "Wheat" +msgstr "ΡΠ΅ΠΌΠ΅Π½Π° ΠΏΡΠ΅Π½ΠΈΡΡ" + +#: wheat.lua +msgid "Straw" +msgstr "ΡΠΎΠ»ΠΎΠΌΠ°" + +#: wheat.lua +msgid "Flour" +msgstr "ΠΌΡΠΊΠ°" + +#: wheat.lua +msgid "Bread" +msgstr "Ρ
Π»Π΅Π±" diff --git a/farming/lucky_block.lua b/farming/lucky_block.lua index 01b4c27..087cc2e 100644 --- a/farming/lucky_block.lua +++ b/farming/lucky_block.lua @@ -10,6 +10,7 @@ if minetest.get_modpath("lucky_block") then {"nod", "farming:jackolantern", 0}, {"tro", "farming:jackolantern_on"}, {"nod", "default:river_water_source", 1}, + {"tel"}, {"dro", {"farming:trellis", "farming:grapes"}, 5}, {"dro", {"farming:bottle_ethanol"}, 1}, {"nod", "farming:melon", 0}, @@ -17,5 +18,19 @@ if minetest.get_modpath("lucky_block") then {"dro", {"farming:hemp_leaf", "farming:hemp_fibre", "farming:seed_hemp"}, 5}, {"nod", "fire:permanent_flame", 1}, {"dro", {"farming:chili_pepper", "farming:chili_bowl"}, 5}, + {"dro", {"farming:bowl"}, 3}, + {"dro", {"farming:saucepan"}, 1}, + {"dro", {"farming:pot"}, 1}, + {"dro", {"farming:baking_tray"}, 1}, + {"dro", {"farming:skillet"}, 1}, + {"exp", 4}, + {"dro", {"farming:mortar_pestle"}, 1}, + {"dro", {"farming:cutting_board"}, 1}, + {"dro", {"farming:juicer"}, 1}, + {"dro", {"farming:mixing_bowl"}, 1}, + {"dro", {"farming:hoe_bronze"}, 1}, + {"dro", {"farming:hoe_mese"}, 1}, + {"dro", {"farming:hoe_diamond"}, 1}, + {"dro", {"farming:hoe_bomb"}, 10}, }) end diff --git a/farming/mapgen.lua b/farming/mapgen.lua index ffbfb67..2554a15 100644 --- a/farming/mapgen.lua +++ b/farming/mapgen.lua @@ -1,6 +1,6 @@ -- decoration function -local function register_plant(name, min, max, spawnby, num, enabled) +local function register_plant(name, min, max, spawnon, spawnby, num, enabled) if enabled ~= true then return @@ -8,7 +8,7 @@ local function register_plant(name, min, max, spawnby, num, enabled) minetest.register_decoration({ deco_type = "simple", - place_on = {"default:dirt_with_grass"}, + place_on = spawnon or {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, @@ -28,31 +28,35 @@ end -- add crops to mapgen -register_plant("potato_3", 15, 40, "", -1, farming.potato) -register_plant("tomato_7", 5, 20, "", -1, farming.tomato) -register_plant("corn_7", 12, 22, "", -1, farming.corn) -register_plant("coffee_5", 20, 45, "", -1, farming.coffee) -register_plant("raspberry_4", 3, 10, "", -1, farming.raspberry) -register_plant("rhubarb_3", 3, 15, "", -1, farming.rhubarb) -register_plant("blueberry_4", 3, 10, "", -1, farming.blueberry) -register_plant("beanbush", 18, 35, "", -1, farming.beans) -register_plant("grapebush", 25, 45, "", -1, farming.grapes) -register_plant("onion_5", 5, 22, "", -1, farming.onion) -register_plant("garlic_5", 3, 30, "group:tree", 1, farming.garlic) +register_plant("potato_3", 15, 40, nil, "", -1, farming.potato) +register_plant("tomato_7", 5, 20, nil, "", -1, farming.tomato) +register_plant("corn_7", 12, 22, nil, "", -1, farming.corn) +register_plant("coffee_5", 20, 45, {"default:dirt_with_dry_grass", + "default:dirt_with_rainforest_litter"}, "", -1, farming.coffee) +register_plant("raspberry_4", 3, 10, nil, "", -1, farming.raspberry) +register_plant("rhubarb_3", 3, 15, nil, "", -1, farming.rhubarb) +register_plant("blueberry_4", 3, 10, nil, "", -1, farming.blueberry) +register_plant("beanbush", 18, 35, nil, "", -1, farming.beans) +register_plant("grapebush", 25, 45, nil, "", -1, farming.grapes) +register_plant("onion_5", 5, 22, nil, "", -1, farming.onion) +register_plant("garlic_5", 3, 30, nil, "group:tree", 1, farming.garlic) +register_plant("pea_5", 25, 50, nil, "", -1, farming.peas) +register_plant("beetroot_5", 1, 15, nil, "", -1, farming.beetroot) if minetest.get_mapgen_setting("mg_name") == "v6" then - register_plant("carrot_8", 1, 30, "group:water", 1, farming.carrot) - register_plant("cucumber_4", 1, 20, "group:water", 1, farming.cucumber) - register_plant("melon_8", 1, 20, "group:water", 1, farming.melon) - register_plant("pumpkin_8", 1, 20, "group:water", 1, farming.pumpkin) + register_plant("carrot_8", 1, 30, nil, "group:water", 1, farming.carrot) + register_plant("cucumber_4", 1, 20, nil, "group:water", 1, farming.cucumber) + register_plant("melon_8", 1, 20, nil, "group:water", 1, farming.melon) + register_plant("pumpkin_8", 1, 20, nil, "group:water", 1, farming.pumpkin) else -- v7 maps have a beach so plants growing near water is limited to 6 high - register_plant("carrot_8", 1, 6, "", -1, farming.carrot) - register_plant("cucumber_4", 1, 6, "", -1, farming.cucumber) - register_plant("melon_8", 1, 6, "", -1, farming.melon) - register_plant("pumpkin_8", 1, 6, "", -1, farming.pumpkin) + register_plant("carrot_8", 1, 15, nil, "", -1, farming.carrot) + register_plant("cucumber_4", 1, 10, nil, "", -1, farming.cucumber) + register_plant("melon_8", 1, 6, {"default:dirt_with_dry_grass", + "default:dirt_with_rainforest_litter"}, "", -1, farming.melon) + register_plant("pumpkin_8", 1, 6, nil, "", -1, farming.pumpkin) end if farming.hemp then @@ -68,8 +72,8 @@ minetest.register_decoration({ octaves = 3, persist = 0.6 }, - y_min = 5, - y_max = 35, + y_min = 3, + y_max = 45, decoration = "farming:hemp_7", spawn_by = "group:tree", num_spawn_by = 1, diff --git a/farming/melon.lua b/farming/melon.lua index e2f6564..2165558 100644 --- a/farming/melon.lua +++ b/farming/melon.lua @@ -5,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1") end, @@ -77,6 +78,9 @@ crop_def.description = S("Melon") crop_def.tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png"} crop_def.selection_box = {-.5, -.5, -.5, .5, .5, .5} crop_def.walkable = true -crop_def.groups = {snappy = 1, oddly_breakable_by_hand = 1, flammable = 2, plant = 1} +crop_def.groups = { + food_melon = 1, snappy = 1, oddly_breakable_by_hand = 1, + flammable = 2, plant = 1 +} crop_def.drop = "farming:melon_slice 9" minetest.register_node("farming:melon_8", table.copy(crop_def)) diff --git a/farming/onion.lua b/farming/onion.lua index bf8737a..21b5c2e 100644 --- a/farming/onion.lua +++ b/farming/onion.lua @@ -11,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1") end, @@ -59,7 +60,7 @@ crop_def.drop = { max_items = 5, items = { {items = {'farming:onion'}, rarity = 1}, {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}, } diff --git a/farming/pea.lua b/farming/pea.lua new file mode 100644 index 0000000..ef14dab --- /dev/null +++ b/farming/pea.lua @@ -0,0 +1,89 @@ + +local S = farming.intllib + +-- Textures for Pea crop and Peas were done by Andrey01 + +-- pea pod +minetest.register_craftitem("farming:pea_pod", { + description = S("Pea Pod"), + inventory_image = "farming_pea_pod.png", + groups = {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 +}) + +minetest.register_craftitem("farming:peas", { + description = S("Peas"), + inventory_image = "farming_pea_peas.png", + groups = {food_peas = 1, flammable = 2}, + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:peas", + recipe = {"farming:pea_pod"} +}) + +-- pea soup +minetest.register_craftitem("farming:pea_soup", { + description = S("Pea Soup"), + inventory_image = "farming_pea_soup.png", + groups = {flammable = 2}, + on_use = minetest.item_eat(4, "farming:bowl"), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:pea_soup", + recipe = {"group:food_peas", "group:food_peas", "group:food_bowl"} +}) + +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_pea_1.png"}, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, flora = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:pea_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_pea_2.png"} +minetest.register_node("farming:pea_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_pea_3.png"} +minetest.register_node("farming:pea_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_pea_4.png"} +minetest.register_node("farming:pea_4", table.copy(crop_def)) + +-- stage 5 +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}, + } +} +minetest.register_node("farming:pea_5", table.copy(crop_def)) diff --git a/farming/pepper.lua b/farming/pepper.lua index 3ce60cd..4831952 100644 --- a/farming/pepper.lua +++ b/farming/pepper.lua @@ -11,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1") end, @@ -21,13 +22,13 @@ minetest.register_craftitem("farming:pepper", { description = S("Pepper"), inventory_image = "crops_pepper.png", on_use = minetest.item_eat(2), - groups = {pepper = 1}, + groups = {food_pepper = 1, flammable = 3}, }) minetest.register_craft({ type = "shapeless", output = "farming:peppercorn", - recipe = { "farming:pepper" } + recipe = {"farming:pepper"} }) -- ground pepper @@ -38,7 +39,10 @@ minetest.register_node("farming:pepper_ground", { drawtype = "plantlike", paramtype = "light", tiles = {"crops_pepper_ground.png"}, - groups = {vessel = 1, pepper_ground = 1, dig_immediate = 3, attached_node = 1}, + groups = { + vessel = 1, food_pepper_ground = 1, + dig_immediate = 3, attached_node = 1 + }, sounds = default.node_sound_glass_defaults(), selection_box = { type = "fixed", @@ -49,7 +53,8 @@ minetest.register_node("farming:pepper_ground", { minetest.register_craft( { output = "farming:pepper_ground", type = "shapeless", - recipe = {"farming:peppercorn", "vessels:glass_bottle"} + recipe = {"group:food_peppercorn", "vessels:glass_bottle", "farming:mortar_pestle"}, + replacements = {{"farming:mortar_pestle", "farming:mortar_pestle"}}, }) -- crop definition @@ -92,8 +97,9 @@ crop_def.tiles = {"crops_pepper_plant_5.png"} crop_def.groups.growing = 0 crop_def.drop = { max_items = 2, items = { - {items = {'farming:pepper'}, rarity = 1}, + {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/farming/pineapple.lua b/farming/pineapple.lua index 2e7f5b7..6376f2f 100644 --- a/farming/pineapple.lua +++ b/farming/pineapple.lua @@ -24,20 +24,21 @@ minetest.register_node("farming:pineapple", { type = "fixed", fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27} }, - groups = {fleshy = 3, dig_immediate = 3, flammable = 2}, + groups = {food_pineapple = 1, fleshy = 3, dig_immediate = 3, flammable = 2}, }) -- pineapple minetest.register_craftitem("farming:pineapple_ring", { description = S("Pineapple Ring"), inventory_image = "farming_pineapple_ring.png", + groups = {food_pineapple_ring = 1, flammable = 2}, on_use = minetest.item_eat(1), }) minetest.register_craft( { output = "farming:pineapple_ring 5", type = "shapeless", - recipe = {"farming:pineapple"}, + recipe = {"group:food_pineapple"}, replacements = {{"farming:pineapple", "farming:pineapple_top"}} }) @@ -51,8 +52,21 @@ minetest.register_craftitem("farming:pineapple_juice", { minetest.register_craft({ output = "farming:pineapple_juice", type = "shapeless", - recipe = {"vessels:drinking_glass", "farming:pineapple_ring", - "farming:pineapple_ring", "farming:pineapple_ring"}, + recipe = {"vessels:drinking_glass", "group:food_pineapple_ring", + "group:food_pineapple_ring", "group:food_pineapple_ring", + "farming:juicer"}, + replacements = { + {"farming:juicer", "farming:juicer"}, + }, +}) + +minetest.register_craft({ + output = "farming:pineapple_juice 2", + type = "shapeless", + recipe = {"vessels:drinking_glass", "group:food_pineapple", "farming:juicer"}, + replacements = { + {"farming:juicer", "farming:juicer"}, + }, }) -- crop definition diff --git a/farming/potato.lua b/farming/potato.lua index be36905..a922b11 100644 --- a/farming/potato.lua +++ b/farming/potato.lua @@ -10,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1") end, @@ -27,7 +28,7 @@ minetest.register_craft({ type = "cooking", cooktime = 10, output = "farming:baked_potato", - recipe = "farming:potato" + recipe = "group:food_potato" }) -- potato definition diff --git a/farming/pumpkin.lua b/farming/pumpkin.lua index 8bff778..d8e8ec6 100644 --- a/farming/pumpkin.lua +++ b/farming/pumpkin.lua @@ -14,7 +14,7 @@ minetest.register_node("farming:pumpkin", { "farming_pumpkin_side.png" }, groups = { - choppy = 1, oddly_breakable_by_hand = 1, + food_pumpkin = 1, choppy = 1, oddly_breakable_by_hand = 1, flammable = 2, plant = 1 }, drop = { @@ -29,6 +29,7 @@ minetest.register_node("farming:pumpkin", { minetest.register_craftitem("farming:pumpkin_slice", { description = S("Pumpkin Slice"), inventory_image = "farming_pumpkin_slice.png", + groups = {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, @@ -97,9 +98,34 @@ minetest.register_node("farming:jackolantern_on", { minetest.register_craft({ output = "farming:jackolantern", recipe = { - {"", "", ""}, - {"", "default:torch", ""}, - {"", "farming:pumpkin", ""}, + {"default:torch"}, + {"group:food_pumpkin"}, + } +}) + +--- wooden scarecrow base +minetest.register_node("farming:scarecrow_bottom", { + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "facedir", + tiles = {"default_wood.png"}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16}, + {-12/16, 4/16, -1/16, 12/16, 2/16, 1/16}, + }, + }, + groups = {snappy = 3, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:scarecrow_bottom", + recipe = { + {"", "group:stick", "",}, + {"group:stick", "group:stick", "group:stick",}, + {"", "group:stick", "",} } }) @@ -107,7 +133,8 @@ minetest.register_craft({ minetest.register_craftitem("farming:pumpkin_bread", { description = S("Pumpkin Bread"), inventory_image = "farming_pumpkin_bread.png", - on_use = minetest.item_eat(8) + on_use = minetest.item_eat(8), + groups = {food_bread = 1, flammable = 2}, }) minetest.register_craftitem("farming:pumpkin_dough", { @@ -118,7 +145,7 @@ minetest.register_craftitem("farming:pumpkin_dough", { minetest.register_craft({ output = "farming:pumpkin_dough", type = "shapeless", - recipe = {"farming:flour", "farming:pumpkin_slice", "farming:pumpkin_slice"} + recipe = {"group:food_flour", "group:food_pumpkin_slice", "group:food_pumpkin_slice"} }) minetest.register_craft({ diff --git a/farming/raspberry.lua b/farming/raspberry.lua index 384eb59..931d2ae 100644 --- a/farming/raspberry.lua +++ b/farming/raspberry.lua @@ -5,6 +5,7 @@ local S = farming.intllib minetest.register_craftitem("farming:raspberries", { description = S("Raspberries"), inventory_image = "farming_raspberries.png", + groups = {food_raspberries = 1, flammable = 2}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1") end, @@ -22,7 +23,7 @@ minetest.register_craft({ output = "farming:smoothie_raspberry", recipe = { {"default:snow"}, - {"farming:raspberries"}, + {"group:food_raspberries"}, {"vessels:drinking_glass"}, } }) diff --git a/farming/rhubarb.lua b/farming/rhubarb.lua index 30e9fba..1fa897f 100644 --- a/farming/rhubarb.lua +++ b/farming/rhubarb.lua @@ -5,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1") end, @@ -21,10 +22,11 @@ minetest.register_craftitem("farming:rhubarb_pie", { minetest.register_craft({ output = "farming:rhubarb_pie", recipe = { - {"", "farming:sugar", ""}, - {"farming:rhubarb", "farming:rhubarb", "farming:rhubarb"}, - {"farming:wheat", "farming:wheat", "farming:wheat"}, - } + {"farming:baking_tray", "group:food_sugar", ""}, + {"group:food_rhubarb", "group:food_rhubarb", "group:food_rhubarb"}, + {"group:food_wheat", "group:food_wheat", "group:food_wheat"}, + }, + replacements = {{"farming:baking_tray", "farming:baking_tray"}} }) -- rhubarb definition diff --git a/farming/sugar.lua b/farming/sugar.lua index 012a987..bdaf698 100644 --- a/farming/sugar.lua +++ b/farming/sugar.lua @@ -6,6 +6,7 @@ local S = farming.intllib minetest.register_craftitem("farming:sugar", { description = S("Sugar"), inventory_image = "farming_sugar.png", + groups = {food_sugar = 1, flammable = 3}, }) minetest.register_craft({ @@ -25,7 +26,8 @@ minetest.register_node("farming:salt", { drawtype = "plantlike", paramtype = "light", tiles = {"farming_salt.png"}, - groups = {vessel = 1, salt = 1, dig_immediate = 3, attached_node = 1}, + groups = {food_salt = 1, vessel = 1, dig_immediate = 3, + attached_node = 1}, sounds = default.node_sound_glass_defaults(), selection_box = { type = "fixed", diff --git a/farming/textures/farming_baking_tray.png b/farming/textures/farming_baking_tray.png Binary files differnew file mode 100644 index 0000000..be1711c --- /dev/null +++ b/farming/textures/farming_baking_tray.png diff --git a/farming/textures/farming_beetroot.png b/farming/textures/farming_beetroot.png Binary files differnew file mode 100644 index 0000000..6a60168 --- /dev/null +++ b/farming/textures/farming_beetroot.png diff --git a/farming/textures/farming_beetroot_1.png b/farming/textures/farming_beetroot_1.png Binary files differnew file mode 100644 index 0000000..8b75e10 --- /dev/null +++ b/farming/textures/farming_beetroot_1.png diff --git a/farming/textures/farming_beetroot_2.png b/farming/textures/farming_beetroot_2.png Binary files differnew file mode 100644 index 0000000..9c1ce1e --- /dev/null +++ b/farming/textures/farming_beetroot_2.png diff --git a/farming/textures/farming_beetroot_3.png b/farming/textures/farming_beetroot_3.png Binary files differnew file mode 100644 index 0000000..0f28e5e --- /dev/null +++ b/farming/textures/farming_beetroot_3.png diff --git a/farming/textures/farming_beetroot_4.png b/farming/textures/farming_beetroot_4.png Binary files differnew file mode 100644 index 0000000..35f211b --- /dev/null +++ b/farming/textures/farming_beetroot_4.png diff --git a/farming/textures/farming_beetroot_5.png b/farming/textures/farming_beetroot_5.png Binary files differnew file mode 100644 index 0000000..c4b8957 --- /dev/null +++ b/farming/textures/farming_beetroot_5.png diff --git a/farming/textures/farming_beetroot_soup.png b/farming/textures/farming_beetroot_soup.png Binary files differnew file mode 100644 index 0000000..4df562e --- /dev/null +++ b/farming/textures/farming_beetroot_soup.png diff --git a/farming/textures/farming_bowl.png b/farming/textures/farming_bowl.png Binary files differnew file mode 100644 index 0000000..627c22e --- /dev/null +++ b/farming/textures/farming_bowl.png diff --git a/farming/textures/farming_bread_slice.png b/farming/textures/farming_bread_slice.png Binary files differnew file mode 100644 index 0000000..ff2714d --- /dev/null +++ b/farming/textures/farming_bread_slice.png diff --git a/farming/textures/farming_cocoa_1.png b/farming/textures/farming_cocoa_1.png Binary files differindex f887a1f..18fd362 100644 --- a/farming/textures/farming_cocoa_1.png +++ b/farming/textures/farming_cocoa_1.png diff --git a/farming/textures/farming_cocoa_2.png b/farming/textures/farming_cocoa_2.png Binary files differindex f0d3935..c304ee0 100644 --- a/farming/textures/farming_cocoa_2.png +++ b/farming/textures/farming_cocoa_2.png diff --git a/farming/textures/farming_cocoa_3.png b/farming/textures/farming_cocoa_3.png Binary files differindex 8eaf67e..d66b47d 100644 --- a/farming/textures/farming_cocoa_3.png +++ b/farming/textures/farming_cocoa_3.png diff --git a/farming/textures/farming_cocoa_4.png b/farming/textures/farming_cocoa_4.png Binary files differnew file mode 100644 index 0000000..990a8b4 --- /dev/null +++ b/farming/textures/farming_cocoa_4.png diff --git a/farming/textures/farming_cutting_board.png b/farming/textures/farming_cutting_board.png Binary files differnew file mode 100644 index 0000000..90b3f9c --- /dev/null +++ b/farming/textures/farming_cutting_board.png diff --git a/farming/textures/farming_hemp_block.png b/farming/textures/farming_hemp_block.png Binary files differnew file mode 100644 index 0000000..285a2cd --- /dev/null +++ b/farming/textures/farming_hemp_block.png diff --git a/farming/textures/farming_hoe_bomb.png b/farming/textures/farming_hoe_bomb.png Binary files differnew file mode 100644 index 0000000..e8db9b1 --- /dev/null +++ b/farming/textures/farming_hoe_bomb.png diff --git a/farming/textures/farming_juicer.png b/farming/textures/farming_juicer.png Binary files differnew file mode 100644 index 0000000..46265e4 --- /dev/null +++ b/farming/textures/farming_juicer.png diff --git a/farming/textures/farming_mixing_bowl.png b/farming/textures/farming_mixing_bowl.png Binary files differnew file mode 100644 index 0000000..e96edf0 --- /dev/null +++ b/farming/textures/farming_mixing_bowl.png diff --git a/farming/textures/farming_mortar_pestle.png b/farming/textures/farming_mortar_pestle.png Binary files differnew file mode 100644 index 0000000..abfeb9e --- /dev/null +++ b/farming/textures/farming_mortar_pestle.png diff --git a/farming/textures/farming_pea_1.png b/farming/textures/farming_pea_1.png Binary files differnew file mode 100644 index 0000000..eb48e36 --- /dev/null +++ b/farming/textures/farming_pea_1.png diff --git a/farming/textures/farming_pea_2.png b/farming/textures/farming_pea_2.png Binary files differnew file mode 100644 index 0000000..4db7551 --- /dev/null +++ b/farming/textures/farming_pea_2.png diff --git a/farming/textures/farming_pea_3.png b/farming/textures/farming_pea_3.png Binary files differnew file mode 100644 index 0000000..980d6ea --- /dev/null +++ b/farming/textures/farming_pea_3.png diff --git a/farming/textures/farming_pea_4.png b/farming/textures/farming_pea_4.png Binary files differnew file mode 100644 index 0000000..551eaf4 --- /dev/null +++ b/farming/textures/farming_pea_4.png diff --git a/farming/textures/farming_pea_5.png b/farming/textures/farming_pea_5.png Binary files differnew file mode 100644 index 0000000..907760d --- /dev/null +++ b/farming/textures/farming_pea_5.png diff --git a/farming/textures/farming_pea_peas.png b/farming/textures/farming_pea_peas.png Binary files differnew file mode 100644 index 0000000..d70b283 --- /dev/null +++ b/farming/textures/farming_pea_peas.png diff --git a/farming/textures/farming_pea_pod.png b/farming/textures/farming_pea_pod.png Binary files differnew file mode 100644 index 0000000..1c19c9f --- /dev/null +++ b/farming/textures/farming_pea_pod.png diff --git a/farming/textures/farming_pea_soup.png b/farming/textures/farming_pea_soup.png Binary files differnew file mode 100644 index 0000000..03753cf --- /dev/null +++ b/farming/textures/farming_pea_soup.png diff --git a/farming/textures/farming_pot.png b/farming/textures/farming_pot.png Binary files differnew file mode 100644 index 0000000..d28411d --- /dev/null +++ b/farming/textures/farming_pot.png diff --git a/farming/textures/farming_saucepan.png b/farming/textures/farming_saucepan.png Binary files differnew file mode 100644 index 0000000..2625d45 --- /dev/null +++ b/farming/textures/farming_saucepan.png diff --git a/farming/textures/farming_skillet.png b/farming/textures/farming_skillet.png Binary files differnew file mode 100644 index 0000000..60d26a1 --- /dev/null +++ b/farming/textures/farming_skillet.png diff --git a/farming/textures/farming_toast.png b/farming/textures/farming_toast.png Binary files differnew file mode 100644 index 0000000..8a4524e --- /dev/null +++ b/farming/textures/farming_toast.png diff --git a/farming/textures/farming_toast_sandwich.png b/farming/textures/farming_toast_sandwich.png Binary files differnew file mode 100644 index 0000000..c60ff5a --- /dev/null +++ b/farming/textures/farming_toast_sandwich.png diff --git a/farming/tomato.lua b/farming/tomato.lua index 1ed7870..53012a8 100644 --- a/farming/tomato.lua +++ b/farming/tomato.lua @@ -10,6 +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}, on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1") end, diff --git a/farming/utensils.lua b/farming/utensils.lua new file mode 100644 index 0000000..63a7de3 --- /dev/null +++ b/farming/utensils.lua @@ -0,0 +1,149 @@ + +local S = farming.intllib + +-- wooden bowl + +minetest.register_craftitem("farming:bowl", { + description = S("Wooden Bowl"), + inventory_image = "farming_bowl.png", + groups = {food_bowl = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:bowl 4", + recipe = { + {"group:wood", "", "group:wood"}, + {"", "group:wood", ""}, + } +}) + +-- saucepan + +minetest.register_craftitem("farming:saucepan", { + description = S("Saucepan"), + inventory_image = "farming_saucepan.png", + groups = {food_saucepan = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:saucepan", + recipe = { + {"default:steel_ingot", "", ""}, + {"", "group:stick", ""}, + } +}) + +-- cooking pot + +minetest.register_craftitem("farming:pot", { + description = S("Cooking Pot"), + inventory_image = "farming_pot.png", + groups = {food_pot = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:pot", + recipe = { + {"group:stick", "default:steel_ingot", "default:steel_ingot"}, + {"", "default:steel_ingot", "default:steel_ingot"}, + } +}) + +-- baking tray + +minetest.register_craftitem("farming:baking_tray", { + description = S("Baking Tray"), + inventory_image = "farming_baking_tray.png", + groups = {food_baking_tray = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:baking_tray", + recipe = { + {"default:clay_brick", "default:clay_brick", "default:clay_brick"}, + {"default:clay_brick", "", "default:clay_brick"}, + {"default:clay_brick", "default:clay_brick", "default:clay_brick"}, + } +}) + +-- skillet + +minetest.register_craftitem("farming:skillet", { + description = S("Skillet"), + inventory_image = "farming_skillet.png", + groups = {food_baking_tray = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:skillet", + recipe = { + {"default:steel_ingot", "", ""}, + {"", "default:steel_ingot", ""}, + {"", "", "group:stick"}, + } +}) + +-- mortar and pestle + +minetest.register_craftitem("farming:mortar_pestle", { + description = S("Mortar and Pestle"), + inventory_image = "farming_mortar_pestle.png", + groups = {food_mortar_pestle = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:mortar_pestle", + recipe = { + {"default:stone", "group:stick", "default:stone"}, + {"", "default:stone", ""}, + } +}) + +-- cutting board + +minetest.register_craftitem("farming:cutting_board", { + description = S("Cutting Board"), + inventory_image = "farming_cutting_board.png", + groups = {food_cutting_board = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:cutting_board", + recipe = { + {"default:steel_ingot", "", ""}, + {"", "group:stick", ""}, + {"", "", "group:wood"}, + } +}) + +-- juicer + +minetest.register_craftitem("farming:juicer", { + description = S("Juicer"), + inventory_image = "farming_juicer.png", + groups = {food_juicer = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:juicer", + recipe = { + {"", "default:stone", ""}, + {"default:stone", "", "default:stone"}, + } +}) + +-- glass mixing bowl + +minetest.register_craftitem("farming:mixing_bowl", { + description = S("Glass Mixing Bowl"), + inventory_image = "farming_mixing_bowl.png", + groups = {food_mixing_bowl = 1, flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:mixing_bowl", + recipe = { + {"default:glass", "group:stick", "default:glass"}, + {"", "default:glass", ""}, + } +}) diff --git a/farming/wheat.lua b/farming/wheat.lua index 79988b6..1b22723 100644 --- a/farming/wheat.lua +++ b/farming/wheat.lua @@ -23,7 +23,7 @@ minetest.register_node("farming:seed_wheat", { minetest.register_craftitem("farming:wheat", { description = S("Wheat"), inventory_image = "farming_wheat.png", - groups = {flammable = 4}, + groups = {food_wheat = 1, flammable = 4}, }) -- straw @@ -55,13 +55,17 @@ minetest.register_craft({ minetest.register_craftitem("farming:flour", { description = S("Flour"), inventory_image = "farming_flour.png", - groups = {flammable = 1}, + groups = {food_flour = 1, flammable = 1}, }) minetest.register_craft({ type = "shapeless", output = "farming:flour", - recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"} + recipe = { + "farming:wheat", "farming:wheat", "farming:wheat", + "farming:wheat", "farming:mortar_pestle" + }, + replacements = {{"farming:mortar_pestle", "farming:mortar_pestle"}}, }) -- bread @@ -69,7 +73,7 @@ minetest.register_craftitem("farming:bread", { description = S("Bread"), inventory_image = "farming_bread.png", on_use = minetest.item_eat(5), - groups = {flammable = 2}, + groups = {food_bread = 1, flammable = 2}, }) minetest.register_craft({ @@ -79,6 +83,53 @@ minetest.register_craft({ recipe = "farming:flour" }) +-- sliced bread +minetest.register_craftitem("farming:bread_slice", { + description = S("Sliced Bread"), + inventory_image = "farming_bread_slice.png", + on_use = minetest.item_eat(1), + groups = {food_bread_slice = 1, flammable = 2}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:bread_slice 5", + recipe = {"farming:bread", "group:food_cutting_board"}, + replacements = {{"farming:cutting_board", "farming:cutting_board"}}, +}) + +-- toast +minetest.register_craftitem("farming:toast", { + description = S("Toast"), + inventory_image = "farming_toast.png", + on_use = minetest.item_eat(1), + groups = {food_toast = 1, flammable = 2}, +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 3, + output = "farming:toast", + recipe = "farming:bread_slice" +}) + +-- toast sandwich +minetest.register_craftitem("farming:toast_sandwich", { + description = S("Toast Sandwich"), + inventory_image = "farming_toast_sandwich.png", + on_use = minetest.item_eat(4), + groups = {flammable = 2}, +}) + +minetest.register_craft({ + output = "farming:toast_sandwich", + recipe = { + {"farming:bread_slice"}, + {"farming:toast"}, + {"farming:bread_slice"}, + } +}) + -- wheat definition local crop_def = { drawtype = "plantlike", |