2021-05-29 17:12:33 +03:00
|
|
|
local S = minetest.get_translator(minetest.get_current_modname())
|
2019-03-08 01:00:09 +02:00
|
|
|
|
2017-02-10 18:00:29 +02:00
|
|
|
minetest.register_craftitem("mcl_farming:wheat_seeds", {
|
2017-03-11 19:24:07 +02:00
|
|
|
-- Original Minecraft name: “Seeds”
|
2019-03-08 01:00:09 +02:00
|
|
|
description = S("Wheat Seeds"),
|
2020-03-12 02:35:11 +02:00
|
|
|
_tt_help = S("Grows on farmland"),
|
2019-03-08 01:00:09 +02:00
|
|
|
_doc_items_longdesc = S("Grows into a wheat plant. Chickens like wheat seeds."),
|
2021-04-16 00:41:34 +03:00
|
|
|
_doc_items_usagehelp = S([[
|
|
|
|
Place the wheat seeds on farmland (which can be created with a hoe) to plant a wheat plant.
|
|
|
|
They grow in sunlight and grow faster on hydrated farmland. Rightclick an animal to feed it wheat seeds.
|
|
|
|
]]),
|
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 13:54:51 +03:00
|
|
|
groups = {craftitem = 1, compostability = 30},
|
2019-02-05 05:06:28 +02:00
|
|
|
inventory_image = "mcl_farming_wheat_seeds.png",
|
2015-06-29 20:55:56 +03:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
2017-01-31 13:35:59 +02:00
|
|
|
return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:wheat_1")
|
2015-06-29 20:55:56 +03:00
|
|
|
end
|
|
|
|
})
|
|
|
|
|
2017-04-01 05:41:59 +03:00
|
|
|
local sel_heights = {
|
|
|
|
-5/16,
|
|
|
|
-2/16,
|
|
|
|
0,
|
|
|
|
3/16,
|
|
|
|
5/16,
|
|
|
|
6/16,
|
|
|
|
7/16,
|
|
|
|
}
|
2015-06-29 20:55:56 +03:00
|
|
|
|
2017-04-01 05:41:59 +03:00
|
|
|
for i=1,7 do
|
|
|
|
local create, name, longdesc
|
|
|
|
if i == 1 then
|
|
|
|
create = true
|
2019-03-08 01:00:09 +02:00
|
|
|
name = S("Premature Wheat Plant")
|
2021-04-16 00:41:34 +03:00
|
|
|
longdesc = S([[
|
|
|
|
Premature wheat plants grow on farmland under sunlight in 8 stages.
|
|
|
|
On hydrated farmland, they grow faster. They can be harvested at any time but will only yield a profit when mature.
|
|
|
|
]])
|
2017-04-01 05:41:59 +03:00
|
|
|
else
|
|
|
|
create = false
|
|
|
|
end
|
2015-06-29 20:55:56 +03:00
|
|
|
|
2017-04-01 05:41:59 +03:00
|
|
|
minetest.register_node("mcl_farming:wheat_"..i, {
|
2019-03-08 01:00:09 +02:00
|
|
|
description = S("Premature Wheat Plant (Stage @1)", i),
|
2017-04-01 05:41:59 +03:00
|
|
|
_doc_items_create_entry = create,
|
|
|
|
_doc_items_entry_name = name,
|
|
|
|
_doc_items_longdesc = longdesc,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "meshoptions",
|
|
|
|
place_param2 = 3,
|
|
|
|
sunlight_propagates = true,
|
|
|
|
walkable = false,
|
|
|
|
drawtype = "plantlike",
|
|
|
|
drop = "mcl_farming:wheat_seeds",
|
|
|
|
tiles = {"mcl_farming_wheat_stage_"..(i-1)..".png"},
|
|
|
|
inventory_image = "mcl_farming_wheat_stage_"..(i-1)..".png",
|
|
|
|
wield_image = "mcl_farming_wheat_stage_"..(i-1)..".png",
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5, -0.5, -0.5, 0.5, sel_heights[i], 0.5}
|
|
|
|
},
|
2015-06-29 20:55:56 +03:00
|
|
|
},
|
2021-04-16 00:41:34 +03:00
|
|
|
groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1,attached_node=1,
|
|
|
|
dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1},
|
2017-04-01 05:41:59 +03:00
|
|
|
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
|
|
|
_mcl_blast_resistance = 0,
|
|
|
|
})
|
|
|
|
end
|
2015-06-29 20:55:56 +03:00
|
|
|
|
2017-01-31 13:35:59 +02:00
|
|
|
minetest.register_node("mcl_farming:wheat", {
|
2019-03-08 01:00:09 +02:00
|
|
|
description = S("Mature Wheat Plant"),
|
2021-04-16 00:41:34 +03:00
|
|
|
_doc_items_longdesc = S([[
|
|
|
|
Mature wheat plants are ready to be harvested for wheat and wheat seeds.
|
|
|
|
They won't grow any further.
|
|
|
|
]]),
|
2015-06-29 20:55:56 +03:00
|
|
|
sunlight_propagates = true,
|
|
|
|
paramtype = "light",
|
2017-03-14 22:25:20 +02:00
|
|
|
paramtype2 = "meshoptions",
|
|
|
|
place_param2 = 3,
|
2015-06-29 20:55:56 +03:00
|
|
|
walkable = false,
|
2017-03-14 22:25:20 +02:00
|
|
|
drawtype = "plantlike",
|
2017-04-01 05:41:59 +03:00
|
|
|
tiles = {"mcl_farming_wheat_stage_7.png"},
|
|
|
|
inventory_image = "mcl_farming_wheat_stage_7.png",
|
|
|
|
wield_image = "mcl_farming_wheat_stage_7.png",
|
2015-06-29 20:55:56 +03:00
|
|
|
drop = {
|
|
|
|
max_items = 4,
|
|
|
|
items = {
|
2021-05-29 17:12:33 +03:00
|
|
|
{ items = {"mcl_farming:wheat_seeds"} },
|
|
|
|
{ items = {"mcl_farming:wheat_seeds"}, rarity = 2},
|
|
|
|
{ items = {"mcl_farming:wheat_seeds"}, rarity = 5},
|
|
|
|
{ items = {"mcl_farming:wheat_item"} }
|
2015-06-29 20:55:56 +03:00
|
|
|
}
|
|
|
|
},
|
2021-04-16 00:41:34 +03:00
|
|
|
groups = {dig_immediate=3, not_in_creative_inventory=1, plant=1, attached_node=1,
|
|
|
|
dig_by_water=1,destroy_by_lava_flow=1, dig_by_piston=1},
|
2017-02-11 19:46:23 +02:00
|
|
|
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
2017-02-22 17:03:59 +02:00
|
|
|
_mcl_blast_resistance = 0,
|
2015-06-29 20:55:56 +03:00
|
|
|
})
|
|
|
|
|
2017-04-01 05:46:15 +03:00
|
|
|
mcl_farming:add_plant("plant_wheat", "mcl_farming:wheat", {"mcl_farming:wheat_1", "mcl_farming:wheat_2", "mcl_farming:wheat_3", "mcl_farming:wheat_4", "mcl_farming:wheat_5", "mcl_farming:wheat_6", "mcl_farming:wheat_7"}, 25, 20)
|
2015-06-29 20:55:56 +03:00
|
|
|
|
2017-02-11 22:38:25 +02:00
|
|
|
minetest.register_craftitem("mcl_farming:wheat_item", {
|
2019-03-08 01:00:09 +02:00
|
|
|
description = S("Wheat"),
|
|
|
|
_doc_items_longdesc = S("Wheat is used in crafting. Some animals like wheat."),
|
2019-03-25 13:05:57 +02:00
|
|
|
_doc_items_usagehelp = S("Use the “Place” key on an animal to try to feed it wheat."),
|
2015-06-29 20:55:56 +03:00
|
|
|
inventory_image = "farming_wheat_harvested.png",
|
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 13:54:51 +03:00
|
|
|
groups = {craftitem = 1, compostability = 65},
|
2015-06-29 20:55:56 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2017-01-31 13:35:59 +02:00
|
|
|
output = "mcl_farming:bread",
|
2015-06-29 20:55:56 +03:00
|
|
|
recipe = {
|
2021-05-29 17:12:33 +03:00
|
|
|
{"mcl_farming:wheat_item", "mcl_farming:wheat_item", "mcl_farming:wheat_item"},
|
2015-06-29 20:55:56 +03:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2017-01-31 13:35:59 +02:00
|
|
|
output = "mcl_farming:cookie 8",
|
2015-06-29 20:55:56 +03:00
|
|
|
recipe = {
|
2021-05-29 17:12:33 +03:00
|
|
|
{"mcl_farming:wheat_item", "mcl_dye:brown", "mcl_farming:wheat_item"},
|
2015-06-29 20:55:56 +03:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2017-01-31 13:35:59 +02:00
|
|
|
minetest.register_craftitem("mcl_farming:cookie", {
|
2019-03-08 01:00:09 +02:00
|
|
|
description = S("Cookie"),
|
|
|
|
_doc_items_longdesc = S("This is a food item which can be eaten."),
|
2015-06-29 20:55:56 +03:00
|
|
|
inventory_image = "farming_cookie.png",
|
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 13:54:51 +03:00
|
|
|
groups = {food = 2, eatable = 2, compostability = 85},
|
2017-05-20 18:45:04 +03:00
|
|
|
_mcl_saturation = 0.4,
|
2017-02-16 18:45:33 +02:00
|
|
|
on_place = minetest.item_eat(2),
|
|
|
|
on_secondary_use = minetest.item_eat(2),
|
2015-06-29 20:55:56 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
|
2017-01-31 13:35:59 +02:00
|
|
|
minetest.register_craftitem("mcl_farming:bread", {
|
2019-03-08 01:00:09 +02:00
|
|
|
description = S("Bread"),
|
|
|
|
_doc_items_longdesc = S("This is a food item which can be eaten."),
|
2015-06-29 20:55:56 +03:00
|
|
|
inventory_image = "farming_bread.png",
|
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 13:54:51 +03:00
|
|
|
groups = {food = 2, eatable = 5, compostability = 85},
|
2017-05-20 18:45:04 +03:00
|
|
|
_mcl_saturation = 6.0,
|
2017-02-16 18:45:33 +02:00
|
|
|
on_place = minetest.item_eat(5),
|
|
|
|
on_secondary_use = minetest.item_eat(5),
|
2015-06-29 20:55:56 +03:00
|
|
|
})
|
|
|
|
|
2021-05-29 17:12:33 +03:00
|
|
|
local mod_screwdriver = minetest.get_modpath("screwdriver")
|
2019-12-15 00:42:17 +02:00
|
|
|
local on_rotate
|
|
|
|
if mod_screwdriver then
|
|
|
|
on_rotate = screwdriver.rotate_3way
|
|
|
|
end
|
|
|
|
|
2017-02-16 22:44:53 +02:00
|
|
|
minetest.register_node("mcl_farming:hay_block", {
|
2019-03-08 01:00:09 +02:00
|
|
|
description = S("Hay Bale"),
|
|
|
|
_doc_items_longdesc = S("Hay bales are decorative blocks made from wheat."),
|
2017-02-16 22:44:53 +02:00
|
|
|
tiles = {"mcl_farming_hayblock_top.png", "mcl_farming_hayblock_top.png", "mcl_farming_hayblock_side.png"},
|
|
|
|
is_ground_content = false,
|
|
|
|
stack_max = 64,
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
on_place = mcl_util.rotate_axis,
|
Add `compostability` to node definition group.
* mcl_cake/init.lua (cake);
* mcl_core/craftitems.lua (apple);
* mcl_core/nodes_base.lua (dirt with grass);
* mcl_core/nodes_cactuscane.lua (cactus, sugarcane);
* mcl_core/nodes_climb.lua (vines);
* mcl_core/nodes_trees.lua (leaves, saplings);
* mcl_dye/init.lua (cocoa beans);
* mcl_farming/beetroot.lua (beetroot, & seeds);
* mcl_farming/carrots.lua (carrot);
* mcl_farming/melon.lua (melon, & slice, & seeds);
* mcl_farming/potatoes.lua (potato, baked potato);
* mcl_farming/pumpkin.lua (pumpkin, carved &, & seeds, & pie);
* mcl_farming/wheat.lua (wheat, cookie, bread, hay block);
* mcl_flowers/init.lua (flowers, ferns, grass, & tall variants);
* mcl_mushrooms/small.lua (red and brown mushrooms);
* mcl_mushrooms/huge.lua (red and brown huge mushrooms);
* mcl_nether/init.lua (nether wart block);
* mcl_nether/nether_wart.lua (nether wart);
* mcl_ocean/kelp.lua (kelp, dried &, & block);
* mcl_ocean/sea_pickle.lua (sea pickle);
* mcl_ocean/seagrass.lua (seagrass).
2022-03-29 13:54:51 +03:00
|
|
|
groups = {
|
|
|
|
handy = 1, hoey = 1, building_block = 1, fall_damage_add_percent = -80,
|
|
|
|
flammable = 2, fire_encouragement = 60, fire_flammability = 20,
|
|
|
|
compostability = 85
|
|
|
|
},
|
2017-02-16 22:44:53 +02:00
|
|
|
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
2019-12-15 00:42:17 +02:00
|
|
|
on_rotate = on_rotate,
|
2020-04-17 22:40:13 +03:00
|
|
|
_mcl_blast_resistance = 0.5,
|
2017-02-27 19:32:35 +02:00
|
|
|
_mcl_hardness = 0.5,
|
2017-02-16 22:44:53 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2021-05-29 17:12:33 +03:00
|
|
|
output = "mcl_farming:hay_block",
|
2017-02-16 22:44:53 +02:00
|
|
|
recipe = {
|
2021-05-29 17:12:33 +03:00
|
|
|
{"mcl_farming:wheat_item", "mcl_farming:wheat_item", "mcl_farming:wheat_item"},
|
|
|
|
{"mcl_farming:wheat_item", "mcl_farming:wheat_item", "mcl_farming:wheat_item"},
|
|
|
|
{"mcl_farming:wheat_item", "mcl_farming:wheat_item", "mcl_farming:wheat_item"},
|
2017-02-16 22:44:53 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2021-05-29 17:12:33 +03:00
|
|
|
output = "mcl_farming:wheat_item 9",
|
2017-02-16 22:44:53 +02:00
|
|
|
recipe = {
|
2021-05-29 17:12:33 +03:00
|
|
|
{"mcl_farming:hay_block"},
|
2017-02-16 22:44:53 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2017-03-21 05:56:16 +02:00
|
|
|
if minetest.get_modpath("doc") then
|
2017-04-01 05:41:59 +03:00
|
|
|
for i=2,7 do
|
2017-03-21 05:56:16 +02:00
|
|
|
doc.add_entry_alias("nodes", "mcl_farming:wheat_1", "nodes", "mcl_farming:wheat_"..i)
|
|
|
|
end
|
|
|
|
end
|