diff --git a/README.md b/README.md index 55ddee0..30e5673 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,16 @@ 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.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. - 1.38 - Pumpkin grows into block, use chopping board to cut into 4x slices, same with melon block, 2x2 slices makes a block, cocoa pods are no longer walkable - 1.37 - Added custom 'growth_check(pos, nodename) function for crop nodes to use (check cocoa.lua for example) - 1.36 - Added Beetroot, Beetroot Soup (6x beetroot, 1x bowl), fix register_plant() issue, add new recipes - 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.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 @@ -59,4 +63,4 @@ This mod works by adding your new plant to the {growing=1} group and numbering t - 0.1 - Fixed growing bug - 0.0 - Initial release -### Lucky Blocks: 38 +### Lucky Blocks: 39 diff --git a/api.txt b/api.txt index 0098624..acec5a0 100644 --- a/api.txt +++ b/api.txt @@ -56,3 +56,9 @@ growth_check = function(pos, node_name) end return true -- condition not met, skip next growth stage until next check end, + +### Scythe items that will not drop + +This is a function to add items to a list that scythes will not drop, e.g. farming:trellis or farming:beanpole. + +farming.add_to_scythe_not_drops(item_name) diff --git a/crops/barley.lua b/crops/barley.lua index 6f3cb97..cc5ca0f 100644 --- a/crops/barley.lua +++ b/crops/barley.lua @@ -110,5 +110,13 @@ farming.registered_plants["farming:barley"] = { seed = "farming:seed_barley", minlight = 13, maxlight = 15, - steps = 8 + steps = 7 } + +-- Fuel + +minetest.register_craft({ + type = "fuel", + recipe = "farming:barley", + burntime = 1, +}) diff --git a/crops/beans.lua b/crops/beans.lua index a75030a..bd3b8ee 100644 --- a/crops/beans.lua +++ b/crops/beans.lua @@ -191,7 +191,7 @@ local crop_def = { selection_box = farming.select, groups = { snappy = 3, flammable = 3, not_in_creative_inventory = 1, - attached_node = 1, growing = 1 + attached_node = 1, growing = 1, plant = 1 }, sounds = default.node_sound_leaves_defaults() } diff --git a/crops/carrot.lua b/crops/carrot.lua index b4baa8d..6ec1994 100644 --- a/crops/carrot.lua +++ b/crops/carrot.lua @@ -22,6 +22,7 @@ minetest.register_craftitem("farming:carrot_juice", { description = S("Carrot Juice"), inventory_image = "farming_carrot_juice.png", on_use = minetest.item_eat(4, "vessels:drinking_glass"), + groups = {vessel = 1}, }) minetest.register_craft({ diff --git a/crops/grapes.lua b/crops/grapes.lua index c341075..2b33427 100644 --- a/crops/grapes.lua +++ b/crops/grapes.lua @@ -186,7 +186,7 @@ local crop_def = { selection_box = farming.select, groups = { snappy = 3, flammable = 3, not_in_creative_inventory = 1, - attached_node = 1, growing = 1 + attached_node = 1, growing = 1, plant = 1 }, sounds = default.node_sound_leaves_defaults() } diff --git a/crops/pineapple.lua b/crops/pineapple.lua index 8a60310..f62042e 100644 --- a/crops/pineapple.lua +++ b/crops/pineapple.lua @@ -47,6 +47,7 @@ minetest.register_craftitem("farming:pineapple_juice", { description = S("Pineapple Juice"), inventory_image = "farming_pineapple_juice.png", on_use = minetest.item_eat(4, "vessels:drinking_glass"), + groups = {vessel = 1}, }) minetest.register_craft({ diff --git a/crops/potato.lua b/crops/potato.lua index 1547fc0..256ce97 100644 --- a/crops/potato.lua +++ b/crops/potato.lua @@ -14,7 +14,16 @@ minetest.register_craftitem("farming:potato", { on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1") end, - on_use = minetest.item_eat(1), +-- on_use = minetest.item_eat(1), + on_use = function(itemstack, user, pointed_thing) + if user then + if math.random(1, 3) == 1 then + return minetest.do_item_eat(-1, nil, itemstack, user, pointed_thing) + else + return minetest.do_item_eat(1, nil, itemstack, user, pointed_thing) + end + end + end, }) -- baked potato diff --git a/crops/pumpkin.lua b/crops/pumpkin.lua index c362449..3960a26 100644 --- a/crops/pumpkin.lua +++ b/crops/pumpkin.lua @@ -46,6 +46,8 @@ minetest.register_node("farming:jackolantern", { groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2}, sounds = default.node_sound_wood_defaults(), on_punch = function(pos, node, puncher) + local name = puncher:get_player_name() or "" + if minetest.is_protected(pos, name) then return end node.name = "farming:jackolantern_on" minetest.swap_node(pos, node) end, @@ -69,6 +71,8 @@ minetest.register_node("farming:jackolantern_on", { sounds = default.node_sound_wood_defaults(), drop = "farming:jackolantern", on_punch = function(pos, node, puncher) + local name = puncher:get_player_name() or "" + if minetest.is_protected(pos, name) then return end node.name = "farming:jackolantern" minetest.swap_node(pos, node) end, diff --git a/crops/raspberry.lua b/crops/raspberry.lua index 4938658..979bdfb 100644 --- a/crops/raspberry.lua +++ b/crops/raspberry.lua @@ -17,6 +17,7 @@ minetest.register_craftitem("farming:smoothie_raspberry", { description = S("Raspberry Smoothie"), inventory_image = "farming_raspberry_smoothie.png", on_use = minetest.item_eat(2, "vessels:drinking_glass"), + groups = {vessel = 1}, }) minetest.register_craft({ diff --git a/crops/ryeoatrice.lua b/crops/ryeoatrice.lua new file mode 100644 index 0000000..d064626 --- /dev/null +++ b/crops/ryeoatrice.lua @@ -0,0 +1,162 @@ + +local S = farming.intllib + +--= A nice addition from Ademant's grain mod :) + +-- Rye + +farming.register_plant("farming:rye", { + description = "Rye seed", + paramtype2 = "meshoptions", + inventory_image = "farming_rye_seed.png", + steps = 8, + place_param2 = 3, +}) + +minetest.override_item("farming:rye", { + groups = {food_rye = 1, flammable = 4} +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:flour", + recipe = { + "farming:rye", "farming:rye", "farming:rye", "farming:rye", + "farming:mortar_pestle" + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}}, +}) + +-- Oats + +farming.register_plant("farming:oat", { + description = "Oat seed", + paramtype2 = "meshoptions", + inventory_image = "farming_oat_seed.png", + steps = 8, + place_param2 = 3, +}) + +minetest.override_item("farming:oat", { + groups = {food_oats = 1, flammable = 4} +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:flour", + recipe = { + "farming:oat", "farming:oat", "farming:oat", "farming:oat", + "farming:mortar_pestle" + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}}, +}) + +-- Rice + +farming.register_plant("farming:rice", { + description = "Rice grains", + paramtype2 = "meshoptions", + inventory_image = "farming_rice_seed.png", + steps = 8, + place_param2 = 3, +}) + +minetest.override_item("farming:rice", { + groups = {food_rice = 1, flammable = 4} +}) + +minetest.register_craftitem("farming:rice_bread", { + description = "Rice Bread", + inventory_image = "farming_rice_bread.png", + on_use = minetest.item_eat(5), + groups = {food_rice_bread = 1, flammable = 2}, +}) + +minetest.register_craftitem("farming:rice_flour", { + description = "Rice Flour", + inventory_image = "farming_rice_flour.png", + groups = {food_rice_flour = 1, flammable = 1}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:rice_flour", + recipe = { + "farming:rice", "farming:rice", "farming:rice", "farming:rice", + "farming:mortar_pestle" + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}}, +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 15, + output = "farming:rice_bread", + recipe = "farming:rice_flour" +}) + +-- Multigrain flour + +minetest.register_craftitem("farming:flour_multigrain", { + description = S("Multigrain Flour"), + inventory_image = "farming_flour_multigrain.png", + groups = {food_flour = 1, flammable = 1}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:flour_multigrain", + recipe = { + "farming:wheat", "farming:barley", "farming:oat", + "farming:rye", "farming:mortar_pestle" + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}}, +}) + +-- Multigrain bread + +minetest.register_craftitem("farming:bread_multigrain", { + description = S("Multigrain Bread"), + inventory_image = "farming_bread_multigrain.png", + on_use = minetest.item_eat(7), + groups = {food_bread = 1, flammable = 2}, +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 15, + output = "farming:bread_multigrain", + recipe = "farming:flour_multigrain" +}) + +-- Fuels + +minetest.register_craft({ + type = "fuel", + recipe = "farming:rice_bread", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:bread_multigrain", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:rye", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:oat", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:rice", + burntime = 1, +}) diff --git a/farming.conf_example b/farming.conf_example index f652e9c..d108bb5 100644 --- a/farming.conf_example +++ b/farming.conf_example @@ -5,30 +5,32 @@ world folder for map specific settings. --]] --- true to enable crop/food in-game and on mapgen -farming.carrot = true -farming.potato = true -farming.tomato = true -farming.cucumber = true -farming.corn = true -farming.coffee = true -farming.melon = true -farming.pumpkin = true -farming.cocoa = true -farming.raspberry = true -farming.blueberry = true -farming.rhubarb = true -farming.beans = true -farming.grapes = true -farming.barley = true -farming.chili = true -farming.hemp = true -farming.onion = true -farming.garlic = true -farming.pepper = true -farming.pineapple = true -farming.peas = true -farming.beetroot = true - --- rarety of crops on map, default is 0.001 (higher number = more crops) +-- true to enable crop/food in-game and on mapgen set spawn rarety +farming.carrot = 0.001 +farming.potato = 0.001 +farming.tomato = 0.001 +farming.cucumber = 0.001 +farming.corn = 0.001 +farming.coffee = 0.001 +farming.melon = 0.001 +farming.pumpkin = 0.001 +farming.cocoa = true -- true or false only +farming.raspberry = 0.001 +farming.blueberry = 0.001 +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.garlic = 0.001 +farming.onion = 0.001 +farming.pepper = 0.002 +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 diff --git a/food.lua b/food.lua index f099e53..1670f1f 100644 --- a/food.lua +++ b/food.lua @@ -185,4 +185,36 @@ minetest.after(0, function() }, replacements = {{fluid_return, "bucket:bucket_empty"}} }) + + minetest.register_craft({ + type = "shapeless", + output = "farming:porridge", + recipe = { + "group:food_oats", "group:food_oats", "group:food_oats", + "group:food_oats", "group:food_bowl", fluid + }, + replacements = {{fluid_return, "bucket:bucket_empty"}} + }) end) + +--= Jaffa Cake + +minetest.register_craftitem("farming:jaffa_cake", { + description = S("Jaffa Cake"), + inventory_image = "farming_jaffa_cake.png", + on_use = minetest.item_eat(6), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:jaffa_cake", + recipe = { + "farming:baking_tray", "group:food_egg", "group:food_sugar", + "group:food_flour", "group:food_cocoa", "group:food_orange", + "group:food_milk" + }, + replacements = { + {"farming:baking_tray", "farming:baking_tray"}, + {"mobs:bucket_milk", "bucket:bucket_empty"} + } +}) diff --git a/grass.lua b/grass.lua index 9644254..53ea606 100644 --- a/grass.lua +++ b/grass.lua @@ -8,6 +8,7 @@ for i = 4, 5 do max_items = 1, items = { {items = {'farming:seed_wheat'}, rarity = 5}, + {items = {'farming:seed_oat'},rarity = 5}, {items = {'default:grass_1'}}, } }, @@ -21,7 +22,8 @@ for i = 4, 5 do drop = { max_items = 1, items = { - {items = {'farming:seed_barley'}, rarity = 6}, + {items = {'farming:seed_barley'}, rarity = 5}, + {items = {'farming:seed_rye'},rarity = 5}, {items = {'default:dry_grass_1'}}, } }, @@ -37,6 +39,7 @@ minetest.override_item("default:junglegrass", { max_items = 1, items = { {items = {'farming:seed_cotton'}, rarity = 8}, + {items = {'farming:seed_rice'},rarity = 8}, {items = {'default:junglegrass'}}, } }, diff --git a/hoes.lua b/hoes.lua index 633e6f0..ed833e5 100644 --- a/hoes.lua +++ b/hoes.lua @@ -330,3 +330,169 @@ minetest.register_craftitem("farming:hoe_bomb", { end end, }) + +-- Mithril Scythe (special item) + +farming.scythe_not_drops = {"farming:trellis", "farming:beanpole"} + +farming.add_to_scythe_not_drops = function(item) + table.insert(farming.scythe_not_drops, item) +end + +minetest.register_tool("farming:scythe_mithril", { + description = S("Mithril Scythe (Right-click crop to harvest and replant)"), + 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) + + if pointed_thing.type ~= "node" then + return + end + + local pos = pointed_thing.under + local name = placer:get_player_name() + + if minetest.is_protected(pos, name) then + return + end + + local node = minetest.get_node_or_nil(pos) + + if not node then + return + end + + local def = minetest.registered_nodes[node.name] + + if not def then + return + end + + if not def.drop then + return + end + + if not def.groups + or not def.groups.plant then + return + end + + local drops = minetest.get_node_drops(node.name, "") + + if not drops + or #drops == 0 + or (#drops == 1 and drops[1] == "") then + return + end + + -- get crop name + local mname = node.name:split(":")[1] + local pname = node.name:split(":")[2] + local sname = tonumber(pname:split("_")[2]) + pname = pname:split("_")[1] + + if not sname then + return + end + + -- add dropped items + for _, dropped_item in pairs(drops) do + + -- dont drop items on this list + for _, not_item in pairs(farming.scythe_not_drops) do + + if dropped_item == not_item then + dropped_item = nil + end + end + + if dropped_item then + + local obj = minetest.add_item(pos, dropped_item) + + if obj then + + obj:set_velocity({ + x = math.random(-10, 10) / 9, + y = 3, + z = math.random(-10, 10) / 9, + }) + end + end + end + + -- Run script hook + for _, callback in pairs(core.registered_on_dignodes) do + callback(pos, node, placer) + end + + -- play sound + minetest.sound_play("default_grass_footstep", {pos = pos, gain = 1.0}) + + local replace = mname .. ":" .. pname .. "_1" + + if minetest.registered_nodes[replace] then + + local p2 = minetest.registered_nodes[replace].place_param2 or 1 + + minetest.set_node(pos, {name = replace, param2 = p2}) + else + minetest.set_node(pos, {name = "air"}) + end + + if not farming.is_creative(name) then + + itemstack:add_wear(65535 / 150) -- 150 uses + + return itemstack + end + end, +}) + +if minetest.get_modpath("moreores") then + + minetest.register_craft({ + output = "farming:scythe_mithril", + recipe = { + {"", "moreores:mithril_ingot", "moreores:mithril_ingot"}, + {"moreores:mithril_ingot", "", "group:stick"}, + {"", "", "group:stick"} + } + }) + + farming.register_hoe(":moreores:hoe_silver", { + description = S("%s Hoe"):format(S("Silver")), + inventory_image = "moreores_tool_silverhoe.png", + max_uses = 300, + material = "moreores:silver_ingot", + }) + + farming.register_hoe(":moreores:hoe_mithril", { + description = S("%s Hoe"):format(S("Mithril")), + inventory_image = "moreores_tool_mithrilhoe.png", + max_uses = 1000, + material = "moreores:mithril_ingot", + }) + + -- Toolranks support + if tr then + + minetest.override_item("moreores:hoe_silver", { + original_description = S("%s Hoe"):format(S("Silver")), + description = toolranks.create_description("Silver Hoe")}) + + minetest.override_item("moreores:hoe_mithril", { + original_description = S("%s Hoe"):format(S("Mithril")), + description = toolranks.create_description("Mithril Hoe")}) + end +end diff --git a/init.lua b/init.lua index b952b12..2686dbd 100644 --- a/init.lua +++ b/init.lua @@ -7,7 +7,7 @@ farming = { mod = "redo", - version = "20180929", + version = "20190427", path = minetest.get_modpath("farming"), select = { type = "fixed", @@ -322,14 +322,14 @@ function farming.plant_growth_timer(pos, elapsed, node_name) end local growth - local light_pos = {x = pos.x, y = pos.y, z = pos.z} -- was y + 1 + local light_pos = {x = pos.x, y = pos.y, z = pos.z} local lambda = elapsed / STAGE_LENGTH_AVG if lambda < 0.1 then return true end - local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 13 + local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 12 local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or 15 --print ("---", MIN_LIGHT, MAX_LIGHT) @@ -457,6 +457,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) minetest.set_node(pt.above, {name = plantname, param2 = p2}) --minetest.get_node_timer(pt.above):start(1) +--farming.handle_growth(pt.above)--, node) minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) @@ -496,7 +497,7 @@ farming.register_plant = function(name, def) -- Check def def.description = def.description or S("Seed") def.inventory_image = def.inventory_image or "unknown_item.png" - def.minlight = def.minlight or 13 + def.minlight = def.minlight or 12 def.maxlight = def.maxlight or 15 -- Register seed @@ -591,37 +592,38 @@ farming.registered_plants[mname .. ":" .. pname] = { minlight = def.minlight, maxlight = def.maxlight } -print(dump(farming.registered_plants[mname .. ":" .. pname])) +--print(dump(farming.registered_plants[mname .. ":" .. pname])) -- Return info return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname} end -- default settings -farming.carrot = true -farming.potato = true -farming.tomato = true -farming.cucumber = true -farming.corn = true -farming.coffee = true -farming.melon = true -farming.pumpkin = true +farming.carrot = 0.001 +farming.potato = 0.001 +farming.tomato = 0.001 +farming.cucumber = 0.001 +farming.corn = 0.001 +farming.coffee = 0.001 +farming.melon = 0.001 +farming.pumpkin = 0.001 farming.cocoa = true -farming.raspberry = true -farming.blueberry = true -farming.rhubarb = true -farming.beans = true -farming.grapes = true +farming.raspberry = 0.001 +farming.blueberry = 0.001 +farming.rhubarb = 0.001 +farming.beans = 0.001 +farming.grapes = 0.001 farming.barley = true -farming.chili = true -farming.hemp = true -farming.garlic = true -farming.onion = true -farming.pepper = true -farming.pineapple = true -farming.peas = true -farming.beetroot = true -farming.rarety = 0.002 -- 0.006 +farming.chili = 0.002 +farming.hemp = 0.002 +farming.garlic = 0.001 +farming.onion = 0.001 +farming.pepper = 0.002 +farming.pineapple = 0.001 +farming.peas = 0.001 +farming.beetroot = 0.001 +farming.grains = true +farming.rarety = 0.002 -- Load new global settings if found inside mod folder @@ -629,16 +631,14 @@ local input = io.open(farming.path.."/farming.conf", "r") if input then dofile(farming.path .. "/farming.conf") input:close() - input = nil end -- load new world-specific settings if found inside world folder local worldpath = minetest.get_worldpath() -local input = io.open(worldpath.."/farming.conf", "r") +input = io.open(worldpath.."/farming.conf", "r") if input then dofile(worldpath .. "/farming.conf") input:close() - input = nil end @@ -685,6 +685,7 @@ ddoo("pineapple.lua", farming.pineapple) ddoo("peas.lua", farming.peas) ddoo("beetroot.lua", farming.beetroot) ddoo("chili.lua", farming.chili) +ddoo("ryeoatrice.lua", farming.grains) dofile(farming.path.."/food.lua") dofile(farming.path.."/mapgen.lua") diff --git a/license.txt b/license.txt index b7bb7a9..8584871 100644 --- a/license.txt +++ b/license.txt @@ -23,7 +23,7 @@ THE SOFTWARE. License of media (textures): ---------------------------- -Created by PilzAdam (License: WTFPL): +Created by PilzAdam (License: CC BY 3.0): farming_bread.png farming_soil.png farming_soil_wet.png @@ -41,7 +41,7 @@ Created by Calinou (License: CC BY-SA): farming_tool_mesehoe.png farming_tool_diamondhoe.png -Created by VanessaE (License: WTFPL): +Created by VanessaE (License: CC BY 3.0): farming_cotton_seed.png farming_wheat_seed.png farming_flour.png @@ -63,7 +63,7 @@ Created by VanessaE (License: WTFPL): farming_cotton_7.png farming_cotton_8.png -Created by Doc (License: WTFPL): +Created by Doc (License: CC BY 3.0): farming_cucumber.png farming_cucumber_1.png farming_cucumber_2.png @@ -80,7 +80,7 @@ Created by Doc (License: WTFPL): farming_raspberry_3.png farming_raspberry_4.png -Created by Gambit: +Created by Gambit (License: CC BY 3.0): default_junglegrass.png farming_carrot.png farming_carrot_1.png @@ -92,7 +92,7 @@ Created by Gambit: farming_carrot_7.png farming_carrot_8.png -Created by JoseTheCrafter and edited by TenPlus1: +Created by JoseTheCrafter and edited by TenPlus1 (CC BY 3.0): farming_tomato.png farming_tomato_1.png farming_tomato_2.png @@ -103,7 +103,7 @@ Created by JoseTheCrafter and edited by TenPlus1: farming_tomato_7.png farming_tomato_8.png -Created by GeMinecraft and edited by TenPlus1: +Created by GeMinecraft and edited by TenPlus1 (CC BY 3.0): farming_corn.png farming_corn_cob.png farming_corn_1.png @@ -115,7 +115,7 @@ Created by GeMinecraft and edited by TenPlus1: farming_corn_7.png farming_corn_8.png -Created by TenPlus1 +Created by TenPlus1 (CC BY 3.0) farming_cocoa_1.png farming_cocoa_2.png farming_cocoa_3.png @@ -128,3 +128,17 @@ Created by TenPlus1 farming_rhubarb.png farming_rhubarb_pie.png farming_hemp*.png + +Created by ademant (CC-BY-3.0) + farming_rye*.png + farming_oat*.png + farming_rice*.png + +Created by PilzAdam and edited by SpaghettiToastBook (CC0): + farming_bread_multigrain.png + +Created by VanessaE and edited by SpaghettiToastBook (CC0): + farming_flour_multigrain.png + +Created by mDiyo (Natura), modified by TenPlus1 (License: CC BY-SA 3.0): + farming_barley.png diff --git a/lucky_block.lua b/lucky_block.lua index 6f656ff..5a69a68 100644 --- a/lucky_block.lua +++ b/lucky_block.lua @@ -34,6 +34,7 @@ if minetest.get_modpath("lucky_block") then {"dro", {"farming:hoe_bomb"}, 10}, {"dro", {"farming:turkish_delight"}, 5}, {"lig"}, + {"dro", {"farming:scythe_mithril"}, 1}, {"sch", "instafarm", 0, true, { {"farming:wheat_8", "farming:carrot_8"}, {"farming:cotton_8", "farming:rhubarb_3"}, @@ -67,6 +68,9 @@ if minetest.get_modpath("lucky_block") then {name = "farming:seed_barley", max = 15}, {name = "farming:seed_barley", max = 15}, {name = "farming:seed_hemp", max = 15}, + {name = "farming:seed_rye", max = 15}, + {name = "farming:seed_rice", max = 15}, + {name = "farming:seed_oat", max = 15}, {name = "farming:soil_wet", max = 10}, }}, }) diff --git a/mapgen.lua b/mapgen.lua index 2554a15..6d8278d 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -1,18 +1,22 @@ -- decoration function -local function register_plant(name, min, max, spawnon, spawnby, num, enabled) +local function register_plant(name, min, max, spawnon, spawnby, num, rarety) - if enabled ~= true then + -- do not place on mapgen if no value given (or not true) + if not rarety then return end + -- set rarety value or default to farming.rarety if not a number + rarety = tonumber(rarety) or farming.rarety + minetest.register_decoration({ deco_type = "simple", place_on = spawnon or {"default:dirt_with_grass"}, sidelen = 16, noise_params = { offset = 0, - scale = farming.rarety, -- 0.006, + scale = rarety, spread = {x = 100, y = 100, z = 100}, seed = 329, octaves = 3, @@ -55,7 +59,7 @@ else 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) + "default:dirt_with_rainforest_litter"}, "", -1, farming.melon) register_plant("pumpkin_8", 1, 6, nil, "", -1, farming.pumpkin) end @@ -66,7 +70,7 @@ minetest.register_decoration({ sidelen = 16, noise_params = { offset = 0, - scale = farming.rarety, -- 0.06, + scale = tonumber(farming.hemp) or farming.rarety, spread = {x = 100, y = 100, z = 100}, seed = 420, octaves = 3, @@ -87,7 +91,7 @@ minetest.register_decoration({ sidelen = 16, noise_params = { offset = 0, - scale = farming.rarety, -- 0.06, + scale = tonumber(farming.chili) or farming.rarety, spread = {x = 100, y = 100, z = 100}, seed = 760, octaves = 3, @@ -108,7 +112,7 @@ minetest.register_decoration({ sidelen = 16, noise_params = { offset = 0, - scale = farming.rarety, -- 0.06, + scale = tonumber(farming.pepper) or farming.rarety, spread = {x = 100, y = 100, z = 100}, seed = 933, octaves = 3, @@ -129,7 +133,7 @@ minetest.register_decoration({ sidelen = 16, noise_params = { offset = 0, - scale = farming.rarety, -- 0.06, + scale = tonumber(farming.pineapple) or farming.rarety, spread = {x = 100, y = 100, z = 100}, seed = 917, octaves = 3, diff --git a/soil.lua b/soil.lua index 0b4844a..6e27d47 100644 --- a/soil.lua +++ b/soil.lua @@ -52,7 +52,14 @@ minetest.register_abm({ end -- check if there is water nearby and change soil accordingly - if minetest.find_node_near(pos, 3, {"group:water"}) then +-- if minetest.find_node_near(pos, 3, {"group:water"}) then + + -- check if water is within 3 nodes horizontally and 2 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 , z = pos.z - 3}, + {"group:water"}) > 0 then + if node.name == "farming:soil" then minetest.set_node(pos, {name = "farming:soil_wet"}) end @@ -64,4 +71,4 @@ minetest.register_abm({ minetest.set_node(pos, {name = "default:dirt"}) end end, -}) \ No newline at end of file +}) diff --git a/textures/farming_bread_multigrain.png b/textures/farming_bread_multigrain.png new file mode 100644 index 0000000..66dda07 Binary files /dev/null and b/textures/farming_bread_multigrain.png differ diff --git a/textures/farming_flour_multigrain.png b/textures/farming_flour_multigrain.png new file mode 100644 index 0000000..5367bc5 Binary files /dev/null and b/textures/farming_flour_multigrain.png differ diff --git a/textures/farming_jaffa_cake.png b/textures/farming_jaffa_cake.png new file mode 100644 index 0000000..87cc003 Binary files /dev/null and b/textures/farming_jaffa_cake.png differ diff --git a/textures/farming_oat.png b/textures/farming_oat.png new file mode 100644 index 0000000..e8d5c23 Binary files /dev/null and b/textures/farming_oat.png differ diff --git a/textures/farming_oat_1.png b/textures/farming_oat_1.png new file mode 100644 index 0000000..177fbdf Binary files /dev/null and b/textures/farming_oat_1.png differ diff --git a/textures/farming_oat_2.png b/textures/farming_oat_2.png new file mode 100644 index 0000000..fe051ea Binary files /dev/null and b/textures/farming_oat_2.png differ diff --git a/textures/farming_oat_3.png b/textures/farming_oat_3.png new file mode 100644 index 0000000..5aba108 Binary files /dev/null and b/textures/farming_oat_3.png differ diff --git a/textures/farming_oat_4.png b/textures/farming_oat_4.png new file mode 100644 index 0000000..833b134 Binary files /dev/null and b/textures/farming_oat_4.png differ diff --git a/textures/farming_oat_5.png b/textures/farming_oat_5.png new file mode 100644 index 0000000..ec0803b Binary files /dev/null and b/textures/farming_oat_5.png differ diff --git a/textures/farming_oat_6.png b/textures/farming_oat_6.png new file mode 100644 index 0000000..847adc5 Binary files /dev/null and b/textures/farming_oat_6.png differ diff --git a/textures/farming_oat_7.png b/textures/farming_oat_7.png new file mode 100644 index 0000000..3552811 Binary files /dev/null and b/textures/farming_oat_7.png differ diff --git a/textures/farming_oat_8.png b/textures/farming_oat_8.png new file mode 100644 index 0000000..c7a5540 Binary files /dev/null and b/textures/farming_oat_8.png differ diff --git a/textures/farming_oat_seed.png b/textures/farming_oat_seed.png new file mode 100644 index 0000000..893c93c Binary files /dev/null and b/textures/farming_oat_seed.png differ diff --git a/textures/farming_rice.png b/textures/farming_rice.png new file mode 100644 index 0000000..3d64c7e Binary files /dev/null and b/textures/farming_rice.png differ diff --git a/textures/farming_rice_1.png b/textures/farming_rice_1.png new file mode 100644 index 0000000..715bb2e Binary files /dev/null and b/textures/farming_rice_1.png differ diff --git a/textures/farming_rice_2.png b/textures/farming_rice_2.png new file mode 100644 index 0000000..2662d42 Binary files /dev/null and b/textures/farming_rice_2.png differ diff --git a/textures/farming_rice_3.png b/textures/farming_rice_3.png new file mode 100644 index 0000000..fee87b2 Binary files /dev/null and b/textures/farming_rice_3.png differ diff --git a/textures/farming_rice_4.png b/textures/farming_rice_4.png new file mode 100644 index 0000000..97b026f Binary files /dev/null and b/textures/farming_rice_4.png differ diff --git a/textures/farming_rice_5.png b/textures/farming_rice_5.png new file mode 100644 index 0000000..c249851 Binary files /dev/null and b/textures/farming_rice_5.png differ diff --git a/textures/farming_rice_6.png b/textures/farming_rice_6.png new file mode 100644 index 0000000..c0e7233 Binary files /dev/null and b/textures/farming_rice_6.png differ diff --git a/textures/farming_rice_7.png b/textures/farming_rice_7.png new file mode 100644 index 0000000..9d251ee Binary files /dev/null and b/textures/farming_rice_7.png differ diff --git a/textures/farming_rice_8.png b/textures/farming_rice_8.png new file mode 100644 index 0000000..41b37e0 Binary files /dev/null and b/textures/farming_rice_8.png differ diff --git a/textures/farming_rice_bread.png b/textures/farming_rice_bread.png new file mode 100644 index 0000000..f14f741 Binary files /dev/null and b/textures/farming_rice_bread.png differ diff --git a/textures/farming_rice_flour.png b/textures/farming_rice_flour.png new file mode 100644 index 0000000..2722151 Binary files /dev/null and b/textures/farming_rice_flour.png differ diff --git a/textures/farming_rice_seed.png b/textures/farming_rice_seed.png new file mode 100644 index 0000000..854cd05 Binary files /dev/null and b/textures/farming_rice_seed.png differ diff --git a/textures/farming_rye.png b/textures/farming_rye.png new file mode 100644 index 0000000..ebc5b37 Binary files /dev/null and b/textures/farming_rye.png differ diff --git a/textures/farming_rye_1.png b/textures/farming_rye_1.png new file mode 100644 index 0000000..932b621 Binary files /dev/null and b/textures/farming_rye_1.png differ diff --git a/textures/farming_rye_2.png b/textures/farming_rye_2.png new file mode 100644 index 0000000..b6a69b7 Binary files /dev/null and b/textures/farming_rye_2.png differ diff --git a/textures/farming_rye_3.png b/textures/farming_rye_3.png new file mode 100644 index 0000000..aaa71c2 Binary files /dev/null and b/textures/farming_rye_3.png differ diff --git a/textures/farming_rye_4.png b/textures/farming_rye_4.png new file mode 100644 index 0000000..ea1246e Binary files /dev/null and b/textures/farming_rye_4.png differ diff --git a/textures/farming_rye_5.png b/textures/farming_rye_5.png new file mode 100644 index 0000000..b359673 Binary files /dev/null and b/textures/farming_rye_5.png differ diff --git a/textures/farming_rye_6.png b/textures/farming_rye_6.png new file mode 100644 index 0000000..749a2ef Binary files /dev/null and b/textures/farming_rye_6.png differ diff --git a/textures/farming_rye_7.png b/textures/farming_rye_7.png new file mode 100644 index 0000000..fc78198 Binary files /dev/null and b/textures/farming_rye_7.png differ diff --git a/textures/farming_rye_8.png b/textures/farming_rye_8.png new file mode 100644 index 0000000..0b7c33e Binary files /dev/null and b/textures/farming_rye_8.png differ diff --git a/textures/farming_rye_seed.png b/textures/farming_rye_seed.png new file mode 100644 index 0000000..e65ba9b Binary files /dev/null and b/textures/farming_rye_seed.png differ diff --git a/textures/farming_scythe_mithril.png b/textures/farming_scythe_mithril.png new file mode 100644 index 0000000..17c89c5 Binary files /dev/null and b/textures/farming_scythe_mithril.png differ