Add teosinte and corn with related crafts

This commit is contained in:
sys4-fr 2017-03-02 16:29:22 +01:00
parent 3bbc51cdb7
commit 874dc0214f
25 changed files with 302 additions and 83 deletions

View File

@ -44,16 +44,27 @@ A concrete example with Wild carrot:
- 11- Good you have a new variety of carrots, you taste it and you realize that his nutritional power is much better than the wild version.
For now this mod add:
- Wild Carrot
- Carrot (domestic)
- Wild Carrot -> Carrot
- Golden Carrot
- Teosinte -> Corn
- Corn on the Cob
- Chicha (Bottle of Ethanol equivalent) (Original Texture by TenPlus1 modified by me)
Behaviour with optional mods loaded (for now):
- farming_redo: Domestic and golden carrots are provided by farming_redo. There is no carrot seeds.
- farming_plus: Domestic carrots and carrots seeds are provided by farming_plus.
- farming_redo and farming_plus together: Domestic carrots and carrots seeds provided by farming_plus, golden carrot by farming_redo.
- maidroid_core: The core farming was modified so that your robot has ability to harvest and plant wild carrots (flowers and seeds) and domestic carrots.
- WARNING: If farming_redo or farming_plus is loaded then maidroid_core will not load due to incompatibility.
- farming_redo:
--> Carrots and golden carrots are provided by farming_redo. There is no carrot seeds.
--> Corn, Corn on the Cob, Chicha replaced by Bottle of Ethanol (craft slightly changed)
- farming_plus:
--> Carrots and carrots seeds are provided by farming_plus.
- farming_redo and farming_plus together:
--> Carrots and carrots seeds provided by farming_plus, golden carrot by farming_redo.
- maidroid_core: The core farming was modified so that your robot has ability to harvest and plant:
--> wild carrots (flowers and seeds)
--> Carrots
--> Teosinte (Flowers and seeds)
--> Corn
WARNING: If farming_redo or farming_plus is loaded then maidroid_core will not load due to incompatibility.
LICENCES:
- Code & Textures: GPLv3

357
init.lua
View File

