Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Sys Quatre 2020-12-15 23:26:24 +01:00
commit 11b79dffd2
77 changed files with 625 additions and 104 deletions

View File

@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t
### Changelog: ### Changelog:
- 1.46 - Added min/max default light settings, added lettuce and blackberries with food items (thanks OgelGames), added soya and vanilla (thanks Felfa), added tofu
- 1.45 - Dirt and Hoes are more in line with default by using dry/wet/base, added cactus juice, added pasta, spaghetti, cabbage, korean bibimbap, code tidy - 1.45 - Dirt and Hoes are more in line with default by using dry/wet/base, added cactus juice, added pasta, spaghetti, cabbage, korean bibimbap, code tidy
options, onion soup added (thanks edcrypt), Added apple pie, added wild cotton to savanna options, onion soup added (thanks edcrypt), Added apple pie, added wild cotton to savanna
- 1.44 - Added 'farming_stage_length' in mod settings for speed of crop growth, also thanks to TheDarkTiger for translation updates - 1.44 - Added 'farming_stage_length' in mod settings for speed of crop growth, also thanks to TheDarkTiger for translation updates

View File

@ -108,8 +108,8 @@ minetest.register_node("farming:barley_7", table.copy(def))
farming.registered_plants["farming:barley"] = { farming.registered_plants["farming:barley"] = {
crop = "farming:barley", crop = "farming:barley",
seed = "farming:seed_barley", seed = "farming:seed_barley",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 7 steps = 7
} }

View File

@ -226,8 +226,8 @@ minetest.register_node("farming:beanpole_5", table.copy(def))
farming.registered_plants["farming:beans"] = { farming.registered_plants["farming:beans"] = {
crop = "farming:beanpole", crop = "farming:beanpole",
seed = "farming:beans", seed = "farming:beans",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 5 steps = 5
} }

View File

@ -86,7 +86,7 @@ minetest.register_node("farming:beetroot_5", table.copy(def))
farming.registered_plants["farming:beetroot"] = { farming.registered_plants["farming:beetroot"] = {
crop = "farming:beetroot", crop = "farming:beetroot",
seed = "farming:beetroot", seed = "farming:beetroot",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 5 steps = 5
} }

62
crops/blackberry.lua Normal file
View File

