Merge branch 'master' into nalc-1.2

This commit is contained in:
Sys Quatre 2019-05-09 21:40:50 +02:00
commit 19577a3917
56 changed files with 509 additions and 80 deletions

View File

@ -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

View File

@ -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)

View File

@ -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,
})

View File

@ -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()
}

View File

@ -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({

View File

@ -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()
}

View File

@ -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({

View File

@ -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

View File

@ -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,

View File

@ -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({

162
crops/ryeoatrice.lua Normal file
View File

@ -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,
})

View File

@ -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

View File

@ -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"}
}
})

View File

@ -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'}},
}
},

166
hoes.lua
View File

@ -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

View File

@ -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")

View File

@ -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

View File

@ -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},
}},
})

View File

@ -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,

View File

@ -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,
})
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

BIN
textures/farming_oat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

BIN
textures/farming_oat_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

BIN
textures/farming_oat_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

BIN
textures/farming_oat_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
textures/farming_oat_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 190 B

BIN
textures/farming_oat_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

BIN
textures/farming_oat_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

BIN
textures/farming_oat_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

BIN
textures/farming_oat_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

BIN
textures/farming_rice.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

BIN
textures/farming_rice_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

BIN
textures/farming_rice_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

BIN
textures/farming_rice_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
textures/farming_rice_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

BIN
textures/farming_rice_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

BIN
textures/farming_rice_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

BIN
textures/farming_rice_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

BIN
textures/farming_rice_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
textures/farming_rye.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

BIN
textures/farming_rye_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

BIN
textures/farming_rye_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

BIN
textures/farming_rye_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

BIN
textures/farming_rye_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

BIN
textures/farming_rye_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

BIN
textures/farming_rye_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

BIN
textures/farming_rye_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

BIN
textures/farming_rye_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B