Organize mods into modpacks for better overview
46
mods/ITEMS/mcl_farming/README.txt
Normal file
|
@ -0,0 +1,46 @@
|
|||
===FARMING MOD for MINETEST-C55===
|
||||
by PilzAdam
|
||||
|
||||
Introduction:
|
||||
This mod adds farming to Minetest.
|
||||
|
||||
How to install:
|
||||
Unzip the archive an place it in minetest-base-directory/mods/minetest/
|
||||
if you have a windows client or a linux run-in-place client. If you have
|
||||
a linux system-wide instalation place it in ~/.minetest/mods/minetest/.
|
||||
If you want to install this mod only in one world create the folder
|
||||
worldmods/ in your worlddirectory.
|
||||
For further information or help see:
|
||||
http://wiki.minetest.com/wiki/Installing_Mods
|
||||
|
||||
How to use the mod:
|
||||
Craft a wood/stone/iron/gold/diamond hoe:
|
||||
material material
|
||||
stick
|
||||
stick
|
||||
Dig dirt with it and turn it to soil. Water the soil and plant the seeds
|
||||
you get by digging dirt with the hoe. Wait until the seeds are seasoned
|
||||
and harvest them. When harvesting you will get the product and new seeds.
|
||||
For further information or help see:
|
||||
http://minetest.net/forum/viewtopic.php?id=2787
|
||||
|
||||
License:
|
||||
Sourcecode: WTFPL (see below)
|
||||
Graphics: WTFPL (see below)
|
||||
|
||||
See also:
|
||||
http://minetest.net/
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
117
mods/ITEMS/mcl_farming/beetroot.lua
Normal file
|
@ -0,0 +1,117 @@
|
|||
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_0")
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:beetroot_0", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"mcl_farming_beetroot_0.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:beetroot_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = {
|
||||
items = {
|
||||
{ items = {"mcl_farming:beetroot_seeds"}, rarity = 5 },
|
||||
},
|
||||
},
|
||||
tiles = {"mcl_farming_beetroot_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:beetroot_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = {
|
||||
items = {
|
||||
{ items = {"mcl_farming:beetroot_seeds"}, rarity = 4 },
|
||||
},
|
||||
},
|
||||
tiles = {"farming_carrot_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.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_seeds 3"}, rarity = 4 },
|
||||
{ items = {"mcl_farming:beetroot_seeds 2"}, rarity = 4 },
|
||||
{ items = {"mcl_farming:beetroot_seeds 1"}, rarity = 4 },
|
||||
},
|
||||
},
|
||||
tiles = {"mcl_farming_beetroot_3.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.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_0", "mcl_farming:beetroot_1", "mcl_farming:beetroot_2"}, 68, 3)
|
93
mods/ITEMS/mcl_farming/carrots.lua
Normal file
|
@ -0,0 +1,93 @@
|
|||
minetest.register_node("mcl_farming:carrot_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "mcl_farming:carrot_item",
|
||||
tiles = {"farming_carrot_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:carrot_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "mcl_farming:carrot_item",
|
||||
tiles = {"farming_carrot_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:carrot_3", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "mcl_farming:carrot_item",
|
||||
tiles = {"farming_carrot_3.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:carrot", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_carrot_4.png"},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{ items = {'mcl_farming:carrot_item 4'}, rarity = 5 },
|
||||
{ items = {'mcl_farming:carrot_item 3'}, rarity = 2 },
|
||||
{ items = {'mcl_farming:carrot_item 2'}, rarity = 2 },
|
||||
{ items = {'mcl_farming:carrot_item 1'} },
|
||||
}
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:carrot_item", {
|
||||
description = "Carrot",
|
||||
inventory_image = "farming_carrot.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
groups = { food = 2, eatable = 3 },
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:carrot_1")
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:carrot_item_gold", {
|
||||
description = "Golden Carrot",
|
||||
inventory_image = "farming_carrot_gold.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
groups = { brewitem = 1, food = 2, eatable = 3 },
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:carrot_item_gold",
|
||||
recipe = {
|
||||
{'mcl_core:gold_nugget', 'mcl_core:gold_nugget', 'mcl_core:gold_nugget'},
|
||||
{'mcl_core:gold_nugget', 'mcl_farming:carrot_item', 'mcl_core:gold_nugget'},
|
||||
{'mcl_core:gold_nugget', 'mcl_core:gold_nugget', 'mcl_core:gold_nugget'},
|
||||
}
|
||||
})
|
||||
|
||||
mcl_farming:add_plant("mcl_farming:carrot", {"mcl_farming:carrot_1", "mcl_farming:carrot_2", "mcl_farming:carrot_3"}, 50, 20)
|
5
mods/ITEMS/mcl_farming/depends.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
mcl_core
|
||||
mcl_sounds
|
||||
bucket
|
||||
mcl_wool
|
||||
mcl_torches
|
219
mods/ITEMS/mcl_farming/hoes.lua
Normal file
|
@ -0,0 +1,219 @@
|
|||
local function create_soil(pos, inv)
|
||||
if pos == nil then
|
||||
return false
|
||||
end
|
||||
local node = minetest.get_node(pos)
|
||||
local name = node.name
|
||||
local above = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})
|
||||
if minetest.get_item_group(name, "cultivatable") == 2 then
|
||||
if above.name == "air" then
|
||||
node.name = "mcl_farming:soil"
|
||||
minetest.set_node(pos, node)
|
||||
return true
|
||||
end
|
||||
elseif minetest.get_item_group(name, "cultivatable") == 1 then
|
||||
if above.name == "air" then
|
||||
node.name = "mcl_core:dirt"
|
||||
minetest.set_node(pos, node)
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_tool("mcl_farming:hoe_wood", {
|
||||
description = "Wood Hoe",
|
||||
inventory_image = "farming_tool_woodhoe.png",
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:add_wear(65535/60)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
groups = { tool=1 },
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 1,
|
||||
damage_groups = { fleshy = 1, }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_wood",
|
||||
recipe = {
|
||||
{"group:wood", "group:wood"},
|
||||
{"", "mcl_core:stick"},
|
||||
{"", "mcl_core:stick"}
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_wood",
|
||||
recipe = {
|
||||
{"group:wood", "group:wood"},
|
||||
{"mcl_core:stick", ""},
|
||||
{"mcl_core:stick", ""}
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "mcl_farming:hoe_wood",
|
||||
burntime = 10,
|
||||
})
|
||||
|
||||
minetest.register_tool("mcl_farming:hoe_stone", {
|
||||
description = "Stone Hoe",
|
||||
inventory_image = "farming_tool_stonehoe.png",
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:add_wear(65535/132)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
groups = { tool=1 },
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.5,
|
||||
damage_groups = { fleshy = 1, }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_stone",
|
||||
recipe = {
|
||||
{"mcl_core:cobble", "mcl_core:cobble"},
|
||||
{"", "mcl_core:stick"},
|
||||
{"", "mcl_core:stick"}
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_stone",
|
||||
recipe = {
|
||||
{"mcl_core:cobble", "mcl_core:cobble"},
|
||||
{"mcl_core:stick", ""},
|
||||
{"mcl_core:stick", ""}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_tool("mcl_farming:hoe_iron", {
|
||||
description = "Iron Hoe",
|
||||
inventory_image = "farming_tool_steelhoe.png",
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:add_wear(65535/251)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
groups = { tool=1 },
|
||||
tool_capabilities = {
|
||||
-- 1/3
|
||||
full_punch_interval = 0.33333333,
|
||||
damage_groups = { fleshy = 1, }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_iron",
|
||||
recipe = {
|
||||
{"mcl_core:iron_ingot", "mcl_core:iron_ingot"},
|
||||
{"", "mcl_core:stick"},
|
||||
{"", "mcl_core:stick"}
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_iron",
|
||||
recipe = {
|
||||
{"mcl_core:iron_ingot", "mcl_core:iron_ingot"},
|
||||
{"mcl_core:stick", ""},
|
||||
{"mcl_core:stick", ""}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mcl_core:iron_nugget",
|
||||
recipe = "mcl_farming:hoe_iron",
|
||||
cooktime = 10,
|
||||
})
|
||||
|
||||
minetest.register_tool("mcl_farming:hoe_gold", {
|
||||
description = "Golden Hoe",
|
||||
inventory_image = "farming_tool_goldhoe.png",
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:add_wear(65535/33)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
groups = { tool=1 },
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 1,
|
||||
damage_groups = { fleshy = 1, }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_gold",
|
||||
recipe = {
|
||||
{"mcl_core:gold_ingot", "mcl_core:gold_ingot"},
|
||||
{"", "mcl_core:stick"},
|
||||
{"", "mcl_core:stick"}
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_gold",
|
||||
recipe = {
|
||||
{"mcl_core:gold_ingot", "mcl_core:gold_ingot"},
|
||||
{"mcl_core:stick", ""},
|
||||
{"mcl_core:stick", ""}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mcl_core:gold_nugget",
|
||||
recipe = "mcl_farming:hoe_gold",
|
||||
cooktime = 10,
|
||||
})
|
||||
|
||||
minetest.register_tool("mcl_farming:hoe_diamond", {
|
||||
description = "Diamond Hoe",
|
||||
inventory_image = "farming_tool_diamondhoe.png",
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
if create_soil(pointed_thing.under, user:get_inventory()) then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:add_wear(65535/1562)
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
groups = { tool=1 },
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.25,
|
||||
damage_groups = { fleshy = 1, }
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_diamond",
|
||||
recipe = {
|
||||
{"mcl_core:diamond", "mcl_core:diamond"},
|
||||
{"", "mcl_core:stick"},
|
||||
{"", "mcl_core:stick"}
|
||||
}
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:hoe_diamond",
|
||||
recipe = {
|
||||
{"mcl_core:diamond", "mcl_core:diamond"},
|
||||
{"mcl_core:stick", ""},
|
||||
{"mcl_core:stick", ""}
|
||||
}
|
||||
})
|
98
mods/ITEMS/mcl_farming/init.lua
Normal file
|
@ -0,0 +1,98 @@
|
|||
local init = os.clock()
|
||||
mcl_farming = {}
|
||||
|
||||
function mcl_farming:add_plant(full_grown, names, interval, chance)
|
||||
minetest.register_abm({
|
||||
nodenames = names,
|
||||
interval = interval,
|
||||
chance = chance,
|
||||
action = function(pos, node)
|
||||
pos.y = pos.y-1
|
||||
if minetest.get_node(pos).name ~= "mcl_farming:soil_wet" and math.random(0, 9) > 0 then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y+1
|
||||
if not minetest.get_node_light(pos) then
|
||||
return
|
||||
end
|
||||
if minetest.get_node_light(pos) < 10 then
|
||||
return
|
||||
end
|
||||
local step = nil
|
||||
for i,name in ipairs(names) do
|
||||
if name == node.name then
|
||||
step = i
|
||||
break
|
||||
end
|
||||
end
|
||||
if step == nil then
|
||||
return
|
||||
end
|
||||
local new_node = {name=names[step+1]}
|
||||
if new_node.name == nil then
|
||||
new_node.name = full_grown
|
||||
end
|
||||
minetest.set_node(pos, new_node)
|
||||
end
|
||||
} )
|
||||
end
|
||||
|
||||
|
||||
function mcl_farming:place_seed(itemstack, placer, pointed_thing, plantname)
|
||||
local pt = pointed_thing
|
||||
if not pt then
|
||||
return
|
||||
end
|
||||
if pt.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = {x=pt.above.x, y=pt.above.y-1, z=pt.above.z}
|
||||
local farmland = minetest.get_node(pos)
|
||||
pos= {x=pt.above.x, y=pt.above.y, z=pt.above.z}
|
||||
local place_s = minetest.get_node(pos)
|
||||
|
||||
|
||||
if string.find(farmland.name, "mcl_farming:soil") and string.find(place_s.name, "air") then
|
||||
minetest.add_node(pos, {name=plantname})
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- ========= SOIL =========
|
||||
dofile(minetest.get_modpath("mcl_farming").."/soil.lua")
|
||||
|
||||
-- ========= HOES =========
|
||||
dofile(minetest.get_modpath("mcl_farming").."/hoes.lua")
|
||||
|
||||
-- ========= WHEAT =========
|
||||
dofile(minetest.get_modpath("mcl_farming").."/wheat.lua")
|
||||
|
||||
-- ========= PUMPKIN =========
|
||||
dofile(minetest.get_modpath("mcl_farming").."/pumpkin.lua")
|
||||
|
||||
-- ========= MELON =========
|
||||
dofile(minetest.get_modpath("mcl_farming").."/melon.lua")
|
||||
|
||||
-- ========= CARROT =========
|
||||
dofile(minetest.get_modpath("mcl_farming").."/carrots.lua")
|
||||
|
||||
-- ========= POTATOES =========
|
||||
dofile(minetest.get_modpath("mcl_farming").."/potatoes.lua")
|
||||
|
||||
-- ========= MUSHROOMS =========
|
||||
dofile(minetest.get_modpath("mcl_farming").."/mushrooms.lua")
|
||||
|
||||
-- ========= BEETROOT =========
|
||||
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))
|
289
mods/ITEMS/mcl_farming/melon.lua
Normal file
|
@ -0,0 +1,289 @@
|
|||
minetest.register_node("mcl_farming:melon", {
|
||||
description = "Melon",
|
||||
paramtype2 = "facedir",
|
||||
stack_max = 64,
|
||||
tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png", "farming_melon_side.png", "farming_melon_side.png", "farming_melon_side.png"},
|
||||
groups = {choppy=2, oddly_breakable_by_hand=2, building_block=1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{ items = {'mcl_farming:melon_item 7'}, rarity = 14 },
|
||||
{ items = {'mcl_farming:melon_item 6'}, rarity = 10 },
|
||||
{ items = {'mcl_farming:melon_item 5'}, rarity = 5 },
|
||||
{ items = {'mcl_farming:melon_item 4'}, rarity = 2 },
|
||||
{ items = {'mcl_farming:melon_item 3'} },
|
||||
}
|
||||
},
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, user)
|
||||
local have_change = 0
|
||||
for x=-1,1 do
|
||||
local p = {x=pos.x+x, y=pos.y, z=pos.z}
|
||||
local n = minetest.get_node(p)
|
||||
if string.find(n.name, "melontige_linked_") and have_change == 0 then
|
||||
have_change = 1
|
||||
minetest.add_node(p, {name="mcl_farming:melontige_unconnect"})
|
||||
end
|
||||
end
|
||||
if have_change == 0 then
|
||||
for z=-1,1 do
|
||||
local p = {x=pos.x, y=pos.y, z=pos.z+z}
|
||||
local n = minetest.get_node(p)
|
||||
if string.find(n.name, "melontige_linked_") and have_change == 0 then
|
||||
have_change = 1
|
||||
minetest.add_node(p, {name="mcl_farming:melontige_unconnect"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:melontige_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
tiles = {"farming_tige_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+6/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:melontige_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
tiles = {"farming_tige_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+9/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:melontige_unconnect", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_tige_end.png"},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:melontige_linked_r", {
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
|
||||
},
|
||||
tiles = {
|
||||
"farming_tige_connnect.png", --top
|
||||
"farming_tige_connnect.png", -- bottom
|
||||
"farming_tige_connnect.png", -- right
|
||||
"farming_tige_connnect.png", -- left
|
||||
"farming_tige_connnect.png", -- back
|
||||
"farming_tige_connnect.png^[transformFX90" --front
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:melontige_linked_l", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
|
||||
},
|
||||
tiles = {
|
||||
"farming_tige_connnect.png", --top
|
||||
"farming_tige_connnect.png", -- bottom
|
||||
"farming_tige_connnect.png", -- right
|
||||
"farming_tige_connnect.png", -- left
|
||||
"farming_tige_connnect.png^[transformFX90", -- back
|
||||
"farming_tige_connnect.png" --front
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:melontige_linked_t", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
|
||||
},
|
||||
tiles = {
|
||||
"farming_tige_connnect.png", --top
|
||||
"farming_tige_connnect.png", -- bottom
|
||||
"farming_tige_connnect.png^[transformFX90", -- right
|
||||
"farming_tige_connnect.png", -- left
|
||||
"farming_tige_connnect.png", -- back
|
||||
"farming_tige_connnect.png" --front
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:melontige_linked_b", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
|
||||
},
|
||||
tiles = {
|
||||
"farming_tige_connnect.png", --top
|
||||
"farming_tige_connnect.png", -- bottom
|
||||
"farming_tige_connnect.png", -- right
|
||||
"farming_tige_connnect.png^[transformFX90", -- left
|
||||
"farming_tige_connnect.png", -- back
|
||||
"farming_tige_connnect.png" --front
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:melon_seeds", {
|
||||
description = "Melon Seeds",
|
||||
stack_max = 64,
|
||||
groups = { craftitem=1 },
|
||||
inventory_image = "farming_melon_seed.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:melontige_1")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:melon_item", {
|
||||
description = "Melon",
|
||||
stack_max = 64,
|
||||
inventory_image = "farming_melon.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = { food = 2, eatable = 2 },
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"mcl_farming:melontige_unconnect"},
|
||||
neighbors = {"air"},
|
||||
interval = 25,
|
||||
chance = 15,
|
||||
action = function(pos)
|
||||
local have_change = 0
|
||||
local newpos = {x=pos.x, y=pos.y, z=pos.z}
|
||||
local light = minetest.get_node_light(pos)
|
||||
if light or light > 10 then
|
||||
for x=-1,1 do
|
||||
local p = {x=pos.x+x, y=pos.y-1, z=pos.z}
|
||||
newpos = {x=pos.x+x, y=pos.y, z=pos.z}
|
||||
local n = minetest.get_node(p)
|
||||
local nod = minetest.get_node(newpos)
|
||||
if n.name=="mcl_core:dirt_with_grass" and nod.name=="air" and have_change == 0
|
||||
or n.name=="mcl_core:dirt" and nod.name=="air" and have_change == 0
|
||||
or string.find(n.name, "mcl_farming:soil") and nod.name=="air" and have_change == 0 then
|
||||
have_change = 1
|
||||
minetest.add_node(newpos, {name="mcl_farming:melon"})
|
||||
if x == 1 then
|
||||
minetest.add_node(pos, {name="mcl_farming:melontige_linked_r" })
|
||||
else
|
||||
minetest.add_node(pos, {name="mcl_farming:melontige_linked_l"})
|
||||
end
|
||||
end
|
||||
end
|
||||
if have_change == 0 then
|
||||
for z=-1,1 do
|
||||
local p = {x=pos.x, y=pos.y-1, z=pos.z+z}
|
||||
newpos = {x=pos.x, y=pos.y, z=pos.z+z}
|
||||
local n = minetest.get_node(p)
|
||||
local nod2 = minetest.get_node(newpos)
|
||||
if n.name=="mcl_core:dirt_with_grass" and nod2.name=="air" and have_change == 0
|
||||
or n.name=="mcl_core:dirt" and nod2.name=="air" and have_change == 0
|
||||
or string.find(n.name, "mcl_farming:soil") and nod2.name=="air" and have_change == 0 then
|
||||
have_change = 1
|
||||
minetest.add_node(newpos, {name="mcl_farming:melon"})
|
||||
if z == 1 then
|
||||
minetest.add_node(pos, {name="mcl_farming:melontige_linked_t" })
|
||||
else
|
||||
minetest.add_node(pos, {name="mcl_farming:melontige_linked_b" })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
mcl_farming:add_plant("mcl_farming:melontige_unconnect", {"mcl_farming:melontige_1", "mcl_farming:melontige_2"}, 50, 20)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:melon_seeds",
|
||||
recipe = {{"mcl_farming:melon_item"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'mcl_farming:melon',
|
||||
recipe = {
|
||||
{'mcl_farming:melon_item', 'mcl_farming:melon_item', 'mcl_farming:melon_item'},
|
||||
{'mcl_farming:melon_item', 'mcl_farming:melon_item', 'mcl_farming:melon_item'},
|
||||
{'mcl_farming:melon_item', 'mcl_farming:melon_item', 'mcl_farming:melon_item'},
|
||||
}
|
||||
})
|
||||
|
||||
|
1
mods/ITEMS/mcl_farming/mod.conf
Normal file
|
@ -0,0 +1 @@
|
|||
name = mcl_farming
|
48
mods/ITEMS/mcl_farming/mushrooms.lua
Normal file
|
@ -0,0 +1,48 @@
|
|||
minetest.register_node("mcl_farming:mushroom_brown", {
|
||||
description = "Brown Mushroom",
|
||||
drawtype = "plantlike",
|
||||
tiles = { "farming_mushroom_brown.png" },
|
||||
inventory_image = "farming_mushroom_brown.png",
|
||||
wield_image = "farming_mushroom_brown.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,deco_block=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
light_source = 1,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.15, -0.5, -0.15, 0.15, 0.015, 0.15 },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:mushroom_red", {
|
||||
description = "Red Mushroom",
|
||||
drawtype = "plantlike",
|
||||
tiles = { "farming_mushroom_red.png" },
|
||||
inventory_image = "farming_mushroom_red.png",
|
||||
wield_image = "farming_mushroom_red.png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = {dig_immediate=3,mushroom=1,attached_node=1,dig_by_water=1,deco_block=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.15, -0.5, -0.15, 0.15, 0.015, 0.15 },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:mushroom_stew", {
|
||||
description = "Mushroom Stew",
|
||||
inventory_image = "farming_mushroom_stew.png",
|
||||
on_use = minetest.item_eat(6, "mcl_core:bowl"),
|
||||
groups = { food = 2, eatable = 6 },
|
||||
stack_max = 1,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "mcl_farming:mushroom_stew",
|
||||
recipe = {'mcl_core:bowl', 'mcl_farming:mushroom_brown', 'mcl_farming:mushroom_red'}
|
||||
})
|
84
mods/ITEMS/mcl_farming/potatoes.lua
Normal file
|
@ -0,0 +1,84 @@
|
|||
minetest.register_node("mcl_farming:potato_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "mcl_farming:potato_item",
|
||||
tiles = {"farming_potato_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:potato_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "mcl_farming:potato_item",
|
||||
tiles = {"farming_potato_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:potato", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_potato_3.png"},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{ items = {'mcl_farming:potato_item 2'} },
|
||||
{ items = {'mcl_farming:potato_item 3'}, rarity = 2 },
|
||||
{ items = {'mcl_farming:potato_item 4'}, rarity = 5 }
|
||||
}
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:potato_item", {
|
||||
description = "Potato",
|
||||
inventory_image = "farming_potato.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
groups = { food = 2, eatable = 1 },
|
||||
stack_max = 64,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:potato_1")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:potato_item_baked", {
|
||||
description = "Baked Potato",
|
||||
stack_max = 64,
|
||||
inventory_image = "farming_potato_baked.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
groups = { food = 2, eatable = 6 },
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:potato_item_poison", {
|
||||
description = "Poisonous Potato",
|
||||
stack_max = 64,
|
||||
inventory_image = "farming_potato_poison.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = { food = 2, eatable = 2 },
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mcl_farming:potato_item_baked",
|
||||
recipe = "mcl_farming:potato_item",
|
||||
cooktime = 10,
|
||||
})
|
||||
|
||||
mcl_farming:add_plant("mcl_farming:potato", {"mcl_farming:potato_1", "mcl_farming:potato_2"}, 50, 20)
|
298
mods/ITEMS/mcl_farming/pumpkin.lua
Normal file
|
@ -0,0 +1,298 @@
|
|||
minetest.register_craftitem("mcl_farming:pumpkin_seeds", {
|
||||
description = "Pumpkin Seeds",
|
||||
stack_max = 64,
|
||||
inventory_image = "farming_pumpkin_seed.png",
|
||||
groups = { craftitem=1 },
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:pumpkin_1")
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:pumpkin_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
tiles = {"farming_tige_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+6/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:pumpkin_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
tiles = {"farming_tige_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+9/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("mcl_farming:pumpkin_face", {
|
||||
description = "Pumpkin",
|
||||
stack_max = 64,
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face.png"},
|
||||
groups = {choppy=2, oddly_breakable_by_hand=2, building_block=1},
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, user)
|
||||
local have_change = 0
|
||||
for x=-1,1 do
|
||||
local p = {x=pos.x+x, y=pos.y, z=pos.z}
|
||||
local n = minetest.get_node(p)
|
||||
if string.find(n.name, "pumpkintige_linked_") and have_change == 0 then
|
||||
have_change = 1
|
||||
minetest.add_node(p, {name="mcl_farming:pumpkintige_unconnect"})
|
||||
end
|
||||
end
|
||||
if have_change == 0 then
|
||||
for z=-1,1 do
|
||||
local p = {x=pos.x, y=pos.y, z=pos.z+z}
|
||||
local n = minetest.get_node(p)
|
||||
if string.find(n.name, "pumpkintige_linked_") and have_change == 0 then
|
||||
have_change = 1
|
||||
minetest.add_node(p, {name="mcl_farming:pumpkintige_unconnect"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:pumpkintige_unconnect", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_tige_end.png"},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("mcl_farming:pumpkintige_linked_r", {
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
|
||||
},
|
||||
tiles = {
|
||||
"farming_tige_connnect.png", --top
|
||||
"farming_tige_connnect.png", -- bottom
|
||||
"farming_tige_connnect.png", -- right
|
||||
"farming_tige_connnect.png", -- left
|
||||
"farming_tige_connnect.png", -- back
|
||||
"farming_tige_connnect.png^[transformFX90" --front
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:pumpkintige_linked_l", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, 0, 0.5, 0.5, 0}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
|
||||
},
|
||||
tiles = {
|
||||
"farming_tige_connnect.png", --top
|
||||
"farming_tige_connnect.png", -- bottom
|
||||
"farming_tige_connnect.png", -- right
|
||||
"farming_tige_connnect.png", -- left
|
||||
"farming_tige_connnect.png^[transformFX90", -- back
|
||||
"farming_tige_connnect.png" --front
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:pumpkintige_linked_t", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
|
||||
},
|
||||
tiles = {
|
||||
"farming_tige_connnect.png", --top
|
||||
"farming_tige_connnect.png", -- bottom
|
||||
"farming_tige_connnect.png^[transformFX90", -- right
|
||||
"farming_tige_connnect.png", -- left
|
||||
"farming_tige_connnect.png", -- back
|
||||
"farming_tige_connnect.png" --front
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:pumpkintige_linked_b", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
drop = "",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, -0.5, -0.5, 0, 0.5, 0.5}, -- NodeBox1
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
|
||||
},
|
||||
tiles = {
|
||||
"farming_tige_connnect.png", --top
|
||||
"farming_tige_connnect.png", -- bottom
|
||||
"farming_tige_connnect.png", -- right
|
||||
"farming_tige_connnect.png^[transformFX90", -- left
|
||||
"farming_tige_connnect.png", -- back
|
||||
"farming_tige_connnect.png" --front
|
||||
},
|
||||
groups = {snappy=3, not_in_creative_inventory=1 ,dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
mcl_farming:add_plant("mcl_farming:pumpkintige_unconnect", {"mcl_farming:pumpkin_1", "mcl_farming:pumpkin_2"}, 80, 20)
|
||||
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"mcl_farming:pumpkintige_unconnect"},
|
||||
neighbors = {"air"},
|
||||
interval = 30,
|
||||
chance = 15,
|
||||
action = function(pos)
|
||||
local have_change = 0
|
||||
local newpos = {x=pos.x, y=pos.y, z=pos.z}
|
||||
local light = minetest.get_node_light(pos)
|
||||
if light or light > 10 then
|
||||
for x=-1,1 do
|
||||
local p = {x=pos.x+x, y=pos.y-1, z=pos.z}
|
||||
newpos = {x=pos.x+x, y=pos.y, z=pos.z}
|
||||
local n = minetest.get_node(p)
|
||||
local nod = minetest.get_node(newpos)
|
||||
if n.name=="mcl_core:dirt_with_grass" and nod.name=="air" and have_change == 0
|
||||
or n.name=="mcl_core:dirt" and nod.name=="air" and have_change == 0
|
||||
or string.find(n.name, "mcl_farming:soil") and nod.name=="air" and have_change == 0 then
|
||||
have_change = 1
|
||||
minetest.add_node(newpos, {name="mcl_farming:pumpkin_face"})
|
||||
if x == 1 then
|
||||
minetest.add_node(pos, {name="mcl_farming:pumpkintige_linked_r" })
|
||||
else
|
||||
minetest.add_node(pos, {name="mcl_farming:pumpkintige_linked_l"})
|
||||
end
|
||||
end
|
||||
end
|
||||
if have_change == 0 then
|
||||
for z=-1,1 do
|
||||
local p = {x=pos.x, y=pos.y-1, z=pos.z+z}
|
||||
newpos = {x=pos.x, y=pos.y, z=pos.z+z}
|
||||
local n = minetest.get_node(p)
|
||||
local nod2 = minetest.get_node(newpos)
|
||||
if n.name=="mcl_core:dirt_with_grass" and nod2.name=="air" and have_change == 0
|
||||
or n.name=="mcl_core:dirt" and nod2.name=="air" and have_change == 0
|
||||
or string.find(n.name, "mcl_farming:soil") and nod2.name=="air" and have_change == 0 then
|
||||
have_change = 1
|
||||
minetest.add_node(newpos, {name="mcl_farming:pumpkin_face"})
|
||||
if z == 1 then
|
||||
minetest.add_node(pos, {name="mcl_farming:pumpkintige_linked_t" })
|
||||
else
|
||||
minetest.add_node(pos, {name="mcl_farming:pumpkintige_linked_b" })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_node("mcl_farming:pumpkin_face_light", {
|
||||
description = "Jack o'Lantern",
|
||||
stack_max = 64,
|
||||
paramtype2 = "facedir",
|
||||
-- Real light level: 15 (Minetest caps at 14)
|
||||
light_source = 14,
|
||||
tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face_light.png"},
|
||||
groups = {choppy=2, oddly_breakable_by_hand=2, building_block=1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:pumpkin_face_light",
|
||||
recipe = {{"mcl_farming:pumpkin_face"},
|
||||
{"mcl_torches:torch"}}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:pumpkin_seeds 4",
|
||||
recipe = {{"mcl_farming:pumpkin_face"}}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:pumpkin_pie", {
|
||||
description = "Pumpkin Pie",
|
||||
stack_max = 64,
|
||||
inventory_image = "mcl_farming_pumpkin_pie.png",
|
||||
wield_image = "mcl_farming_pumpkin_pie.png",
|
||||
on_use = minetest.item_eat(8),
|
||||
groups = { food = 2, eatable = 8 },
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "mcl_farming:pumpkin_pie",
|
||||
recipe = {"mcl_farming:pumpkin_face", "mcl_core:sugar", "mcl_throwing:egg"},
|
||||
})
|
45
mods/ITEMS/mcl_farming/soil.lua
Normal file
|
@ -0,0 +1,45 @@
|
|||
minetest.register_node("mcl_farming:soil", {
|
||||
tiles = {"farming_soil.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png"},
|
||||
description = "Farmland",
|
||||
drop = "mcl_core:dirt",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- 15/16 of the normal height
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
|
||||
}
|
||||
},
|
||||
groups = { crumbly=3, not_in_creative_inventory=1, soil=2, soil_sapling=1 },
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:soil_wet", {
|
||||
tiles = {"farming_soil_wet.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png"},
|
||||
description = "Hydrated Farmland",
|
||||
drop = "mcl_core:dirt",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
|
||||
}
|
||||
},
|
||||
groups = { crumbly=3, not_in_creative_inventory=1, soil=3, soil_sapling=1 },
|
||||
sounds = mcl_sounds.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"mcl_farming:soil"},
|
||||
interval = 15,
|
||||
chance = 3,
|
||||
action = function(pos, node)
|
||||
if minetest.find_node_near(pos, 3, {"mcl_core:water_source", "mcl_core:water_flowing"}) then
|
||||
node.name = "mcl_farming:soil_wet"
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
BIN
mods/ITEMS/mcl_farming/textures/farming_bread.png
Normal file
After Width: | Height: | Size: 289 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_carrot.png
Normal file
After Width: | Height: | Size: 307 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_carrot_1.png
Normal file
After Width: | Height: | Size: 153 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_carrot_2.png
Normal file
After Width: | Height: | Size: 200 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_carrot_3.png
Normal file
After Width: | Height: | Size: 270 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_carrot_4.png
Normal file
After Width: | Height: | Size: 462 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_carrot_gold.png
Normal file
After Width: | Height: | Size: 266 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_cookie.png
Normal file
After Width: | Height: | Size: 314 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_melon.png
Normal file
After Width: | Height: | Size: 360 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_melon_seed.png
Normal file
After Width: | Height: | Size: 190 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_melon_side.png
Normal file
After Width: | Height: | Size: 622 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_melon_top.png
Normal file
After Width: | Height: | Size: 490 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_mushroom_brown.png
Normal file
After Width: | Height: | Size: 169 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_mushroom_red.png
Normal file
After Width: | Height: | Size: 205 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_mushroom_stew.png
Normal file
After Width: | Height: | Size: 273 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_potato.png
Normal file
After Width: | Height: | Size: 338 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_potato_1.png
Normal file
After Width: | Height: | Size: 200 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_potato_2.png
Normal file
After Width: | Height: | Size: 270 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_potato_3.png
Normal file
After Width: | Height: | Size: 374 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_potato_baked.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_potato_poison.png
Normal file
After Width: | Height: | Size: 422 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_pumpkin_face.png
Normal file
After Width: | Height: | Size: 337 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_pumpkin_face_light.png
Normal file
After Width: | Height: | Size: 1 KiB |
BIN
mods/ITEMS/mcl_farming/textures/farming_pumpkin_seed.png
Normal file
After Width: | Height: | Size: 195 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_pumpkin_side.png
Normal file
After Width: | Height: | Size: 267 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_pumpkin_top.png
Normal file
After Width: | Height: | Size: 395 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_soil.png
Normal file
After Width: | Height: | Size: 374 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_soil_wet.png
Normal file
After Width: | Height: | Size: 374 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_tige_1.png
Normal file
After Width: | Height: | Size: 156 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_tige_2.png
Normal file
After Width: | Height: | Size: 307 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_tige_connnect.png
Normal file
After Width: | Height: | Size: 294 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_tige_end.png
Normal file
After Width: | Height: | Size: 363 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_tool_diamondhoe.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_tool_goldhoe.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_tool_steelhoe.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_tool_stonehoe.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_tool_woodhoe.png
Normal file
After Width: | Height: | Size: 234 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_wheat.png
Normal file
After Width: | Height: | Size: 842 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_wheat_1.png
Normal file
After Width: | Height: | Size: 229 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_wheat_2.png
Normal file
After Width: | Height: | Size: 625 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_wheat_3.png
Normal file
After Width: | Height: | Size: 748 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_wheat_harvested.png
Normal file
After Width: | Height: | Size: 390 B |
BIN
mods/ITEMS/mcl_farming/textures/farming_wheat_seed.png
Normal file
After Width: | Height: | Size: 209 B |
BIN
mods/ITEMS/mcl_farming/textures/mcl_farming_beetroot.png
Normal file
After Width: | Height: | Size: 705 B |
BIN
mods/ITEMS/mcl_farming/textures/mcl_farming_beetroot_0.png
Normal file
After Width: | Height: | Size: 274 B |
BIN
mods/ITEMS/mcl_farming/textures/mcl_farming_beetroot_1.png
Normal file
After Width: | Height: | Size: 315 B |
BIN
mods/ITEMS/mcl_farming/textures/mcl_farming_beetroot_2.png
Normal file
After Width: | Height: | Size: 448 B |
BIN
mods/ITEMS/mcl_farming/textures/mcl_farming_beetroot_3.png
Normal file
After Width: | Height: | Size: 667 B |
BIN
mods/ITEMS/mcl_farming/textures/mcl_farming_beetroot_seeds.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
mods/ITEMS/mcl_farming/textures/mcl_farming_beetroot_soup.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
mods/ITEMS/mcl_farming/textures/mcl_farming_pumpkin_pie.png
Normal file
After Width: | Height: | Size: 481 B |
162
mods/ITEMS/mcl_farming/wheat.lua
Normal file
|
@ -0,0 +1,162 @@
|
|||
minetest.register_craftitem("mcl_farming:wheat_seeds", {
|
||||
description = "Wheat Seeds",
|
||||
groups = { craftitem=1 },
|
||||
inventory_image = "farming_wheat_seed.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_farming:wheat_1")
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:wheat_1", {
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
drop = "mcl_farming:wheat_seeds",
|
||||
tiles = {"farming_wheat_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.125, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1, dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.5, -0.3125, 0.375, 0.5}, -- NodeBox1
|
||||
{0.3125, -0.5, -0.5, 0.3125, 0.375, 0.5}, -- NodeBox2
|
||||
{-0.5, -0.5, 0.375, 0.5, 0.375, 0.375}, -- NodeBox3
|
||||
{-0.5, -0.5, -0.25, 0.5, 0.375, -0.25}, -- NodeBox4
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:wheat_2", {
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
drop = "mcl_farming:wheat_seeds",
|
||||
tiles = {"farming_wheat_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1, dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.5, -0.3125, 0.375, 0.5}, -- NodeBox1
|
||||
{0.3125, -0.5, -0.5, 0.3125, 0.375, 0.5}, -- NodeBox2
|
||||
{-0.5, -0.5, 0.375, 0.5, 0.375, 0.375}, -- NodeBox3
|
||||
{-0.5, -0.5, -0.25, 0.5, 0.375, -0.25}, -- NodeBox4
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:wheat_3", {
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
drop = "mcl_farming:wheat_seeds",
|
||||
tiles = {"farming_wheat_3.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.25, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1, dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.5, -0.3125, 0.375, 0.5}, -- NodeBox1
|
||||
{0.3125, -0.5, -0.5, 0.3125, 0.375, 0.5}, -- NodeBox2
|
||||
{-0.5, -0.5, 0.375, 0.5, 0.375, 0.375}, -- NodeBox3
|
||||
{-0.5, -0.5, -0.25, 0.5, 0.375, -0.25}, -- NodeBox4
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("mcl_farming:wheat", {
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
tiles = {"farming_wheat.png"},
|
||||
drop = {
|
||||
max_items = 4,
|
||||
items = {
|
||||
{ items = {'mcl_farming:wheat_seeds'} },
|
||||
{ items = {'mcl_farming:wheat_seeds'}, rarity = 2},
|
||||
{ items = {'mcl_farming:wheat_seeds'}, rarity = 5},
|
||||
{ items = {'mcl_farming:wheat_item'} }
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.35, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {dig_immediate=3, not_in_creative_inventory=1, dig_by_water=1},
|
||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.5, -0.3125, 0.375, 0.5}, -- NodeBox1
|
||||
{0.3125, -0.5, -0.5, 0.3125, 0.375, 0.5}, -- NodeBox2
|
||||
{-0.5, -0.5, 0.375, 0.5, 0.375, 0.375}, -- NodeBox3
|
||||
{-0.5, -0.5, -0.25, 0.5, 0.375, -0.25}, -- NodeBox4
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
mcl_farming:add_plant("mcl_farming:wheat", {"mcl_farming:wheat_1", "mcl_farming:wheat_2", "mcl_farming:wheat_3"}, 50, 20)
|
||||
|
||||
minetest.register_craftitem("mcl_farming:wheat_item", {
|
||||
description = "Wheat",
|
||||
inventory_image = "farming_wheat_harvested.png",
|
||||
groups = { craftitem = 1 },
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:bread",
|
||||
recipe = {
|
||||
{'mcl_farming:wheat_item', 'mcl_farming:wheat_item', 'mcl_farming:wheat_item'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mcl_farming:cookie 8",
|
||||
recipe = {
|
||||
{'mcl_farming:wheat_item', 'mcl_dye:brown', 'mcl_farming:wheat_item'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("mcl_farming:cookie", {
|
||||
description = "Cookie",
|
||||
inventory_image = "farming_cookie.png",
|
||||
groups = {food=2, eatable=2},
|
||||
on_use = minetest.item_eat(2)
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craftitem("mcl_farming:bread", {
|
||||
description = "Bread",
|
||||
inventory_image = "farming_bread.png",
|
||||
groups = {food=2, eatable=5},
|
||||
on_use = minetest.item_eat(5)
|
||||
})
|
||||
|