@ -0,0 +1,62 @@
local S = farming.intllib
-- blackberries
minetest.register_craftitem("farming:blackberry", {
description = S("Blackberries"),
inventory_image = "farming_blackberry.png",
groups = {seed = 2, food_blackberries = 1, food_blackberry = 1,
food_berry = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:blackberry_1")
end,
on_use = minetest.item_eat(1),
})
local def = {
drawtype = "plantlike",
tiles = {"farming_blackberry_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:blackberry_1", table.copy(def))
-- stage 2
def.tiles = {"farming_blackberry_2.png"}
minetest.register_node("farming:blackberry_2", table.copy(def))
-- stage 3
def.tiles = {"farming_blackberry_3.png"}
minetest.register_node("farming:blackberry_3", table.copy(def))
-- stage 4
def.tiles = {"farming_blackberry_4.png"}
def.groups.growing = nil
def.drop = {
items = {
{items = {'farming:blackberry 2'}, rarity = 1},
{items = {'farming:blackberry'}, rarity = 2},
{items = {'farming:blackberry'}, rarity = 3},
}
}
minetest.register_node("farming:blackberry_4", table.copy(def))
-- add to registered_plants
farming.registered_plants["farming:blackberry"] = {
crop = "farming:blackberry",
seed = "farming:blackberry",
minlight = farming.min_light,
maxlight = farming.max_light,
steps = 4
}

View File

@ -88,7 +88,7 @@ minetest.register_node("farming:blueberry_4", table.copy(def))
farming.registered_plants["farming:blueberries"] = { farming.registered_plants["farming:blueberries"] = {
crop = "farming:blueberry", crop = "farming:blueberry",
seed = "farming:blueberries", seed = "farming:blueberries",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 4 steps = 4
} }

View File

@ -53,8 +53,8 @@ def.tiles = {"farming_cabbage_6.png"}
def.groups.growing = nil def.groups.growing = nil
def.drop = { def.drop = {
max_items = 2, items = { max_items = 2, items = {
{items = {"farming:cabbage"}, rarity = 1}, {items = {"farming:cabbage 2"}, rarity = 1},
{items = {"farming:cabbage"}, rarity = 2} {items = {"farming:cabbage 1"}, rarity = 2}
} }
} }
minetest.register_node("farming:cabbage_6", table.copy(def)) minetest.register_node("farming:cabbage_6", table.copy(def))
@ -63,7 +63,7 @@ minetest.register_node("farming:cabbage_6", table.copy(def))
farming.registered_plants["farming:cabbage"] = { farming.registered_plants["farming:cabbage"] = {
crop = "farming:cabbage", crop = "farming:cabbage",
seed = "farming:cabbage", seed = "farming:cabbage",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 6 steps = 6
} }

View File

@ -118,7 +118,7 @@ minetest.register_node("farming:carrot_8", table.copy(def))
farming.registered_plants["farming:carrot"] = { farming.registered_plants["farming:carrot"] = {
crop = "farming:carrot", crop = "farming:carrot",
seed = "farming:carrot", seed = "farming:carrot",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

View File

@ -95,7 +95,7 @@ minetest.register_node("farming:chili_8", table.copy(def))
farming.registered_plants["farming:chili_pepper"] = { farming.registered_plants["farming:chili_pepper"] = {
crop = "farming:chili", crop = "farming:chili",
seed = "farming:chili_pepper", seed = "farming:chili_pepper",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

View File

@ -194,8 +194,8 @@ minetest.register_node("farming:cocoa_4", table.copy(def))
farming.registered_plants["farming:cocoa_beans"] = { farming.registered_plants["farming:cocoa_beans"] = {
crop = "farming:cocoa", crop = "farming:cocoa",
seed = "farming:cocoa_beans", seed = "farming:cocoa_beans",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 4 steps = 4
} }

View File

@ -106,7 +106,7 @@ minetest.register_node("farming:coffee_5", table.copy(def))
farming.registered_plants["farming:coffee"] = { farming.registered_plants["farming:coffee"] = {
crop = "farming:coffee", crop = "farming:coffee",
seed = "farming:coffee_beans", seed = "farming:coffee_beans",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 5 steps = 5
} }

View File

@ -153,7 +153,7 @@ minetest.register_node("farming:corn_8", table.copy(def))
farming.registered_plants["farming:corn"] = { farming.registered_plants["farming:corn"] = {
crop = "farming:corn", crop = "farming:corn",
seed = "farming:corn", seed = "farming:corn",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

View File

@ -172,8 +172,8 @@ minetest.register_node("farming:cotton_8", table.copy(def))
farming.registered_plants["farming:cotton"] = { farming.registered_plants["farming:cotton"] = {
crop = "farming:cotton", crop = "farming:cotton",
seed = "farming:seed_cotton", seed = "farming:seed_cotton",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

View File

@ -59,7 +59,7 @@ minetest.register_node("farming:cucumber_4", table.copy(def))
farming.registered_plants["farming:cucumber"] = { farming.registered_plants["farming:cucumber"] = {
crop = "farming:cucumber", crop = "farming:cucumber",
seed = "farming:cucumber", seed = "farming:cucumber",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 4 steps = 4
} }

View File

@ -129,7 +129,7 @@ minetest.register_node("farming:garlic_5", table.copy(def))
farming.registered_plants["farming:garlic"] = { farming.registered_plants["farming:garlic"] = {
crop = "farming:garlic", crop = "farming:garlic",
seed = "farming:garlic_clove", seed = "farming:garlic_clove",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 5 steps = 5
} }

View File

@ -233,8 +233,8 @@ minetest.register_node("farming:grapes_8", table.copy(def))
farming.registered_plants["farming:grapes"] = { farming.registered_plants["farming:grapes"] = {
crop = "farming:grapes", crop = "farming:grapes",
seed = "farming:grapes", seed = "farming:grapes",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

View File

@ -256,7 +256,7 @@ minetest.register_node("farming:hemp_8", table.copy(def))
farming.registered_plants["farming:hemp"] = { farming.registered_plants["farming:hemp"] = {
crop = "farming:hemp", crop = "farming:hemp",
seed = "farming:seed_hemp", seed = "farming:seed_hemp",
minlight = 13, mminlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

63
crops/lettuce.lua Normal file
View File

@ -0,0 +1,63 @@
local S = farming.intllib
-- lettuce
minetest.register_craftitem("farming:lettuce", {
description = S("Lettuce"),
inventory_image = "farming_lettuce.png",
groups = {seed = 2, food_lettuce = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:lettuce_1")
end,
on_use = minetest.item_eat(2),
})
local def = {
drawtype = "plantlike",
tiles = {"farming_lettuce_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:lettuce_1", table.copy(def))
-- stage 2
def.tiles = {"farming_lettuce_2.png"}
minetest.register_node("farming:lettuce_2", table.copy(def))
-- stage 3
def.tiles = {"farming_lettuce_3.png"}
minetest.register_node("farming:lettuce_3", table.copy(def))
-- stage 4
def.tiles = {"farming_lettuce_4.png"}
minetest.register_node("farming:lettuce_4", table.copy(def))
-- stage 5
def.tiles = {"farming_lettuce_5.png"}
def.groups.growing = nil
def.drop = {
items = {
{items = {'farming:lettuce 2'}, rarity = 1},
{items = {'farming:lettuce 1'}, rarity = 2},
}
}
minetest.register_node("farming:lettuce_5", table.copy(def))
-- add to registered_plants
farming.registered_plants["farming:lettuce"] = {
crop = "farming:lettuce",
seed = "farming:lettuce",
minlight = farming.min_light,
maxlight = farming.max_light,
steps = 5
}

View File

@ -88,7 +88,7 @@ minetest.register_node("farming:melon_8", table.copy(def))
farming.registered_plants["farming:melon"] = { farming.registered_plants["farming:melon"] = {
crop = "farming:melon", crop = "farming:melon",
seed = "farming:melon_slice", seed = "farming:melon_slice",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

View File

@ -101,7 +101,7 @@ minetest.register_node("farming:mint_4", table.copy(def))
farming.registered_plants["farming:mint"] = { farming.registered_plants["farming:mint"] = {
crop = "farming:mint", crop = "farming:mint",
seed = "farming:seed_mint", seed = "farming:seed_mint",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 4 steps = 4
} }

View File

@ -90,7 +90,7 @@ minetest.register_node("farming:onion_5", table.copy(def))
farming.registered_plants["farming:onion"] = { farming.registered_plants["farming:onion"] = {
crop = "farming:onion", crop = "farming:onion",
seed = "farming:onion", seed = "farming:onion",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 5 steps = 5
} }

View File

@ -91,7 +91,7 @@ minetest.register_node("farming:pea_5", table.copy(def))
farming.registered_plants["farming:pea_pod"] = { farming.registered_plants["farming:pea_pod"] = {
crop = "farming:pea", crop = "farming:pea",
seed = "farming:pea_pod", seed = "farming:pea_pod",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 5 steps = 5
} }

View File

@ -19,16 +19,32 @@ minetest.register_craftitem("farming:peppercorn", {
-- green pepper -- green pepper
minetest.register_craftitem("farming:pepper", { minetest.register_craftitem("farming:pepper", {
description = S("Pepper"), description = S("Green Pepper"),
inventory_image = "crops_pepper.png", inventory_image = "crops_pepper.png",
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
groups = {food_pepper = 1, flammable = 3} groups = {food_pepper = 1, flammable = 3}
}) })
-- yellow pepper
minetest.register_craftitem("farming:pepper_yellow", {
description = S("Yellow Pepper"),
inventory_image = "crops_pepper_yellow.png",
on_use = minetest.item_eat(3),
groups = {food_pepper = 1, flammable = 3},
})
-- red pepper
minetest.register_craftitem("farming:pepper_red", {
description = S("Red Pepper"),
inventory_image = "crops_pepper_red.png",
on_use = minetest.item_eat(4),
groups = {food_pepper = 1, flammable = 3},
})
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = "farming:peppercorn", output = "farming:peppercorn",
recipe = {"farming:pepper"} recipe = {"group:food_pepper"}
}) })
-- ground pepper -- ground pepper
@ -93,11 +109,10 @@ minetest.register_node("farming:pepper_3", table.copy(def))
def.tiles = {"crops_pepper_plant_4.png"} def.tiles = {"crops_pepper_plant_4.png"}
minetest.register_node("farming:pepper_4", table.copy(def)) minetest.register_node("farming:pepper_4", table.copy(def))
-- stage 5 -- stage 5 (green pepper)
def.tiles = {"crops_pepper_plant_5.png"} def.tiles = {"crops_pepper_plant_5.png"}
def.groups.growing = 0
def.drop = { def.drop = {
items = { max_items = 2, items = {
{items = {"farming:pepper 2"}, rarity = 1}, {items = {"farming:pepper 2"}, rarity = 1},
{items = {"farming:pepper"}, rarity = 2}, {items = {"farming:pepper"}, rarity = 2},
{items = {"farming:pepper"}, rarity = 3} {items = {"farming:pepper"}, rarity = 3}
@ -105,11 +120,34 @@ def.drop = {
} }
minetest.register_node("farming:pepper_5", table.copy(def)) minetest.register_node("farming:pepper_5", table.copy(def))
-- stage 6 (yellow pepper)
def.tiles = {"crops_pepper_plant_6.png"}
def.drop = {
max_items = 2, items = {
{items = {'farming:pepper_yellow 2'}, rarity = 1},
{items = {'farming:pepper_yellow'}, rarity = 2},
{items = {'farming:pepper_yellow'}, rarity = 3},
}
}
minetest.register_node("farming:pepper_6", table.copy(def))
-- stage 7 (red pepper)
def.tiles = {"crops_pepper_plant_7.png"}
def.groups.growing = nil
def.drop = {
max_items = 2, items = {
{items = {'farming:pepper_red 2'}, rarity = 1},
{items = {'farming:pepper_red'}, rarity = 2},
{items = {'farming:pepper_red'}, rarity = 3},
}
}
minetest.register_node("farming:pepper_7", table.copy(def))
-- add to registered_plants -- add to registered_plants
farming.registered_plants["farming:pepper"] = { farming.registered_plants["farming:pepper"] = {
crop = "farming:pepper", crop = "farming:pepper",
seed = "farming:peppercorn", seed = "farming:peppercorn",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 5 steps = 5
} }

View File

@ -135,7 +135,7 @@ minetest.register_node("farming:pineapple_8", table.copy(def))
farming.registered_plants["farming:pineapple"] = { farming.registered_plants["farming:pineapple"] = {
crop = "farming:pineapple", crop = "farming:pineapple",
seed = "farming:pineapple_top", seed = "farming:pineapple_top",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

View File

@ -106,7 +106,7 @@ minetest.register_node("farming:potato_4", table.copy(def))
farming.registered_plants["farming:potato"] = { farming.registered_plants["farming:potato"] = {
crop = "farming:potato", crop = "farming:potato",
seed = "farming:potato", seed = "farming:potato",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 4 steps = 4
} }

View File

@ -200,7 +200,7 @@ minetest.register_alias("farming:pumpkin", "farming:pumpkin_8")
farming.registered_plants["farming:pumpkin"] = { farming.registered_plants["farming:pumpkin"] = {
crop = "farming:pumpkin", crop = "farming:pumpkin",
seed = "farming:pumpkin_slice", seed = "farming:pumpkin_slice",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

View File

@ -74,7 +74,7 @@ minetest.register_node("farming:raspberry_4", table.copy(def))
farming.registered_plants["farming:raspberries"] = { farming.registered_plants["farming:raspberries"] = {
crop = "farming:raspberry", crop = "farming:raspberry",
seed = "farming:raspberries", seed = "farming:raspberries",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 4 steps = 4
} }

View File

@ -71,7 +71,7 @@ minetest.register_node("farming:rhubarb_3", table.copy(def))
farming.registered_plants["farming:rhubarb"] = { farming.registered_plants["farming:rhubarb"] = {
crop = "farming:rhubarb", crop = "farming:rhubarb",
seed = "farming:rhubarb", seed = "farming:rhubarb",
minlight = 13, minlight = 10,
maxlight = 15, maxlight = 12,
steps = 3 steps = 3
} }

171
crops/soy.lua Normal file
View File

@ -0,0 +1,171 @@
local S = farming.intllib
-- soy pod
minetest.register_craftitem("farming:soy_pod", {
description = S("Soy Pod"),
inventory_image = "farming_soy_pod.png",
groups = {seed = 2, food_soy_pod = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:soy_1")
end
})
minetest.register_craftitem("farming:soy_beans", {
description = S("Soy Beans"),
inventory_image = "farming_soy_beans.png",
groups = {food_soy = 1, flammable = 2},
on_use = minetest.item_eat(1)
})
minetest.register_craft({
type = "shapeless",
output = "farming:soy_beans",
recipe = {"farming:soy_pod"}
})
-- soy milk
minetest.register_node("farming:soy_milk", {
description = S("Soy Milk"),
drawtype = "plantlike",
tiles = {"farming_soy_milk_glass.png"},
inventory_image = "farming_soy_milk_glass.png",
wield_image = "farming_soy_milk_glass.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
},
on_use = minetest.item_eat(2, "vessels:drinking_glass"),
groups = {
vessel = 1, food_milk_glass = 1, dig_immediate = 3,
attached_node = 1, drink = 1
},
sounds = default.node_sound_glass_defaults()
})
minetest.register_craft( {
type = "shapeless",
output = "farming:soy_milk",
recipe = {
"group:food_soy", "group:food_soy", "group:food_soy",
"farming:vanilla_extract", "bucket:bucket_water", "vessels:drinking_glass"
},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty"},
{"farming:vanilla_extract", "vessels:glass_bottle"}
}
})
-- tofu
minetest.register_craftitem("farming:tofu", {
description = S("Tofu"),
inventory_image = "farming_tofu.png",
groups = {food_tofu = 1, food_meat_raw = 1, flammable = 2},
on_use = minetest.item_eat(3)
})
minetest.register_craft({
output = "farming:tofu",
type = "shapeless",
recipe = {
"farming:baking_tray", "group:food_soy", "group:food_soy",
"group:food_soy", "group:food_soy", "group:food_soy",
},
replacements = {{"farming:baking_tray", "farming:baking_tray"}}
})
-- cooked tofu
minetest.register_craftitem("farming:tofu_cooked", {
description = S("Cooked Tofu"),
inventory_image = "farming_tofu_cooked.png",
groups = {food_meat = 1, flammable = 2},
on_use = minetest.item_eat(6)
})
minetest.register_craft({
type = "cooking",
output = "farming:tofu_cooked",
recipe = "farming:tofu",
cooktime = 5
})
-- crop definition
local def = {
drawtype = "plantlike",
tiles = {"farming_soy_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, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:soy_1", table.copy(def))
-- stage 2
def.tiles = {"farming_soy_2.png"}
minetest.register_node("farming:soy_2", table.copy(def))
-- stage 3
def.tiles = {"farming_soy_3.png"}
minetest.register_node("farming:soy_3", table.copy(def))
-- stage 4
def.tiles = {"farming_soy_4.png"}
minetest.register_node("farming:soy_4", table.copy(def))
-- stage 5
def.tiles = {"farming_soy_5.png"}
def.drop = {
max_items = 1, items = {
{items = {'farming:soy_pod'}, rarity = 1},
}
}
minetest.register_node("farming:soy_5", table.copy(def))
-- stage 6
def.tiles = {"farming_soy_6.png"}
def.drop = {
max_items = 3, items = {
{items = {'farming:soy_pod'}, rarity = 1},
{items = {'farming:soy_pod'}, rarity = 2},
{items = {'farming:soy_pod'}, rarity = 3},
}
}
minetest.register_node("farming:soy_6", table.copy(def))
-- stage 7
def.tiles = {"farming_soy_7.png"}
def.groups.growing = nil
def.drop = {
max_items = 5, items = {
{items = {'farming:soy_pod'}, rarity = 1},
{items = {'farming:soy_pod'}, rarity = 2},
{items = {'farming:soy_pod'}, rarity = 3},
{items = {'farming:soy_pod'}, rarity = 4},
{items = {'farming:soy_pod'}, rarity = 5}
}
}
minetest.register_node("farming:soy_7", table.copy(def))
-- add to registered_plants
farming.registered_plants["farming:soy_pod"] = {
crop = "farming:soy",
seed = "farming:soy_pod",
minlight = farming.min_light,
maxlight = farming.max_light,
steps = 7
}

View File

@ -83,7 +83,7 @@ minetest.register_node("farming:tomato_8", table.copy(def))
farming.registered_plants["farming:tomato"] = { farming.registered_plants["farming:tomato"] = {
crop = "farming:tomato", crop = "farming:tomato",
seed = "farming:tomato", seed = "farming:tomato",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

122
crops/vanilla.lua Normal file
View File

@ -0,0 +1,122 @@
local S = farming.intllib
-- vanilla
minetest.register_craftitem("farming:vanilla", {
description = S("Vanilla"),
inventory_image = "farming_vanilla.png",
groups = {seed = 2, food_vanilla = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:vanilla_1")
end,
on_use = minetest.item_eat(1),
})
-- crop definition
local def = {
drawtype = "plantlike",
tiles = {"farming_vanilla_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- vanilla extract
minetest.register_node("farming:vanilla_extract", {
description = S("Vanilla Extract"),
drawtype = "plantlike",
tiles = {"farming_vanilla_extract.png"},
inventory_image = "farming_vanilla_extract.png",
wield_image = "farming_vanilla_extract.png",
paramtype = "light",
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
},
groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_craft( {
output = "farming:vanilla_extract",
recipe = {
{ "group:food_vanilla", "group:food_vanilla", "group:food_vanilla"},
{ "group:food_vanilla", "farming:bottle_ethanol", "bucket:bucket_water"},
},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty"},
}
})
minetest.register_craft({
type = "fuel",
recipe = "farming:vanilla_extract",
burntime = 25,
replacements = {{ "farming:vanilla_extract", "vessels:glass_bottle" }}
})
-- stage 1
minetest.register_node("farming:vanilla_1", table.copy(def))
-- stage 2
def.tiles = {"farming_vanilla_2.png"}
minetest.register_node("farming:vanilla_2", table.copy(def))
-- stage 3
def.tiles = {"farming_vanilla_3.png"}
minetest.register_node("farming:vanilla_3", table.copy(def))
-- stage 4
def.tiles = {"farming_vanilla_4.png"}
minetest.register_node("farming:vanilla_4", table.copy(def))
-- stage 5
def.tiles = {"farming_vanilla_5.png"}
minetest.register_node("farming:vanilla_5", table.copy(def))
-- stage 6
def.tiles = {"farming_vanilla_6.png"}
def.visual_scale = 1.9
minetest.register_node("farming:vanilla_6", table.copy(def))
-- stage 7
def.tiles = {"farming_vanilla_7.png"}
def.drop = {
items = {
{items = {'farming:vanilla'}, rarity = 1},
{items = {'farming:vanilla'}, rarity = 2},
{items = {'farming:vanilla'}, rarity = 3}
}
}
minetest.register_node("farming:vanilla_7", table.copy(def))
-- stage 8 (final)
def.tiles = {"farming_vanilla_8.png"}
def.groups.growing = nil
def.drop = {
items = {
{items = {'farming:vanilla 2'}, rarity = 1},
{items = {'farming:vanilla 2'}, rarity = 2},
{items = {'farming:vanilla 2'}, rarity = 2},
{items = {'farming:vanilla 2'}, rarity = 3}
}
}
minetest.register_node("farming:vanilla_8", table.copy(def))
-- add to registered_plants
farming.registered_plants["farming:vanilla"] = {
crop = "farming:vanilla",
seed = "farming:vanilla",
minlight = farming.min_light,
maxlight = farming.max_light,
steps = 8
}

View File

@ -234,8 +234,8 @@ minetest.register_node("farming:wheat_8", table.copy(def))
farming.registered_plants["farming:wheat"] = { farming.registered_plants["farming:wheat"] = {
crop = "farming:wheat", crop = "farming:wheat",
seed = "farming:seed_wheat", seed = "farming:seed_wheat",
minlight = 13, minlight = farming.min_light,
maxlight = 15, maxlight = farming.max_light,
steps = 8 steps = 8
} }

View File

@ -31,7 +31,15 @@ farming.peas = 0.001
farming.beetroot = 0.001 farming.beetroot = 0.001
farming.mint = 0.005 farming.mint = 0.005
farming.cabbage = 0.001 farming.cabbage = 0.001
farming.blackberry = 0.002
farming.lettuce = 0.001
farming.soy = 0.001
farming.vanilla = 0.001
farming.grains = true -- true or false only farming.grains = true -- true or false only
-- default rarety of crops on map (higher number = more crops) -- default rarety of crops on map (higher number = more crops)
farming.rarety = 0.002 farming.rarety = 0.002
-- default minimum and maximum light levels crops need to grow
farming.min_light = 12
farming.max_light = 15

View File

@ -181,44 +181,18 @@ minetest.register_craftitem("farming:porridge", {
on_use = minetest.item_eat(6, "farming:bowl") on_use = minetest.item_eat(6, "farming:bowl")
}) })
minetest.after(0, function()
local fluid = "group:water_bucket"
local fluid_return = {
{"group:water_bucket", "bucket:bucket_empty"},
{"group:water_bucket_wooden", "bucket:bucket_empty"}
}
if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then
fluid = "group:food_milk"
fluid_return = {
{"mobs:bucket_milk", "bucket:bucket_empty"}
}
else
minetest.register_craft({ minetest.register_craft({
type = "shapeless", type = "shapeless",
output = "farming:porridge", output = "farming:porridge",
recipe = { recipe = {
"group:food_oats", "group:food_oats", "group:food_oats", "group:food_oats", "group:food_oats", "group:food_oats",
"group:food_oats", "group:food_bowl", "group:water_bucket_wooden" "group:food_oats", "group:food_bowl", "group:food_milk_glass"
}, },
replacements = fluid_return replacements = {
{"mobs:glass_milk", "vessels:drinking_glass"},
{"farming:soy_milk", "vessels:drinking_glass"}
}
}) })
end
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
})
if minetest.get_modpath("bucket_wooden") then
end
end)
--= Jaffa Cake --= Jaffa Cake
@ -373,3 +347,57 @@ minetest.register_craft({
replacements = {{"group:food_skillet", "farming:skillet"}} replacements = {{"group:food_skillet", "farming:skillet"}}
}) })
end end
-- Burger
minetest.register_craftitem("farming:burger", {
description = S("Burger"),
inventory_image = "farming_burger.png",
on_use = minetest.item_eat(16),
})
minetest.register_craft({
type = "shapeless",
output = "farming:burger",
recipe = {
"farming:bread", "group:food_meat", "group:food_cheese",
"group:food_tomato", "group:food_cucumber", "group:food_onion",
"group:food_lettuce"
}
})
-- Salad
minetest.register_craftitem("farming:salad", {
description = S("Salad"),
inventory_image = "farming_salad.png",
on_use = minetest.item_eat(8, "farming:bowl")
})
minetest.register_craft({
output = "farming:salad",
type = "shapeless",
recipe = {
"group:food_bowl", "group:food_tomato", "group:food_cucumber",
"group:food_lettuce", "group:food_oil"
},
})
-- Triple Berry Smoothie
minetest.register_craftitem("farming:smoothie_berry", {
description = S("Triple Berry Smoothie"),
inventory_image = "farming_berry_smoothie.png",
on_use = minetest.item_eat(6, "vessels:drinking_glass"),
groups = {vessel = 1, drink = 1}
})
minetest.register_craft({
output = "farming:smoothie_berry",
type = "shapeless",
recipe = {
"group:food_raspberries", "group:food_blackberries",
"group:food_strawberry", "group:food_banana",
"vessels:drinking_glass"
}
})

View File

@ -7,13 +7,15 @@
farming = { farming = {
mod = "redo", mod = "redo",
version = "20200702", version = "20201213",
path = minetest.get_modpath("farming"), path = minetest.get_modpath("farming"),
select = { select = {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5} fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
}, },
registered_plants = {} registered_plants = {},
min_light = 12,
max_light = 15
} }
@ -332,9 +334,8 @@ function farming.plant_growth_timer(pos, elapsed, node_name)
return true return true
end end
local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 12 local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or farming.min_light
local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or 15 local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or farming.max_light
--print ("---", MIN_LIGHT, MAX_LIGHT)
if max_growth == 1 or lambda < 2.0 then if max_growth == 1 or lambda < 2.0 then
@ -628,6 +629,10 @@ farming.peas = 0.001
farming.beetroot = 0.001 farming.beetroot = 0.001
farming.mint = 0.005 farming.mint = 0.005
farming.cabbage = 0.001 farming.cabbage = 0.001
farming.blackberry = 0.002
farming.soy = 0.001
farming.vanilla = 0.001
farming.lettuce = 0.001
farming.grains = true farming.grains = true
farming.rarety = 0.002 farming.rarety = 0.002
@ -694,6 +699,10 @@ ddoo("chili.lua", farming.chili)
ddoo("ryeoatrice.lua", farming.grains) ddoo("ryeoatrice.lua", farming.grains)
ddoo("mint.lua", farming.mint) ddoo("mint.lua", farming.mint)
ddoo("cabbage.lua", farming.cabbage) ddoo("cabbage.lua", farming.cabbage)
ddoo("blackberry.lua", farming.blackberry)
ddoo("soy.lua", farming.soy)
ddoo("vanilla.lua", farming.vanilla)
ddoo("lettuce.lua", farming.lettuce)
dofile(farming.path .. "/food.lua") dofile(farming.path .. "/food.lua")
dofile(farming.path .. "/mapgen.lua") dofile(farming.path .. "/mapgen.lua")

View File

@ -128,6 +128,7 @@ Created by TenPlus1 (CC BY 3.0)
farming_rhubarb.png farming_rhubarb.png
farming_rhubarb_pie.png farming_rhubarb_pie.png
farming_hemp*.png farming_hemp*.png
farming_tofu*.png
Created by ademant (CC-BY-3.0) Created by ademant (CC-BY-3.0)
farming_rye*.png farming_rye*.png
@ -142,3 +143,15 @@ Created by VanessaE and edited by SpaghettiToastBook (CC0):
Created by mDiyo (Natura), modified by TenPlus1 (License: CC BY-SA 3.0): Created by mDiyo (Natura), modified by TenPlus1 (License: CC BY-SA 3.0):
farming_barley.png farming_barley.png
Created by OgelGames (CC BY-SA 4.0)
farming_berry_smoothie.png
farming_cactus_juice.png
farming_salad.png
Created by Felfa
farming_blackberry*.png
farming_lettuce*.png
farming_burger.png
farming_soy*.png
farming_vanilla*.png

View File

@ -50,6 +50,12 @@ register_plant("beetroot_5", 1, 15, nil, "", -1, farming.beetroot)
register_plant("mint_4", 1, 75, {"default:dirt_with_grass", register_plant("mint_4", 1, 75, {"default:dirt_with_grass",
"default:dirt_with_coniferous_litter"}, "group:water", 1, farming.mint) "default:dirt_with_coniferous_litter"}, "group:water", 1, farming.mint)
register_plant("cabbage_6", 2, 10, nil, "", -1, farming.cabbage) register_plant("cabbage_6", 2, 10, nil, "", -1, farming.cabbage)
register_plant("lettuce_5", 5, 30, nil, "", -1, farming.lettuce)
register_plant("blackberry_4", 3, 10, nil, "", -1, farming.blackberry)
register_plant("soy_6", 20, 50, {"default:dirt_with_dry_grass",
"default:dirt_with_rainforest_litter",
"default:dry_dirt_with_dry_grass"}, "", -1, farming.soy)
register_plant("vanilla_7", 5, 35, nil, "", -1, farming.vanilla)
if minetest.get_mapgen_setting("mg_name") == "v6" then if minetest.get_mapgen_setting("mg_name") == "v6" then
@ -124,7 +130,7 @@ minetest.register_decoration({
}, },
y_min = 5, y_min = 5,
y_max = 35, y_max = 35,
decoration = {"farming:pepper_5"}, decoration = {"farming:pepper_5", "farming:pepper_6", "farming:pepper_7"},
spawn_by = "group:tree", spawn_by = "group:tree",
num_spawn_by = 1 num_spawn_by = 1
}) })

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
textures/farming_burger.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

BIN
textures/farming_salad.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

BIN
textures/farming_soy_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

BIN
textures/farming_soy_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

BIN
textures/farming_soy_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

BIN
textures/farming_soy_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

BIN
textures/farming_soy_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

BIN
textures/farming_soy_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

BIN
textures/farming_soy_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

BIN
textures/farming_tofu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B