diff --git a/README.md b/README.md index 23b929b..f763f56 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/init.lua b/init.lua index 5927b0a..aca3ebb 100644 --- a/init.lua +++ b/init.lua @@ -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 diff --git a/maidroid_core_morefarming.lua b/maidroid_core_morefarming.lua index cbd3917..8291b1d 100644 --- a/maidroid_core_morefarming.lua +++ b/maidroid_core_morefarming.lua @@ -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 diff --git a/textures/morefarming_chicha.png b/textures/morefarming_chicha.png new file mode 100644 index 0000000..d04c02f Binary files /dev/null and b/textures/morefarming_chicha.png differ diff --git a/textures/morefarming_corn.png b/textures/morefarming_corn.png new file mode 100644 index 0000000..64b871b Binary files /dev/null and b/textures/morefarming_corn.png differ diff --git a/textures/morefarming_corn_1.png b/textures/morefarming_corn_1.png new file mode 100644 index 0000000..e704a90 Binary files /dev/null and b/textures/morefarming_corn_1.png differ diff --git a/textures/morefarming_corn_2.png b/textures/morefarming_corn_2.png new file mode 100644 index 0000000..c2ca8f5 Binary files /dev/null and b/textures/morefarming_corn_2.png differ diff --git a/textures/morefarming_corn_3.png b/textures/morefarming_corn_3.png new file mode 100644 index 0000000..82f8a23 Binary files /dev/null and b/textures/morefarming_corn_3.png differ diff --git a/textures/morefarming_corn_4.png b/textures/morefarming_corn_4.png new file mode 100644 index 0000000..9aa7693 Binary files /dev/null and b/textures/morefarming_corn_4.png differ diff --git a/textures/morefarming_corn_5.png b/textures/morefarming_corn_5.png new file mode 100644 index 0000000..607e8cb Binary files /dev/null and b/textures/morefarming_corn_5.png differ diff --git a/textures/morefarming_corn_6.png b/textures/morefarming_corn_6.png new file mode 100644 index 0000000..7331b6a Binary files /dev/null and b/textures/morefarming_corn_6.png differ diff --git a/textures/morefarming_corn_7.png b/textures/morefarming_corn_7.png new file mode 100644 index 0000000..1a309ef Binary files /dev/null and b/textures/morefarming_corn_7.png differ diff --git a/textures/morefarming_corn_8.png b/textures/morefarming_corn_8.png new file mode 100644 index 0000000..8d255d7 Binary files /dev/null and b/textures/morefarming_corn_8.png differ diff --git a/textures/morefarming_corn_cooked.png b/textures/morefarming_corn_cooked.png new file mode 100644 index 0000000..c8df945 Binary files /dev/null and b/textures/morefarming_corn_cooked.png differ diff --git a/textures/morefarming_corn_seed.png b/textures/morefarming_corn_seed.png new file mode 100644 index 0000000..207745e Binary files /dev/null and b/textures/morefarming_corn_seed.png differ diff --git a/textures/morefarming_teosinte.png b/textures/morefarming_teosinte.png new file mode 100644 index 0000000..a8f3011 Binary files /dev/null and b/textures/morefarming_teosinte.png differ diff --git a/textures/morefarming_teosinte_1.png b/textures/morefarming_teosinte_1.png new file mode 100644 index 0000000..bdeaf0e Binary files /dev/null and b/textures/morefarming_teosinte_1.png differ diff --git a/textures/morefarming_teosinte_2.png b/textures/morefarming_teosinte_2.png new file mode 100644 index 0000000..c29f0a1 Binary files /dev/null and b/textures/morefarming_teosinte_2.png differ diff --git a/textures/morefarming_teosinte_3.png b/textures/morefarming_teosinte_3.png new file mode 100644 index 0000000..d4aa2e1 Binary files /dev/null and b/textures/morefarming_teosinte_3.png differ diff --git a/textures/morefarming_teosinte_4.png b/textures/morefarming_teosinte_4.png new file mode 100644 index 0000000..3fa8fa7 Binary files /dev/null and b/textures/morefarming_teosinte_4.png differ diff --git a/textures/morefarming_teosinte_5.png b/textures/morefarming_teosinte_5.png new file mode 100644 index 0000000..54f96e9 Binary files /dev/null and b/textures/morefarming_teosinte_5.png differ diff --git a/textures/morefarming_teosinte_6.png b/textures/morefarming_teosinte_6.png new file mode 100644 index 0000000..1e146d2 Binary files /dev/null and b/textures/morefarming_teosinte_6.png differ diff --git a/textures/morefarming_teosinte_7.png b/textures/morefarming_teosinte_7.png new file mode 100644 index 0000000..98fd0e0 Binary files /dev/null and b/textures/morefarming_teosinte_7.png differ diff --git a/textures/morefarming_teosinte_8.png b/textures/morefarming_teosinte_8.png new file mode 100644 index 0000000..47eeab9 Binary files /dev/null and b/textures/morefarming_teosinte_8.png differ diff --git a/textures/morefarming_teosinte_seed.png b/textures/morefarming_teosinte_seed.png new file mode 100644 index 0000000..12f4c7f Binary files /dev/null and b/textures/morefarming_teosinte_seed.png differ