@ -6,97 +6,297 @@
local redo = farming.mod and farming.mod == "redo"
local plus = minetest.get_modpath("farming_plus")
-- Wild carrot
minetest.override_item("moreflowers:wild_carrot", {
drop = {
max_items = 1,
items = {
{ items = {"morefarming:seed_wildcarrot"}, rarity = 12},
{ items = {"moreflowers:wild_carrot"}},
}
}})
-- Override flowers --
--
minetest.override_item(
"moreflowers:wild_carrot", {
drop = {
max_items = 1,
items = {
{ items = {"morefarming:seed_wildcarrot"}, rarity = 12},
{ items = {"moreflowers:wild_carrot"}},
}
}})
farming.register_plant("morefarming:wildcarrot", {
description = "Wild Carrot seed",
inventory_image = "morefarming_wildcarrot_seed.png",
steps = 8,
minlight = 13,
maxlight = default.LIGHT_MAX,
fertility = {"grassland"},
groups = {flammable = 4},
})
minetest.override_item(
"moreflowers:teosinte", {
drop = {
max_items = 1,
items = {
{ items = {"morefarming:seed_teosinte"}, rarity = 6},
{ items = {"moreflowers:teosinte"}},
}
}})
local carrot_seed = "morefarming:seed_carrot"
if redo then carrot_seed = "farming:carrot" end
if plus then carrot_seed = "farming_plus:carrot_seed" end
minetest.override_item("morefarming:wildcarrot_8", {
drop = {
max_items = 3,
items = {
{ items = {"morefarming:seed_wildcarrot"}, rarity = 6},
{ items = {carrot_seed}, rarity = 8},
{ items = {"morefarming:wildcarrot"}, rarity = 2},
{ items = {"moreflowers:wild_carrot"}},
}
}})
-- Register morefarming plants --
--
-- Wild Carrot
farming.register_plant(
"morefarming:wildcarrot",
{
description = "Wild Carrot seed",
inventory_image = "morefarming_wildcarrot_seed.png",
steps = 8,
minlight = 13,
maxlight = default.LIGHT_MAX,
fertility = {"grassland"},
groups = {flammable = 4},
})
minetest.override_item("morefarming:wildcarrot", {
on_use = minetest.item_eat(1)
})
minetest.override_item(
"morefarming:wildcarrot",
{
on_use = minetest.item_eat(1)
})
-- Teosinte
farming.register_plant(
"morefarming:teosinte",
{
description = "Teosinte seed",
inventory_image = "morefarming_teosinte_seed.png",
steps = 8,
minlight = 13,
maxlight = default.LIGHT_MAX,
fertility = {"grassland", "desert"},
groups = {flammable = 4},
})
for i=1, 8 do
minetest.override_item(
"morefarming:teosinte_"..i,
{
visual_scale = 1.3
})
end
if not redo and not plus then
-- Carrot
farming.register_plant("morefarming:carrot", {
description = "Carrot seed",
paramtype2 = "meshoptions",
inventory_image = "morefarming_carrot_seed.png",
steps = 8,
minlight = 13,
maxlight = default.LIGHT_MAX,
fertility = {"grassland"},
groups = {flammable = 4},
place_param2 = 3,
})
farming.register_plant(
"morefarming:carrot",
{
description = "Carrot seed",
paramtype2 = "meshoptions",
inventory_image = "morefarming_carrot_seed.png",
steps = 8,
minlight = 13,
maxlight = default.LIGHT_MAX,
fertility = {"grassland"},
groups = {flammable = 4},
place_param2 = 3,
})
minetest.override_item("morefarming:carrot", {
on_use = minetest.item_eat(4)
})
minetest.override_item(
"morefarming:carrot",
{
on_use = minetest.item_eat(4)
})
end
local carrot_item = "morefarming:carrot"
if plus then carrot_item = "farming_plus:carrot_item" end
if not redo then
-- golden carrot
minetest.register_craftitem("morefarming:carrot_gold", {
description = "Golden Carrot",
inventory_image = "morefarming_carrot_gold.png",
on_use = minetest.item_eat(6),
})
-- Corn
farming.register_plant(
"morefarming:corn",
{
description = "Corn seed",
inventory_image = "morefarming_corn_seed.png",
steps = 8,
minlight = 13,
maxlight = default.LIGHT_MAX,
fertility = {"grassland", "desert"},
groups = {flammable = 4},
})
for i=1, 8 do
minetest.override_item(
"morefarming:corn_"..i,
{
visual_scale = 1.6
})
end
minetest.override_item(
"morefarming:corn",
{
on_use = minetest.item_eat(3)
})
minetest.register_craft({
output = "morefarming:carrot_gold",
recipe = {
{"", "default:gold_lump", ""},
{"default:gold_lump", carrot_item, "default:gold_lump"},
{"", "default:gold_lump", ""},
}
})
elseif plus then
minetest.register_craft({
output = "farming:carrot_gold",
recipe = {
{"", "default:gold_lump", ""},
{"default:gold_lump", carrot_item, "default:gold_lump"},
{"", "default:gold_lump", ""},
}
})
end
-- Override mature plants--
--
local carrot_seed = "morefarming:seed_carrot"
local corn_seed = "morefarming:seed_corn"
if redo then
carrot_seed = "farming:carrot"
corn_seed = "farming:corn"
end
if plus then
carrot_seed = "farming_plus:carrot_seed"
end
-- Wild Carrot
minetest.override_item(
"morefarming:wildcarrot_8", {
drop = {
max_items = 3,
items = {
{ items = {"morefarming:seed_wildcarrot"}, rarity = 6},
{ items = {carrot_seed}, rarity = 8},
{ items = {"morefarming:wildcarrot"}, rarity = 2},
{ items = {"moreflowers:wild_carrot"}},
}
}})
-- Teosinte
minetest.override_item(
"morefarming:teosinte_8", {
drop = {
max_items = 3,
items = {
{ items = {"morefarming:seed_teosinte"}, rarity = 3},
{ items = {corn_seed}, rarity = 8},
{ items = {"morefarming:teosinte"}, rarity = 2},
{ items = {"moreflowers:teosinte"}},
}
}})
-- Register craftitems
--
local carrot_item = "morefarming:carrot"
local corn_item = "morefarming:corn"
if plus then
carrot_item = "farming_plus:carrot_item"
end
if not redo then
-- golden carrot
minetest.register_craftitem(
"morefarming:carrot_gold",
{
description = "Golden Carrot",
inventory_image = "morefarming_carrot_gold.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft(
{
output = "morefarming:carrot_gold",
recipe = {
{"", "default:gold_lump", ""},
{"default:gold_lump", carrot_item, "default:gold_lump"},
{"", "default:gold_lump", ""},
}
})
-- Corn on the cob
minetest.register_craftitem(
"morefarming:corn_cooked",
{
description = "Corn on the Cob",
inventory_image = "morefarming_corn_cooked.png",
on_use = minetest.item_eat(5),
})
minetest.register_craft(
{
type = "cooking",
cooktime = 10,
output = "morefarming:corn_cooked",
recipe = "morefarming:corn"
})
if minetest.get_modpath("vessels") then
-- Chicha (Ethanol equivalent ;)
minetest.register_craftitem(
"morefarming:chicha",
{
description = "Chicha",
inventory_image = "morefarming_chicha.png",
})
minetest.register_craft(
{
output = "morefarming:chicha 2",
recipe = {
{ "vessels:glass_bottle", "vessels:glass_bottle", "morefarming:corn"},
{ "morefarming:corn", "morefarming:corn", "morefarming:corn"},
}
})
minetest.register_craft(
{
output = "morefarming:chicha",
recipe = {
{ "vessels:glass_bottle", "morefarming:teosinte", "morefarming:teosinte"},
{ "morefarming:teosinte", "morefarming:teosinte", "morefarming:teosinte"},
}
})
minetest.register_craft(
{
type = "fuel",
recipe = "morefarming:chicha",
burntime = 240,
replacements = {{"morefarming:chicha", "vessels:glass_bottle"}}
})
end
elseif plus then
-- Golden Carrot
minetest.register_craft(
{
output = "farming:carrot_gold",
recipe = {
{"", "default:gold_lump", ""},
{"default:gold_lump", carrot_item, "default:gold_lump"},
{"", "default:gold_lump", ""},
}
})
end
if redo then
if minetest.get_modpath("vessels") then
-- Bottle of Ethanol
minetest.clear_craft(
{
recipe = {
{"vessels:glass_bottle", "farming:corn", "farming:corn"},
{"farming:corn", "farming:corn", "farming:corn"},
}
})
minetest.register_craft(
{
output = "farming:bottle_ethanol 2",
recipe = {
{ "vessels:glass_bottle", "vessels:glass_bottle", "farming:corn"},
{ "farming:corn", "farming:corn", "farming:corn"},
}
})
minetest.register_craft(
{
output = "farming:bottle_ethanol",
recipe = {
{ "vessels:glass_bottle", "morefarming:teosinte", "morefarming:teosinte"},
{ "morefarming:teosinte", "morefarming:teosinte", "morefarming:teosinte"},
}
})
end
end
-- Maidroid behaviour
if not redo and not plus and minetest.get_modpath("maidroid_core") then
minetest.registered_items["moreflowers:wild_carrot"].groups["seed"] = 1
minetest.registered_items["moreflowers:teosinte"].groups["seed"] = 1
dofile(minetest.get_modpath("morefarming").."/maidroid_core_morefarming.lua")
end
@ -104,8 +304,13 @@ end
if minetest.get_modpath("bonemeal") and bonemeal then
bonemeal:add_crop({{"morefarming:wildcarrot_", 8, "morefarming:seed_wildcarrot"}})
bonemeal:add_crop({{"morefarming:teosinte_", 8, "morefarming:seed_teosinte"}})
if not redo and not plus then
bonemeal:add_crop({{"morefarming:carrot_", 8, "morefarming:seed_carrot"}})
if not redo then
if not plus then
bonemeal:add_crop({{"morefarming:carrot_", 8, "morefarming:seed_carrot"}})
end
bonemeal:add_crop({{"morefarming:corn_", 8, "morefarming:seed_corn"}})
end
end

View File

@ -19,6 +19,9 @@ local target_plants = {
"moreflowers:wild_carrot",
"morefarming:wildcarrot_8",
"morefarming:carrot_8",
"moreflowers:teosinte",
"morefarming:teosinte_8",
"morefarming:corn_8",
}
local _aux = maidroid_core._aux

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B