diff --git a/mods/mcl_dye/init.lua b/mods/mcl_dye/init.lua index 1e265b67c5..77f0cc10c1 100644 --- a/mods/mcl_dye/init.lua +++ b/mods/mcl_dye/init.lua @@ -231,6 +231,10 @@ minetest.register_craft({ output = "mcl_dye:red 2", recipe = {{"mcl_flowers:rose_bush"}}, }) +minetest.register_craft({ + output = "mcl_dye:red", + recipe = {{"mcl_farming:beetroot_item"}}, +}) minetest.register_craft({ type = "cooking", output = "mcl_dye:dark_green", diff --git a/mods/mcl_farming/beetroot.lua b/mods/mcl_farming/beetroot.lua new file mode 100644 index 0000000000..230725ff73 --- /dev/null +++ b/mods/mcl_farming/beetroot.lua @@ -0,0 +1,109 @@ +minetest.register_craftitem("mcl_farming:beetroot_seeds", { + description = "Beetroot Seeds", + groups = { craftitem=1 }, + inventory_image = "mcl_farming_beetroot_seeds.png", + wield_image = "mcl_farming_beetroot_seeds.png", + on_place = function(itemstack, placer, pointed_thing) + return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:beetroot_1") + end +}) + +minetest.register_node("mcl_farming:beetroot_1", { + paramtype = "light", + walkable = false, + drawtype = "plantlike", + drop = "", + tiles = {"mcl_farming_beetroot_1.png"}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.125, 0.5} + }, + }, + groups = {snappy=3, not_in_creative_inventory=1,dig_by_water=1}, + sounds = mcl_core.node_sound_leaves_defaults(), +}) + +minetest.register_node("mcl_farming:beetroot_2", { + paramtype = "light", + walkable = false, + drawtype = "plantlike", + drop = "", + tiles = {"mcl_farming_beetroot_2.png"}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.125, 0.5} + }, + }, + groups = {snappy=3, not_in_creative_inventory=1,dig_by_water=1}, + sounds = mcl_core.node_sound_leaves_defaults(), +}) + +minetest.register_node("mcl_farming:beetroot_3", { + paramtype = "light", + walkable = false, + drawtype = "plantlike", + drop = "", + tiles = {"farming_carrot_3.png"}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.125, 0.5} + }, + }, + groups = {snappy=3, not_in_creative_inventory=1,dig_by_water=1}, + sounds = mcl_core.node_sound_leaves_defaults(), +}) + +minetest.register_node("mcl_farming:beetroot", { + paramtype = "light", + walkable = false, + drawtype = "plantlike", + drop = { + max_items = 2, + items = { + { items = {"mcl_farming:beetroot_item"}, rarity = 1 }, + { items = {"mcl_farming:beetroot_seed 3"}, rarity = 4 }, + { items = {"mcl_farming:beetroot_seed 2"}, rarity = 4 }, + { items = {"mcl_farming:beetroot_seed 1"}, rarity = 4 }, + }, + }, + tiles = {"mcl_farming_beetroot_4.png"}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.125, 0.5} + }, + }, + groups = {snappy=3, not_in_creative_inventory=1,dig_by_water=1}, + sounds = mcl_core.node_sound_leaves_defaults(), +}) + +minetest.register_craftitem("mcl_farming:beetroot_item", { + description = "Beetroot", + inventory_image = "mcl_farming_beetroot.png", + wield_image = "mcl_farming_beetroot.png", + on_use = minetest.item_eat(1), + groups = { food = 2, eatable = 1 }, +}) + +minetest.register_craftitem("mcl_farming:beetroot_soup", { + description = "Beetroot Soup", + stack_max = 1, + inventory_image = "mcl_farming_beetroot_soup.png", + wield_image = "mcl_farming_beetroot_soup.png", + on_use = minetest.item_eat(6, "mcl_core:bowl"), + groups = { food = 1, eatable = 6 }, +}) + +minetest.register_craft({ + output = "mcl_farming:beetroot_soup", + recipe = { + { "mcl_farming:beetroot_item","mcl_farming:beetroot_item","mcl_farming:beetroot_item", }, + { "mcl_farming:beetroot_item","mcl_farming:beetroot_item","mcl_farming:beetroot_item", }, + { "", "mcl_core:bowl", "" }, + }, +}) + +mcl_farming:add_plant("mcl_farming:beetroot", {"mcl_farming:beetroot_1", "mcl_farming:beetroot_2", "mcl_farming:beetroot_3", "mcl_farming:beetroot_4"}, 68, 3) diff --git a/mods/mcl_farming/init.lua b/mods/mcl_farming/init.lua index ae70790b61..10664e8441 100644 --- a/mods/mcl_farming/init.lua +++ b/mods/mcl_farming/init.lua @@ -91,5 +91,9 @@ dofile(minetest.get_modpath("mcl_farming").."/potatoes.lua") -- ========= MUSHROOMS ========= dofile(minetest.get_modpath("mcl_farming").."/mushrooms.lua") +-- ========= BEETROOT ========= +-- TODO: Add beetroot textures +--dofile(minetest.get_modpath("mcl_farming").."/beetroot.lua") + local time_to_load= os.clock() - init print(string.format("[MOD] "..minetest.get_current_modname().." loaded in %.4f s", time_to_load))