restructure bee mod. fix honeycomb recipe bug reported by noodles. add logo for game.

master
FreeGamers 2020-06-06 03:12:55 -05:00
parent 95413d0b64
commit e93a598839
410 changed files with 9051 additions and 549 deletions

BIN
menu/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

61
mods/bees/crafting.lua Normal file
View File

@ -0,0 +1,61 @@
-- Register the recipe for the honey extractor.
minetest.register_craft({
output = 'bees:extractor',
recipe = {
{'','default:steel_ingot',''},
{'default:steel_ingot','default:stick','default:steel_ingot'},
{'default:mese_crystal','default:steel_ingot','default:mese_crystal'},
}
})
-- Register the recipe for the hive smoker.
minetest.register_craft({
output = 'bees:smoker',
recipe = {
{'default:steel_ingot', 'wool:red', ''},
{'', 'default:torch', ''},
{'', 'default:steel_ingot',''},
}
})
-- Register the recipe for artificial bee hive.
minetest.register_craft({
output = 'bees:hive_artificial',
recipe = {
{'group:wood','group:wood','group:wood'},
{'group:wood','default:stick','group:wood'},
{'group:wood','default:stick','group:wood'},
}
})
-- Register the recipe for bee hive grafting tool.
minetest.register_craft({
output = 'bees:grafting_tool',
recipe = {
{'', '', 'default:steel_ingot'},
{'', 'default:stick', ''},
{'', '', ''},
}
})
-- Register the recipe for empty hive frames.
minetest.register_craft({
output = 'bees:frame_empty',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'default:stick', 'default:stick', 'default:stick'},
{'default:stick', 'default:stick', 'default:stick'},
}
})
-- Register the recipe for the honeycomb block.
minetest.register_craft({
output = "bees:honeycomb 8",
recipe = {
{"bees:honeycomb_block"},
}
})
-- Register the recipe for honeycombs --> honeycomb_block.
minetest.register_craft({
output = "bees:honeycomb_block",
recipe = {
{"bees:honeycomb", "bees:honeycomb", "bees:honeycomb"},
{"bees:honeycomb", "", "bees:honeycomb"},
{"bees:honeycomb", "bees:honeycomb", "bees:honeycomb"},
}
})

38
mods/bees/craftitems.lua Normal file
View File

@ -0,0 +1,38 @@
-- Register the empty hive frame.
minetest.register_craftitem('bees:frame_empty', {
description = 'Empty Hive Frame',
inventory_image = 'bees_frame_empty.png',
stack_max = 24,
})
-- Register the full hive frame.
minetest.register_craftitem('bees:frame_full', {
description = 'Filled Hive Frame',
inventory_image = 'bees_frame_full.png',
stack_max = 12,
})
-- Register the bottle of honey.
minetest.register_craftitem('bees:bottle_honey', {
description = 'Bottle of Honey',
inventory_image = 'bees_bottle_honey.png',
stack_max = 12,
on_use = minetest.item_eat(3, "vessels:glass_bottle"),
})
-- Register Bees Wax.
minetest.register_craftitem('bees:wax', {
description = 'Bees Wax',
inventory_image = 'bees_wax.png',
stack_max = 48,
})
-- Register honeycomb.
minetest.register_craftitem('bees:honeycomb', {
description = 'Honeycomb',
inventory_image = 'bees_honeycomb.png',
on_use = minetest.item_eat(2),
stack_max = 8,
})
-- Register Queen Bee.
minetest.register_craftitem('bees:queen', {
description = 'Queen Bee',
inventory_image = 'bees_particle_bee.png',
stack_max = 1,
})

View File

@ -51,403 +51,6 @@
end
end
--NODES
minetest.register_node('bees:extractor', {
description = 'Honey Extractor Machine',
tiles = {"bees_extractor_top.png", "bees_extractor_bottom.png", "bees_extractor_side.png", "bees_extractor_side.png", "bees_extractor_side.png", "bees_extractor_front.png"},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
place_param2 = 0,
groups = {choppy=2,oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.4375, 0.4375, 0, 0.4375},
{-0.375, -0.0625, -0.375, 0.375, 0.5, 0.375},
{-0.4375, 0.375, -0.4375, 0.4375, 0.4375, 0.4375},
{0.375, 0, -0.4375, 0.4375, 0.4375, -0.375},
{-0.4375, 0, -0.4375, -0.375, 0.4375, -0.375},
{-0.4375, 0, 0.375, -0.375, 0.4375, 0.4375},
{0.375, 0, 0.375, 0.4375, 0.4375, 0.4375},
},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
on_construct = function(pos, node)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local pos = pos.x..','..pos.y..','..pos.z
inv:set_size('frames_filled' ,1)
inv:set_size('frames_emptied' ,1)
inv:set_size('bottles_empty' ,1)
inv:set_size('bottles_full' ,1)
inv:set_size('wax',1)
meta:set_string('formspec',
'size[8,9]'..
--input
'list[nodemeta:'..pos..';frames_filled;2,1;1,1;]'..
'list[nodemeta:'..pos..';bottles_empty;2,3;1,1;]'..
--output
'list[nodemeta:'..pos..';frames_emptied;5,0.5;1,1;]'..
'list[nodemeta:'..pos..';wax;5,2;1,1;]'..
'list[nodemeta:'..pos..';bottles_full;5,3.5;1,1;]'..
--player inventory
'list[current_player;main;0,5;8,4;]'
)
end,
on_timer = function(pos, node)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if not inv:contains_item('frames_filled','bees:frame_full') or not inv:contains_item('bottles_empty','vessels:glass_bottle') then
return
end
if inv:room_for_item('frames_emptied', 'bees:frame_empty')
and inv:room_for_item('wax','bees:wax')
and inv:room_for_item('bottles_full', 'bees:bottle_honey') then
--add to output
inv:add_item('frames_emptied', 'bees:frame_empty')
inv:add_item('wax', 'bees:wax')
inv:add_item('bottles_full', 'bees:bottle_honey')
--remove from input
inv:remove_item('bottles_empty','vessels:glass_bottle')
inv:remove_item('frames_filled','bees:frame_full')
local p = {x=pos.x+math.random()-0.5, y=pos.y+math.random()-0.5, z=pos.z+math.random()-0.5}
--wax flying all over the place
minetest.add_particle({
pos = {x=pos.x, y=pos.y, z=pos.z},
vel = {x=math.random(-4,4),y=math.random(8),z=math.random(-4,4)},
acc = {x=0,y=-6,z=0},
expirationtime = 2,
size = math.random(1,3),
collisiondetection = false,
texture = 'bees_wax_particle.png',
})
local timer = minetest.get_node_timer(pos)
timer:start(5)
else
local timer = minetest.get_node_timer(pos)
timer:start(1) -- Try again in 1 second
end
end,
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if stack:get_name() == "bees:frame_full" then
if inv:is_empty("frames_filled") then
timer:start(5)
end
return inv:add_item("frames_filled",stack)
elseif stack:get_name() == "vessels:glass_bottle" then
if inv:is_empty("bottles_empty") then
timer:start(5)
end
return inv:add_item("bottles_empty",stack)
end
return stack
end,
can_insert = function(pos,node,stack,direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if stack:get_name() == "bees:frame_full" then
return inv:room_for_item("frames_filled",stack)
elseif stack:get_name() == "vessels:glass_bottle" then
return inv:room_for_item("bottles_empty",stack)
end
return false
end,
input_inventory = {"frames_emptied", "bottles_full", "wax"},
connect_sides = {left=1, right=1, back=1, front=1, bottom=1, top=1}
},
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:get_stack(listname, 1):get_count() == stack:get_count() then -- inv was empty -> start the timer
timer:start(5) --create a honey bottle and empty frame and wax every 5 seconds
end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if (listname == 'bottles_empty' and stack:get_name() == 'vessels:glass_bottle') or (listname == 'frames_filled' and stack:get_name() == 'bees:frame_full') then
return stack:get_count()
else
return 0
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
return 0
end,
})
minetest.register_node('bees:bees', {
description = 'Flying Bees',
drawtype = 'plantlike',
paramtype = 'light',
groups = { not_in_creative_inventory=1 },
tiles = {
{
name='bees_strip.png',
animation={type='vertical_frames', aspect_w=16,aspect_h=16, length=2.0}
}
},
damage_per_second = 1,
walkable = false,
buildable_to = true,
pointable = false,
on_punch = function(pos, node, puncher)
local health = puncher:get_hp()
puncher:set_hp(health-2)
end,
})
minetest.register_node('bees:hive_wild', {
description = 'Wild Bee Hive',
tiles = {"bees_hive_wild.png"}, --texture from church_candles.
drawtype = "plantlike",
paramtype = 'light',
walkable = true,
drop = {
max_items = 6,
items = {
{ items = {'bees:honeycomb'}, rarity = 5}
}
},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,attached_node=1},
on_timer = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer= minetest.get_node_timer(pos)
local rad = 10
local minp = {x=pos.x-rad, y=pos.y-rad, z=pos.z-rad}
local maxp = {x=pos.x+rad, y=pos.y+rad, z=pos.z+rad}
local flowers = minetest.find_nodes_in_area(minp, maxp, 'group:flower')
if #flowers == 0 then
inv:set_stack('queen', 1, '')
meta:set_string('infotext', 'This hive colony died! Not enough flowers in area.')
return
end --not any flowers nearby The queen dies!
if #flowers < 3 then return end --requires 2 or more flowers before can make honey
local flower = flowers[math.random(#flowers)]
bees.polinate_flower(flower, minetest.get_node(flower).name)
local stacks = inv:get_list('combs')
for k, v in pairs(stacks) do
if inv:get_stack('combs', k):is_empty() then --then replace that with a full one and reset pro..
inv:set_stack('combs',k,'bees:honeycomb')
timer:start(1000/#flowers)
return
end
end
--what to do if all combs are filled
end,
on_construct = function(pos)
minetest.get_node(pos).param2 = 0
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
meta:set_int('agressive', 1)
timer:start(100+math.random(100))
inv:set_size('queen', 1)
inv:set_size('combs', 5)
inv:set_stack('queen', 1, 'bees:queen')
for i=1,math.random(3) do
inv:set_stack('combs', i, 'bees:honeycomb')
end
end,
on_punch = function(pos, node, puncher)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:contains_item('queen','bees:queen') then
local health = puncher:get_hp()
puncher:set_hp(health-4)
end
end,
on_metadata_inventory_take = function(pos, listname, index, stack, taker)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer= minetest.get_node_timer(pos)
if listname == 'combs' and inv:contains_item('queen', 'bees:queen') then
local health = taker:get_hp()
timer:start(10)
taker:set_hp(health-2)
end
end,
on_metadata_inventory_put = function(pos, listname, index, stack, taker) --restart the colony by adding a queen
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(10)
end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if listname == 'queen' and stack:get_name() == 'bees:queen' then
return 1
else
return 0
end
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.show_formspec(
clicker:get_player_name(),
'bees:hive_artificial',
formspecs.hive_wild(pos, (itemstack:get_name() == 'bees:grafting_tool'))
)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int('agressive') == 1 and inv:contains_item('queen', 'bees:queen') then
local health = clicker:get_hp()
clicker:set_hp(health-4)
else
meta:set_int('agressive', 1)
end
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:is_empty('queen') and inv:is_empty('combs') then
return true
else
return false
end
end,
after_dig_node = function(pos, oldnode, oldmetadata, user)
local wielded if user:get_wielded_item() ~= nil then wielded = user:get_wielded_item() else return end
if 'bees:grafting_tool' == wielded:get_name() then
local inv = user:get_inventory()
if inv then
inv:add_item('main', ItemStack('bees:queen'))
end
end
end
})
minetest.register_node('bees:hive_artificial', {
description = 'Bee Hive',
tiles = {'default_wood.png','default_wood.png','default_wood.png', 'default_wood.png','default_wood.png','bees_hive_artificial.png'},
drawtype = 'nodebox',
paramtype = 'light',
paramtype2 = 'facedir',
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = 'fixed',
fixed = {
{-4/8, 2/8, -4/8, 4/8, 3/8, 4/8},
{-3/8, -4/8, -2/8, 3/8, 2/8, 3/8},
{-3/8, 0/8, -3/8, 3/8, 2/8, -2/8},
{-3/8, -4/8, -3/8, 3/8, -1/8, -2/8},
{-3/8, -1/8, -3/8, -1/8, 0/8, -2/8},
{1/8, -1/8, -3/8, 3/8, 0/8, -2/8},
}
},
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
meta:set_int('agressive', 1)
inv:set_size('queen', 1)
inv:set_size('frames', 8)
meta:set_string('infotext','Requires a queen bee to function.')
end,
on_rightclick = function(pos, node, clicker, itemstack)
minetest.show_formspec(
clicker:get_player_name(),
'bees:hive_artificial',
formspecs.hive_artificial(pos)
)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int('agressive') == 1 and inv:contains_item('queen', 'bees:queen') then
local health = clicker:get_hp()
clicker:set_hp(health-4)
else
meta:set_int('agressive', 1)
end
end,
on_timer = function(pos,elapsed)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if inv:contains_item('queen', 'bees:queen') then
if inv:contains_item('frames', 'bees:frame_empty') then
timer:start(30)
local rad = 10
local minp = {x=pos.x-rad, y=pos.y-rad, z=pos.z-rad}
local maxp = {x=pos.x+rad, y=pos.y+rad, z=pos.z+rad}
local flowers = minetest.find_nodes_in_area(minp, maxp, 'group:flower')
local progress = meta:get_int('progress')
progress = progress + #flowers
meta:set_int('progress', progress)
if progress > 1000 then
local flower = flowers[math.random(#flowers)]
bees.polinate_flower(flower, minetest.get_node(flower).name)
local stacks = inv:get_list('frames')
for k, v in pairs(stacks) do
if inv:get_stack('frames', k):get_name() == 'bees:frame_empty' then
meta:set_int('progress', 0)
inv:set_stack('frames',k,'bees:frame_full')
return
end
end
else
meta:set_string('infotext', 'Progress: '..progress..'+'..#flowers..'/1000')
end
else
meta:set_string('infotext', 'Hive does not have empty frame(s)!')
timer:stop()
end
end
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
if listname == 'queen' then
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
meta:set_string('infotext','Hive requires a queen bee to function!')
timer:stop()
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local inv = minetest.get_meta(pos):get_inventory()
if from_list == to_list then
if inv:get_stack(to_list, to_index):is_empty() then
return 1
else
return 0
end
else
return 0
end
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if listname == 'queen' or listname == 'frames' then
meta:set_string('queen', stack:get_name())
meta:set_string('infotext','A queen bee is inserted. Add empty frames!');
if inv:contains_item('frames', 'bees:frame_empty') then
timer:start(30)
meta:set_string('infotext','Bees are settling in!');
end
end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if not minetest.get_meta(pos):get_inventory():get_stack(listname, index):is_empty() then return 0 end
if listname == 'queen' then
if stack:get_name():match('bees:queen*') then
return 1
end
elseif listname == 'frames' then
if stack:get_name() == ('bees:frame_empty') then
return 1
end
end
return 0
end,
})
--ABMS
minetest.register_abm({ --particles
@ -504,153 +107,10 @@
end,
})
--ITEMS
minetest.register_craftitem('bees:frame_empty', {
description = 'Empty Hive Frame',
inventory_image = 'bees_frame_empty.png',
stack_max = 24,
})
-- Load other modules for the mod.
local default_path = minetest.get_modpath("bees")
minetest.register_craftitem('bees:frame_full', {
description = 'Filled Hive Frame',
inventory_image = 'bees_frame_full.png',
stack_max = 12,
})
minetest.register_craftitem('bees:bottle_honey', {
description = 'Honey Bottle',
inventory_image = 'bees_bottle_honey.png',
stack_max = 12,
on_use = minetest.item_eat(3, "vessels:glass_bottle"),
})
minetest.register_craftitem('bees:wax', {
description = 'Bees Wax',
inventory_image = 'bees_wax.png',
stack_max = 48,
})
minetest.register_craftitem('bees:honeycomb', {
description = 'Honeycomb',
inventory_image = 'bees_honeycomb.png',
on_use = minetest.item_eat(2),
stack_max = 8,
})
minetest.register_craftitem('bees:queen', {
description = 'Queen Bee',
inventory_image = 'bees_particle_bee.png',
stack_max = 1,
})
--CRAFTS
minetest.register_craft({
output = 'bees:extractor',
recipe = {
{'','default:steel_ingot',''},
{'default:steel_ingot','default:stick','default:steel_ingot'},
{'default:mese_crystal','default:steel_ingot','default:mese_crystal'},
}
})
minetest.register_craft({
output = 'bees:smoker',
recipe = {
{'default:steel_ingot', 'wool:red', ''},
{'', 'default:torch', ''},
{'', 'default:steel_ingot',''},
}
})
minetest.register_craft({
output = 'bees:hive_artificial',
recipe = {
{'group:wood','group:wood','group:wood'},
{'group:wood','default:stick','group:wood'},
{'group:wood','default:stick','group:wood'},
}
})
minetest.register_craft({
output = 'bees:grafting_tool',
recipe = {
{'', '', 'default:steel_ingot'},
{'', 'default:stick', ''},
{'', '', ''},
}
})
minetest.register_craft({
output = 'bees:frame_empty',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'default:stick', 'default:stick', 'default:stick'},
{'default:stick', 'default:stick', 'default:stick'},
}
})
--TOOLS
minetest.register_tool('bees:smoker', {
description = 'Hive Smoker',
inventory_image = 'bees_smoker.png',
tool_capabilities = {
full_punch_interval = 3.0,
max_drop_level=0,
damage_groups = {fleshy=2},
},
on_use = function(tool, user, node)
if node then
local pos = node.under
if pos then
for i=1,6 do
minetest.add_particle({
pos = {x=pos.x+math.random()-0.5, y=pos.y, z=pos.z+math.random()-0.5},
vel = {x=0,y=0.5+math.random(),z=0},
acc = {x=0,y=0,z=0},
expirationtime = 2+math.random(2.5),
size = math.random(3),
collisiondetection = false,
texture = 'tnt_smoke.png',
})
end
--tool:add_wear(2)
local meta = minetest.get_meta(pos)
meta:set_int('agressive', 0)
return nil
end
end
end,
})
minetest.register_tool('bees:grafting_tool', {
description = 'Beehive Grafting Tool',
inventory_image = 'bees_grafting_tool.png',
tool_capabilities = {
full_punch_interval = 3.0,
max_drop_level=0,
damage_groups = {fleshy=2},
},
})
--Honeycomb Block
minetest.register_node("bees:honeycomb_block", {
description = "Honeycomb Block",
inventory_image = "bees_honeycomb_block.png",
tiles = {"bees_honeycomb_block.png"},
groups = {oddly_breakable_by_hand = 3, dig_immediate = 1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_craft({
output = "bees:honeycomb 9",
recipe = {
{"bees:honeycomb_block"},
}
})
minetest.register_craft({
output = "church_candles:honeycomb_block",
recipe = {
{"bees:honeycomb", "bees:honeycomb", "bees:honeycomb"},
{"bees:honeycomb", "bees:honeycomb", "bees:honeycomb"},
{"bees:honeycomb", "bees:honeycomb", "bees:honeycomb"},
}
})
print('[Mod]Bees Loaded!')
dofile(default_path.."/crafting.lua")
dofile(default_path.."/craftitems.lua")
dofile(default_path.."/nodes.lua")
dofile(default_path.."/tools.lua")

405
mods/bees/nodes.lua Normal file
View File

@ -0,0 +1,405 @@
-- Nodes.
minetest.register_node('bees:extractor', {
description = 'Honey Extractor Machine',
tiles = {"bees_extractor_top.png", "bees_extractor_bottom.png", "bees_extractor_side.png", "bees_extractor_side.png", "bees_extractor_side.png", "bees_extractor_front.png"},
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
place_param2 = 0,
groups = {choppy=2,oddly_breakable_by_hand=2},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.4375, -0.5, -0.4375, 0.4375, 0, 0.4375},
{-0.375, -0.0625, -0.375, 0.375, 0.5, 0.375},
{-0.4375, 0.375, -0.4375, 0.4375, 0.4375, 0.4375},
{0.375, 0, -0.4375, 0.4375, 0.4375, -0.375},
{-0.4375, 0, -0.4375, -0.375, 0.4375, -0.375},
{-0.4375, 0, 0.375, -0.375, 0.4375, 0.4375},
{0.375, 0, 0.375, 0.4375, 0.4375, 0.4375},
},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
},
on_construct = function(pos, node)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local pos = pos.x..','..pos.y..','..pos.z
inv:set_size('frames_filled' ,1)
inv:set_size('frames_emptied' ,1)
inv:set_size('bottles_empty' ,1)
inv:set_size('bottles_full' ,1)
inv:set_size('wax',1)
meta:set_string('formspec',
'size[8,9]'..
--input
'list[nodemeta:'..pos..';frames_filled;2,1;1,1;]'..
'list[nodemeta:'..pos..';bottles_empty;2,3;1,1;]'..
--output
'list[nodemeta:'..pos..';frames_emptied;5,0.5;1,1;]'..
'list[nodemeta:'..pos..';wax;5,2;1,1;]'..
'list[nodemeta:'..pos..';bottles_full;5,3.5;1,1;]'..
--player inventory
'list[current_player;main;0,5;8,4;]'
)
end,
on_timer = function(pos, node)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if not inv:contains_item('frames_filled','bees:frame_full') or not inv:contains_item('bottles_empty','vessels:glass_bottle') then
return
end
if inv:room_for_item('frames_emptied', 'bees:frame_empty')
and inv:room_for_item('wax','bees:wax')
and inv:room_for_item('bottles_full', 'bees:bottle_honey') then
--add to output
inv:add_item('frames_emptied', 'bees:frame_empty')
inv:add_item('wax', 'bees:wax')
inv:add_item('bottles_full', 'bees:bottle_honey')
--remove from input
inv:remove_item('bottles_empty','vessels:glass_bottle')
inv:remove_item('frames_filled','bees:frame_full')
local p = {x=pos.x+math.random()-0.5, y=pos.y+math.random()-0.5, z=pos.z+math.random()-0.5}
--wax flying all over the place
minetest.add_particle({
pos = {x=pos.x, y=pos.y, z=pos.z},
vel = {x=math.random(-4,4),y=math.random(8),z=math.random(-4,4)},
acc = {x=0,y=-6,z=0},
expirationtime = 2,
size = math.random(1,3),
collisiondetection = false,
texture = 'bees_wax_particle.png',
})
local timer = minetest.get_node_timer(pos)
timer:start(5)
else
local timer = minetest.get_node_timer(pos)
timer:start(1) -- Try again in 1 second
end
end,
tube = {
insert_object = function(pos, node, stack, direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if stack:get_name() == "bees:frame_full" then
if inv:is_empty("frames_filled") then
timer:start(5)
end
return inv:add_item("frames_filled",stack)
elseif stack:get_name() == "vessels:glass_bottle" then
if inv:is_empty("bottles_empty") then
timer:start(5)
end
return inv:add_item("bottles_empty",stack)
end
return stack
end,
can_insert = function(pos,node,stack,direction)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if stack:get_name() == "bees:frame_full" then
return inv:room_for_item("frames_filled",stack)
elseif stack:get_name() == "vessels:glass_bottle" then
return inv:room_for_item("bottles_empty",stack)
end
return false
end,
input_inventory = {"frames_emptied", "bottles_full", "wax"},
connect_sides = {left=1, right=1, back=1, front=1, bottom=1, top=1}
},
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:get_stack(listname, 1):get_count() == stack:get_count() then -- inv was empty -> start the timer
timer:start(5) --create a honey bottle and empty frame and wax every 5 seconds
end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if (listname == 'bottles_empty' and stack:get_name() == 'vessels:glass_bottle') or (listname == 'frames_filled' and stack:get_name() == 'bees:frame_full') then
return stack:get_count()
else
return 0
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
return 0
end,
})
minetest.register_node('bees:bees', {
description = 'Flying Bees',
drawtype = 'plantlike',
paramtype = 'light',
groups = { not_in_creative_inventory=1 },
tiles = {
{
name='bees_strip.png',
animation={type='vertical_frames', aspect_w=16,aspect_h=16, length=2.0}
}
},
damage_per_second = 1,
walkable = false,
buildable_to = true,
pointable = false,
on_punch = function(pos, node, puncher)
local health = puncher:get_hp()
puncher:set_hp(health-2)
end,
})
minetest.register_node('bees:hive_wild', {
description = 'Wild Bee Hive',
tiles = {"bees_hive_wild.png"}, --texture from church_candles.
drawtype = "plantlike",
paramtype = 'light',
walkable = true,
drop = {
max_items = 6,
items = {
{ items = {'bees:honeycomb'}, rarity = 5}
}
},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,attached_node=1},
on_timer = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer= minetest.get_node_timer(pos)
local rad = 10
local minp = {x=pos.x-rad, y=pos.y-rad, z=pos.z-rad}
local maxp = {x=pos.x+rad, y=pos.y+rad, z=pos.z+rad}
local flowers = minetest.find_nodes_in_area(minp, maxp, 'group:flower')
if #flowers == 0 then
inv:set_stack('queen', 1, '')
meta:set_string('infotext', 'This hive colony died! Not enough flowers in area.')
return
end --not any flowers nearby The queen dies!
if #flowers < 3 then return end --requires 2 or more flowers before can make honey
local flower = flowers[math.random(#flowers)]
bees.polinate_flower(flower, minetest.get_node(flower).name)
local stacks = inv:get_list('combs')
for k, v in pairs(stacks) do
if inv:get_stack('combs', k):is_empty() then --then replace that with a full one and reset pro..
inv:set_stack('combs',k,'bees:honeycomb')
timer:start(1000/#flowers)
return
end
end
--what to do if all combs are filled
end,
on_construct = function(pos)
minetest.get_node(pos).param2 = 0
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
meta:set_int('agressive', 1)
timer:start(100+math.random(100))
inv:set_size('queen', 1)
inv:set_size('combs', 5)
inv:set_stack('queen', 1, 'bees:queen')
for i=1,math.random(3) do
inv:set_stack('combs', i, 'bees:honeycomb')
end
end,
on_punch = function(pos, node, puncher)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:contains_item('queen','bees:queen') then
local health = puncher:get_hp()
puncher:set_hp(health-4)
end
end,
on_metadata_inventory_take = function(pos, listname, index, stack, taker)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer= minetest.get_node_timer(pos)
if listname == 'combs' and inv:contains_item('queen', 'bees:queen') then
local health = taker:get_hp()
timer:start(10)
taker:set_hp(health-2)
end
end,
on_metadata_inventory_put = function(pos, listname, index, stack, taker) --restart the colony by adding a queen
local timer = minetest.get_node_timer(pos)
if not timer:is_started() then
timer:start(10)
end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if listname == 'queen' and stack:get_name() == 'bees:queen' then
return 1
else
return 0
end
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
minetest.show_formspec(
clicker:get_player_name(),
'bees:hive_artificial',
formspecs.hive_wild(pos, (itemstack:get_name() == 'bees:grafting_tool'))
)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int('agressive') == 1 and inv:contains_item('queen', 'bees:queen') then
local health = clicker:get_hp()
clicker:set_hp(health-4)
else
meta:set_int('agressive', 1)
end
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if inv:is_empty('queen') and inv:is_empty('combs') then
return true
else
return false
end
end,
after_dig_node = function(pos, oldnode, oldmetadata, user)
local wielded if user:get_wielded_item() ~= nil then wielded = user:get_wielded_item() else return end
if 'bees:grafting_tool' == wielded:get_name() then
local inv = user:get_inventory()
if inv then
inv:add_item('main', ItemStack('bees:queen'))
end
end
end
})
minetest.register_node('bees:hive_artificial', {
description = 'Bee Hive',
tiles = {'default_wood.png','default_wood.png','default_wood.png', 'default_wood.png','default_wood.png','bees_hive_artificial.png'},
drawtype = 'nodebox',
paramtype = 'light',
paramtype2 = 'facedir',
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = 'fixed',
fixed = {
{-4/8, 2/8, -4/8, 4/8, 3/8, 4/8},
{-3/8, -4/8, -2/8, 3/8, 2/8, 3/8},
{-3/8, 0/8, -3/8, 3/8, 2/8, -2/8},
{-3/8, -4/8, -3/8, 3/8, -1/8, -2/8},
{-3/8, -1/8, -3/8, -1/8, 0/8, -2/8},
{1/8, -1/8, -3/8, 3/8, 0/8, -2/8},
}
},
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
meta:set_int('agressive', 1)
inv:set_size('queen', 1)
inv:set_size('frames', 8)
meta:set_string('infotext','Requires a queen bee to function.')
end,
on_rightclick = function(pos, node, clicker, itemstack)
minetest.show_formspec(
clicker:get_player_name(),
'bees:hive_artificial',
formspecs.hive_artificial(pos)
)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int('agressive') == 1 and inv:contains_item('queen', 'bees:queen') then
local health = clicker:get_hp()
clicker:set_hp(health-4)
else
meta:set_int('agressive', 1)
end
end,
on_timer = function(pos,elapsed)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if inv:contains_item('queen', 'bees:queen') then
if inv:contains_item('frames', 'bees:frame_empty') then
timer:start(30)
local rad = 10
local minp = {x=pos.x-rad, y=pos.y-rad, z=pos.z-rad}
local maxp = {x=pos.x+rad, y=pos.y+rad, z=pos.z+rad}
local flowers = minetest.find_nodes_in_area(minp, maxp, 'group:flower')
local progress = meta:get_int('progress')
progress = progress + #flowers
meta:set_int('progress', progress)
if progress > 1000 then
local flower = flowers[math.random(#flowers)]
bees.polinate_flower(flower, minetest.get_node(flower).name)
local stacks = inv:get_list('frames')
for k, v in pairs(stacks) do
if inv:get_stack('frames', k):get_name() == 'bees:frame_empty' then
meta:set_int('progress', 0)
inv:set_stack('frames',k,'bees:frame_full')
return
end
end
else
meta:set_string('infotext', 'Progress: '..progress..'+'..#flowers..'/1000')
end
else
meta:set_string('infotext', 'Hive does not have empty frame(s)!')
timer:stop()
end
end
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
if listname == 'queen' then
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
meta:set_string('infotext','Hive requires a queen bee to function!')
timer:stop()
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local inv = minetest.get_meta(pos):get_inventory()
if from_list == to_list then
if inv:get_stack(to_list, to_index):is_empty() then
return 1
else
return 0
end
else
return 0
end
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local timer = minetest.get_node_timer(pos)
if listname == 'queen' or listname == 'frames' then
meta:set_string('queen', stack:get_name())
meta:set_string('infotext','A queen bee is inserted. Add empty frames!');
if inv:contains_item('frames', 'bees:frame_empty') then
timer:start(30)
meta:set_string('infotext','Bees are settling in!');
end
end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if not minetest.get_meta(pos):get_inventory():get_stack(listname, index):is_empty() then return 0 end
if listname == 'queen' then
if stack:get_name():match('bees:queen*') then
return 1
end
elseif listname == 'frames' then
if stack:get_name() == ('bees:frame_empty') then
return 1
end
end
return 0
end,
})
minetest.register_node("bees:honeycomb_block", {
description = "Honeycomb Block",
inventory_image = "bees_honeycomb_block.png",
tiles = {"bees_honeycomb_block.png"},
groups = {oddly_breakable_by_hand = 3, dig_immediate = 1},
sounds = default.node_sound_dirt_defaults(),
})

42
mods/bees/tools.lua Normal file
View File

@ -0,0 +1,42 @@
--TOOLS
minetest.register_tool('bees:smoker', {
description = 'Hive Smoker',
inventory_image = 'bees_smoker.png',
tool_capabilities = {
full_punch_interval = 3.0,
max_drop_level=0,
damage_groups = {fleshy=2},
},
on_use = function(tool, user, node)
if node then
local pos = node.under
if pos then
for i=1,6 do
minetest.add_particle({
pos = {x=pos.x+math.random()-0.5, y=pos.y, z=pos.z+math.random()-0.5},
vel = {x=0,y=0.5+math.random(),z=0},
acc = {x=0,y=0,z=0},
expirationtime = 2+math.random(2.5),
size = math.random(3),
collisiondetection = false,
texture = 'tnt_smoke.png',
})
end
--tool:add_wear(2)
local meta = minetest.get_meta(pos)
meta:set_int('agressive', 0)
return nil
end
end
end,
})
minetest.register_tool('bees:grafting_tool', {
description = 'Beehive Grafting Tool',
inventory_image = 'bees_grafting_tool.png',
tool_capabilities = {
full_punch_interval = 3.0,
max_drop_level=0,
damage_groups = {fleshy=2},
},
})

View File

@ -7,6 +7,6 @@ Minetest mod that adds scifi themed nodes
# Attributions
CC BY-NC 3.0
CC BY 3.0
* scifi_nodes_door_normal.ogg tlwmdbt https://freesound.org/people/tlwmdbt/sounds/165862/
* scifi_nodes_door_mechanic.ogg primeval_polypod https://freesound.org/people/primeval_polypod/sounds/156507/
* scifi_nodes_door_mechanic.ogg freedoom https://github.com/freedoom/freedoom

1
mods_disabled/farming/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
farming.conf

View File

@ -0,0 +1,66 @@
# Farming Redo Mod
### by TenPlus1
https://forum.minetest.net/viewtopic.php?id=9019
Farming Redo is a simplified version of the built-in farming mod in minetest and comes with wheat, cotton, carrot, cucumber, potato and tomato to start out with which spawn throughout the map... new foods need only be planted on tilled soil so no seeds are required, original wheat and cotton will require seeds which are found inside normal and jungle grass...
This mod works by adding your new plant to the {growing=1} group and numbering the stages from _1 to as many stages as you like, but the underscore MUST be used only once in the node name to separate plant from stage number e.g.
"farming:cotton_1" through to "farming:cotton_8"
"farming:wheat_1" through to "farming:wheat_8"
"farming:cucumber_4" through to "farming:cucumber_4"
### Changelog:
- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection, add chocolate block
- 1.41 - Each crop has it's own spawn rate (can be changed in farming.conf)
- 1.40 - Added Mithril Scythe to quick harvest and replant crops on right-click. Added Hoe's for MoreOres with Toolrank support.
- 1.39 - Added Rice, Rye and Oats thanks to Ademants Grains mod. Added Jaffa Cake and multigrain bread.
- 1.38 - Pumpkin grows into block, use chopping board to cut into 4x slices, same with melon block, 2x2 slices makes a block, cocoa pods are no longer walkable
- 1.37 - Added custom 'growth_check(pos, nodename) function for crop nodes to use (check cocoa.lua for example)
- 1.36 - Added Beetroot, Beetroot Soup (6x beetroot, 1x bowl), fix register_plant() issue, add new recipes
- 1.35 - Deprecated bronze/mese/diamond hoe's, added hoe bomb and deprecated hoe's as lucky block prizes
- 1.34 - Added scarecrow Base (5x sticks in a cross shape)
- 1.33 - Added cooking utensils (wooden bowl, saucepan, cooking pot, baking tray, skillet, cutting board, mortar & pestle, juicer, glass mixing bowl) for easier food crafts.
- 1.32 - Added Pea plant (textures by Andrey01) - also added Wooden Bowl and Pea Soup crafts
- 1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water, added food groups so it's more compatible with Ruben's food mods.
- 1.30 - Added Garlic, Pepper and Onions thanks to Grizzly Adam for sharing textures
- 1.29 - Updating functions so requires Minetest 0.4.16 and above to run
- 1.28 - Added chili peppers and bowl of chili, optimized code and fixed a few bugs, added porridge
- 1.27 - Added meshoptions to api and wheat plants, added farming.rarity setting to spawn more/less crops on map, have separate cotton/string items (4x cotton = 1x wool, 2x cotton = 2x string)
- 1.26 - Added support for [toolranks] mod when using hoe's
- 1.25 - Added check for farming.conf setting file to disable specific crops globally (inside mod folder) or world specific (inside world folder)
- 1.24 - Added Hemp which can be crafted into fibre, paper, string, rope and oil.
- 1.23 - Huge code tweak and tidy done and added barley seeds to be found in dry grass, barley can make flour for bread also.
- 1.22 - Added grape bushes at high climates which can be cultivated into grape vines using trellis (9 sticks).
- 1.21 - Added auto-refill code for planting crops (thanks crabman77), also fixed a few bugs
- 1.20b - Tidied code, made api compatible with new 0.4.13 changes and changed to soil texture overlays
- 1.20 - NEW growing routine added that allows crops to grow while player is away doing other things (thanks prestidigitator)
- 1.14 - Added Green Beans from Crops mod (thanks sofar), little bushels in the wild but need to be grown using beanpoles crafted with 4 sticks (2 either side)
- 1.13 - Fixed seed double-placement glitch. Mapgen now uses 0.4.12+ for plant generation
- 1.12 - Player cannot place seeds in protected area, also growing speeds changed to match defaults
- 1.11 - Added Straw Bale, streamlined growing abm a little, fixed melon rotation bug with screwdriver
- 1.10 - Added Blueberry Bush and Blueberry Muffins, also Pumpkin/Melon easier to pick up, added check for unloaded map
- 1.09 - Corn now uses single nodes instead of 1 ontop of the other, Ethanol recipe is more expensive (requires 5 corn) and some code cleanup.
- 1.08 - Added Farming Plus compatibility, plus can be removed and no more missing nodes
- 1.07 - Added Rhubarb and Rhubarb Pie
- 1.06 - register_hoe and register_plant added for compatibility with default farming mod, although any plants registered will use farming redo to grow
- 1.05 - Added Raspberry Bushels and Raspberry Smoothie
- 1.04 - Added Donuts... normal, chocolate and apple... and a few code cleanups and now compatible with jungletree's from MoreTrees mod
- 1.03 - Bug fixes and more compatibility as drop-in replacement for built-in farming mod
- 1.02 - Added farming.mod string to help other mods identify which farming mod is running, if it returns "redo" then you're using this one, "" empty is built-in mod
- 1.01 - Crafting coffee or ethanol returns empty bucket/bottle, also Cocoa spawns a little rarer
- 1.0 - Added Cocoa which randomly grows on jungle tree's, pods give cocoa beans which can be used to farm more pods on a jungle trunk or make Cookies which have been added (or other treats)
- 0.9 - Added Pumpkin, Jack 'O Lantern, Pumpkin Slice and Sugar (a huge thanks to painterly.net for allowing me to use their textures)
- 0.8 - Added Watermelon and Melon Slice
- 0.7 - Added Coffee, Coffee Beans, Drinking Cup, Cold and Hot Cup of Coffee
- 0.6 - Added Corn, Corn on the Cob... Also reworked Abm
- 0.5 - Added Carrot, Cucumber, Potato (and Baked Potato), Tomato
- 0.4 - Checks for Protection, also performance changes
- 0.3 - Added Diamond and Mese hoe
- 0.2 - Fixed check for wet soil
- 0.1 - Fixed growing bug
- 0.0 - Initial release
### Lucky Blocks: 39

View File

@ -0,0 +1,40 @@
Minetest Game mod: farming
==========================
See license.txt for license information.
Authors of source code
----------------------
Originally by PilzAdam (MIT)
webdesigner97 (MIT)
Various Minetest developers and contributors (MIT)
Authors of media (textures)
---------------------------
Created by PilzAdam (CC BY 3.0):
farming_bread.png
farming_soil.png
farming_soil_wet.png
farming_soil_wet_side.png
farming_string.png
Created by BlockMen (CC BY 3.0):
farming_tool_diamondhoe.png
farming_tool_mesehoe.png
farming_tool_bronzehoe.png
farming_tool_steelhoe.png
farming_tool_stonehoe.png
farming_tool_woodhoe.png
Created by MasterGollum (CC BY 3.0):
farming_straw.png
Created by Gambit (CC BY 3.0):
farming_wheat.png
farming_wheat_*.png
farming_cotton_*.png
farming_flour.png
farming_cotton_seed.png
farming_wheat_seed.png
Created by Napiophelios (CC BY-SA 3.0):
farming_cotton.png

View File

@ -0,0 +1,401 @@
-- farming/api.lua
-- support for MT game translation.
local S = farming.get_translator
-- Wear out hoes, place soil
-- TODO Ignore group:flower
farming.registered_plants = {}
farming.hoe_on_use = function(itemstack, user, pointed_thing, uses)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return
end
if pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
local above = minetest.get_node(p)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return
end
if not minetest.registered_nodes[above.name] then
return
end
-- check if the node above the pointed thing is air
if above.name ~= "air" then
return
end
-- check if pointing at soil
if minetest.get_item_group(under.name, "soil") ~= 1 then
return
end
-- check if (wet) soil defined
local regN = minetest.registered_nodes
if regN[under.name].soil == nil or regN[under.name].soil.wet == nil or regN[under.name].soil.dry == nil then
return
end
if minetest.is_protected(pt.under, user:get_player_name()) then
minetest.record_protection_violation(pt.under, user:get_player_name())
return
end
if minetest.is_protected(pt.above, user:get_player_name()) then
minetest.record_protection_violation(pt.above, user:get_player_name())
return
end
-- turn the node into soil and play sound
minetest.set_node(pt.under, {name = regN[under.name].soil.dry})
minetest.sound_play("default_dig_crumbly", {
pos = pt.under,
gain = 0.5,
}, true)
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(user:get_player_name())) then
-- wear tool
local wdef = itemstack:get_definition()
itemstack:add_wear(65535/(uses-1))
-- tool break sound
if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then
minetest.sound_play(wdef.sound.breaks, {pos = pt.above,
gain = 0.5}, true)
end
end
return itemstack
end
-- Register new hoes
farming.register_hoe = function(name, def)
-- Check for : prefix (register new hoes in your mod's namespace)
if name:sub(1,1) ~= ":" then
name = ":" .. name
end
-- Check def table
if def.description == nil then
def.description = S("Hoe")
end
if def.inventory_image == nil then
def.inventory_image = "unknown_item.png"
end
if def.max_uses == nil then
def.max_uses = 30
end
-- Register the tool
minetest.register_tool(name, {
description = def.description,
inventory_image = def.inventory_image,
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses)
end,
groups = def.groups,
sound = {breaks = "default_tool_breaks"},
})
-- Register its recipe
if def.recipe then
minetest.register_craft({
output = name:sub(2),
recipe = def.recipe
})
elseif def.material then
minetest.register_craft({
output = name:sub(2),
recipe = {
{def.material, def.material},
{"", "group:stick"},
{"", "group:stick"}
}
})
end
end
-- how often node timers for plants will tick, +/- some random value
local function tick(pos)
minetest.get_node_timer(pos):start(math.random(166, 286))
end
-- how often a growth failure tick is retried (e.g. too dark)
local function tick_again(pos)
minetest.get_node_timer(pos):start(math.random(40, 80))
end
-- Seed placement
farming.place_seed = function(itemstack, placer, pointed_thing, plantname)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return itemstack
end
if pt.type ~= "node" then
return itemstack
end
local under = minetest.get_node(pt.under)
local above = minetest.get_node(pt.above)
local player_name = placer and placer:get_player_name() or ""
if minetest.is_protected(pt.under, player_name) then
minetest.record_protection_violation(pt.under, player_name)
return
end
if minetest.is_protected(pt.above, player_name) then
minetest.record_protection_violation(pt.above, player_name)
return
end
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return itemstack
end
if not minetest.registered_nodes[above.name] then
return itemstack
end
-- check if pointing at the top of the node
if pt.above.y ~= pt.under.y+1 then
return itemstack
end
-- check if you can replace the node above the pointed node
if not minetest.registered_nodes[above.name].buildable_to then
return itemstack
end
-- check if pointing at soil
if minetest.get_item_group(under.name, "soil") < 2 then
return itemstack
end
-- add the node and remove 1 item from the itemstack
minetest.log("action", player_name .. " places node " .. plantname .. " at " ..
minetest.pos_to_string(pt.above))
minetest.add_node(pt.above, {name = plantname, param2 = 1})
tick(pt.above)
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(player_name)) then
itemstack:take_item()
end
return itemstack
end
farming.grow_plant = function(pos, elapsed)
local node = minetest.get_node(pos)
local name = node.name
local def = minetest.registered_nodes[name]
if not def.next_plant then
-- disable timer for fully grown plant
return
end
-- grow seed
if minetest.get_item_group(node.name, "seed") and def.fertility then
local soil_node = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z})
if not soil_node then
tick_again(pos)
return
end
-- omitted is a check for light, we assume seeds can germinate in the dark.
for _, v in pairs(def.fertility) do
if minetest.get_item_group(soil_node.name, v) ~= 0 then
local placenode = {name = def.next_plant}
if def.place_param2 then
placenode.param2 = def.place_param2
end
minetest.swap_node(pos, placenode)
if minetest.registered_nodes[def.next_plant].next_plant then
tick(pos)
return
end
end
end
return
end
-- check if on wet soil
local below = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
if minetest.get_item_group(below.name, "soil") < 3 then
tick_again(pos)
return
end
-- check light
local light = minetest.get_node_light(pos)
if not light or light < def.minlight or light > def.maxlight then
tick_again(pos)
return
end
-- grow
local placenode = {name = def.next_plant}
if def.place_param2 then
placenode.param2 = def.place_param2
end
minetest.swap_node(pos, placenode)
-- new timer needed?
if minetest.registered_nodes[def.next_plant].next_plant then
tick(pos)
end
return
end
-- Register plants
farming.register_plant = function(name, def)
local mname = name:split(":")[1]
local pname = name:split(":")[2]
-- Check def table
if not def.description then
def.description = S("Seed")
end
if not def.harvest_description then
def.harvest_description = pname:gsub("^%l", string.upper)
end
if not def.inventory_image then
def.inventory_image = "unknown_item.png"
end
if not def.steps then
return nil
end
if not def.minlight then
def.minlight = 1
end
if not def.maxlight then
def.maxlight = 14
end
if not def.fertility then
def.fertility = {}
end
farming.registered_plants[pname] = def
-- Register seed
local lbm_nodes = {mname .. ":seed_" .. pname}
local g = {seed = 1, snappy = 3, attached_node = 1, flammable = 2}
for k, v in pairs(def.fertility) do
g[v] = 1
end
minetest.register_node(":" .. mname .. ":seed_" .. pname, {
description = def.description,
tiles = {def.inventory_image},
inventory_image = def.inventory_image,
wield_image = def.inventory_image,
drawtype = "signlike",
groups = g,
paramtype = "light",
paramtype2 = "wallmounted",
place_param2 = def.place_param2 or nil, -- this isn't actually used for placement
walkable = false,
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
fertility = def.fertility,
sounds = default.node_sound_dirt_defaults({
dig = {name = "", gain = 0},
dug = {name = "default_grass_footstep", gain = 0.2},
place = {name = "default_place_node", gain = 0.25},
}),
on_place = function(itemstack, placer, pointed_thing)
local under = pointed_thing.under
local node = minetest.get_node(under)
local udef = minetest.registered_nodes[node.name]
if udef and udef.on_rightclick and
not (placer and placer:is_player() and
placer:get_player_control().sneak) then
return udef.on_rightclick(under, node, placer, itemstack,
pointed_thing) or itemstack
end
return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":seed_" .. pname)
end,
next_plant = mname .. ":" .. pname .. "_1",
on_timer = farming.grow_plant,
minlight = def.minlight,
maxlight = def.maxlight,
})
-- Register harvest
minetest.register_craftitem(":" .. mname .. ":" .. pname, {
description = def.harvest_description,
inventory_image = mname .. "_" .. pname .. ".png",
groups = def.groups or {flammable = 2},
})
-- Register growing steps
for i = 1, def.steps do
local base_rarity = 1
if def.steps ~= 1 then
base_rarity = 8 - (i - 1) * 7 / (def.steps - 1)
end
local drop = {
items = {
{items = {mname .. ":" .. pname}, rarity = base_rarity},
{items = {mname .. ":" .. pname}, rarity = base_rarity * 2},
{items = {mname .. ":seed_" .. pname}, rarity = base_rarity},
{items = {mname .. ":seed_" .. pname}, rarity = base_rarity * 2},
}
}
local nodegroups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1}
nodegroups[pname] = i
local next_plant = nil
if i < def.steps then
next_plant = mname .. ":" .. pname .. "_" .. (i + 1)
lbm_nodes[#lbm_nodes + 1] = mname .. ":" .. pname .. "_" .. i
end
minetest.register_node(":" .. mname .. ":" .. pname .. "_" .. i, {
drawtype = "plantlike",
waving = 1,
tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"},
paramtype = "light",
paramtype2 = def.paramtype2 or nil,
place_param2 = def.place_param2 or nil,
walkable = false,
buildable_to = true,
drop = drop,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
groups = nodegroups,
sounds = default.node_sound_leaves_defaults(),
next_plant = next_plant,
on_timer = farming.grow_plant,
minlight = def.minlight,
maxlight = def.maxlight,
})
end
-- replacement LBM for pre-nodetimer plants
minetest.register_lbm({
name = ":" .. mname .. ":start_nodetimer_" .. pname,
nodenames = lbm_nodes,
action = function(pos, node)
tick_again(pos)
end,
})
-- Return
local r = {
seed = mname .. ":seed_" .. pname,
harvest = mname .. ":" .. pname
}
return r
end

View File

@ -0,0 +1,64 @@
Farming API
-----------
The farming API allows you to easily register plants and hoes.
`farming.register_hoe(name, hoe definition)`
* Register a new hoe, see [#hoe definition]
`farming.register_plant(name, Plant definition)`
* Register a new growing plant, see [#Plant definition]
`farming.registered_plants[name] = definition`
* Table of registered plants, indexed by plant name
'crop' holds name of growing crop node minus _step-number at end
'seed' has name of seed required to plant crop
'minlight' min light level needed to grow
'maxlight' max light level needed to grow
'steps' number of steps crop has in growth cycle
### Hoe Definition
{
description = "", -- Description for tooltip
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
max_uses = 30, -- Uses until destroyed
material = "", -- Material for recipes
recipe = { -- Craft recipe, if material isn't used
{"air", "air", "air"},
{"", "group:stick"},
{"", "group:stick"},
}
}
### Plant definition
{
description = "", -- Description of seed item
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
steps = 8, -- How many steps the plant has to grow, until it can be harvested
-- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber)
minlight = 13, -- Minimum light to grow
maxlight = default.LIGHT_MAX -- Maximum light to grow
}
Note: Any crops registered with the above function will use the new growing routines, also if crops are manually added with the {growing=1} group they will also grow.
### Crop functions
If a mod registers nodes to be used as crops using the {growing=1} group then an additional function can be used for custom growth checks instead of the standard 'are we above wet soil'.
growth_check = function(pos, node_name)
-- check surrounding for jungle tree
if minetest.find_node_near(pos, 1, {"default:jungletree"}) then
return false -- place next growth stage
end
return true -- condition not met, skip next growth stage until next check
end,
### Scythe items that will not drop
This is a function to add items to a list that scythes will not drop, e.g. farming:trellis or farming:beanpole.
farming.add_to_scythe_not_drops(item_name)

View File

@ -0,0 +1,172 @@
--= Helpers
local eth = minetest.get_modpath("ethereal")
local alias = function(orig, new)
minetest.register_alias(orig, new)
end
--= Overrides (add food_* group to apple and brown mushroom)
minetest.override_item("default:apple", {
groups = {food_apple = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1},
})
if minetest.registered_nodes["flowers:mushroom_brown"] then
minetest.override_item("flowers:mushroom_brown", {
light_source = 1,
groups = {food_mushroom = 1, snappy = 3, attached_node = 1, flammable = 2},
})
end
--= Aliases
-- Banana
if eth then
alias("farming_plus:banana_sapling", "ethereal:banana_tree_sapling")
alias("farming_plus:banana_leaves", "ethereal:bananaleaves")
alias("farming_plus:banana", "ethereal:banana")
else
minetest.register_node(":ethereal:banana", {
description = "Banana",
drawtype = "torchlike",
tiles = {"banana_single.png"},
inventory_image = "banana_single.png",
wield_image = "banana_single.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
},
groups = {food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node(":ethereal:bananaleaves", {
description = "Banana Leaves",
tiles = {"banana_leaf.png"},
inventory_image = "banana_leaf.png",
wield_image = "banana_leaf.png",
paramtype = "light",
waving = 1,
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
sounds = default.node_sound_leaves_defaults(),
})
alias("farming_plus:banana_sapling", "default:sapling")
alias("farming_plus:banana_leaves", "ethereal:bananaleaves")
alias("farming_plus:banana", "ethereal:banana")
end
-- Carrot
alias("farming_plus:carrot_seed", "farming:carrot")
alias("farming_plus:carrot_1", "farming:carrot_1")
alias("farming_plus:carrot_2", "farming:carrot_4")
alias("farming_plus:carrot_3", "farming:carrot_6")
alias("farming_plus:carrot", "farming:carrot_8")
alias("farming_plus:carrot_item", "farming:carrot")
-- Cocoa
alias("farming_plus:cocoa_sapling", "farming:cocoa_beans")
alias("farming_plus:cocoa_leaves", "default:leaves")
alias("farming_plus:cocoa", "default:apple")
alias("farming_plus:cocoa_bean", "farming:cocoa_beans")
-- Orange
alias("farming_plus:orange_1", "farming:tomato_1")
alias("farming_plus:orange_2", "farming:tomato_4")
alias("farming_plus:orange_3", "farming:tomato_6")
if eth then
alias("farming_plus:orange_item", "ethereal:orange")
alias("farming_plus:orange", "ethereal:orange")
alias("farming_plus:orange_seed", "ethereal:orange_tree_sapling")
else
minetest.register_node(":ethereal:orange", {
description = "Orange",
drawtype = "plantlike",
tiles = {"farming_orange.png"},
inventory_image = "farming_orange.png",
wield_image = "farming_orange.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.3, -0.2, 0.2, 0.2, 0.2}
},
groups = {food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
on_use = minetest.item_eat(4),
sounds = default.node_sound_leaves_defaults(),
})
alias("farming_plus:orange_item", "ethereal:orange")
alias("farming_plus:orange", "ethereal:orange")
alias("farming_plus:orange_seed", "default:sapling")
end
-- Potato
alias("farming_plus:potato_item", "farming:potato")
alias("farming_plus:potato_1", "farming:potato_1")
alias("farming_plus:potato_2", "farming:potato_2")
alias("farming_plus:potato", "farming:potato_3")
alias("farming_plus:potato_seed", "farming:potato")
-- Pumpkin
alias("farming:pumpkin_seed", "farming:pumpkin_slice")
alias("farming:pumpkin_face", "farming:jackolantern")
alias("farming:pumpkin_face_light", "farming:jackolantern_on")
alias("farming:big_pumpkin", "farming:jackolantern")
alias("farming:big_pumpkin_side", "air")
alias("farming:big_pumpkin_top", "air")
alias("farming:big_pumpkin_corner", "air")
alias("farming:scarecrow", "farming:jackolantern")
alias("farming:scarecrow_light", "farming:jackolantern_on")
alias("farming:pumpkin_flour", "farming:pumpkin_dough")
-- Rhubarb
alias("farming_plus:rhubarb_seed", "farming:rhubarb")
alias("farming_plus:rhubarb_1", "farming:rhubarb_1")
alias("farming_plus:rhubarb_2", "farming:rhubarb_2")
alias("farming_plus:rhubarb", "farming:rhubarb_3")
alias("farming_plus:rhubarb_item", "farming:rhubarb")
-- Strawberry
if eth then
alias("farming_plus:strawberry_item", "ethereal:strawberry")
alias("farming_plus:strawberry_seed", "ethereal:strawberry")
alias("farming_plus:strawberry_1", "ethereal:strawberry_1")
alias("farming_plus:strawberry_2", "ethereal:strawberry_3")
alias("farming_plus:strawberry_3", "ethereal:strawberry_5")
alias("farming_plus:strawberry", "ethereal:strawberry_7")
else
minetest.register_craftitem(":ethereal:strawberry", {
description = "Strawberry",
inventory_image = "strawberry.png",
wield_image = "strawberry.png",
groups = {food_strawberry = 1, flammable = 2},
on_use = minetest.item_eat(1),
})
alias("farming_plus:strawberry_item", "ethereal:strawberry")
alias("farming_plus:strawberry_seed", "ethereal:strawberry")
alias("farming_plus:strawberry_1", "farming:raspberry_1")
alias("farming_plus:strawberry_2", "farming:raspberry_2")
alias("farming_plus:strawberry_3", "farming:raspberry_3")
alias("farming_plus:strawberry", "farming:raspberry_4")
end
-- Tomato
alias("farming_plus:tomato_seed", "farming:tomato")
alias("farming_plus:tomato_item", "farming:tomato")
alias("farming_plus:tomato_1", "farming:tomato_2")
alias("farming_plus:tomato_2", "farming:tomato_4")
alias("farming_plus:tomato_3", "farming:tomato_6")
alias("farming_plus:tomato", "farming:tomato_8")
-- Weed
alias("farming:weed", "default:grass_2")

View File

@ -0,0 +1,96 @@
local S = farming.intllib
-- blueberries
-- Removing redundant blueberry item from legacy.
--minetest.register_craftitem("farming:blueberries", {
-- description = S("Blueberries"),
-- inventory_image = "farming_blueberries.png",
-- groups = {food_blueberries = 1, food_blueberry = 1, food_berry = 1, flammable = 2},
-- on_place = function(itemstack, placer, pointed_thing)
-- return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1")
-- end,
-- on_use = minetest.item_eat(1),
--})
-- blueberry muffin (thanks to sosogirl123 @ deviantart.com for muffin image)
minetest.register_craftitem("farming:muffin_blueberry", {
description = S("Blueberry Muffin"),
inventory_image = "farming_blueberry_muffin.png",
on_use = minetest.item_eat(2),
})
minetest.register_craft({
output = "farming:muffin_blueberry 2",
recipe = {
{"default:blueberries", "group:food_bread", "default:blueberries"},
}
})
-- Blueberry Pie
minetest.register_craftitem("farming:blueberry_pie", {
description = S("Blueberry Pie"),
inventory_image = "farming_blueberry_pie.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "farming:blueberry_pie",
type = "shapeless",
recipe = {
"group:food_flour", "group:food_sugar",
"default:blueberries", "group:food_baking_tray"
},
replacements = {{"group:food_baking_tray", "farming:baking_tray"}}
})
-- blueberry definition
--local crop_def = {
-- drawtype = "plantlike",
-- tiles = {"farming_blueberry_1.png"},
-- paramtype = "light",
-- sunlight_propagates = true,
-- walkable = false,
-- buildable_to = true,
-- drop = "",
-- selection_box = farming.select,
-- groups = {
-- snappy = 3, flammable = 2, plant = 1, attached_node = 1,
-- not_in_creative_inventory = 1, growing = 1
-- },
-- sounds = default.node_sound_leaves_defaults()
--}
-- stage 1
--minetest.register_node("farming:blueberry_1", table.copy(crop_def))
-- stage 2
--crop_def.tiles = {"farming_blueberry_2.png"}
--minetest.register_node("farming:blueberry_2", table.copy(crop_def))
-- stage 3
--crop_def.tiles = {"farming_blueberry_3.png"}
--minetest.register_node("farming:blueberry_3", table.copy(crop_def))
-- stage 4 (final)
--crop_def.tiles = {"farming_blueberry_4.png"}
--crop_def.groups.growing = 0
--crop_def.drop = {
-- items = {
-- {items = {'farming:blueberries'}, rarity = 1},
-- {items = {'farming:blueberries'}, rarity = 10},
-- }
--}
--minetest.register_node("farming:blueberry_4", table.copy(crop_def))
-- add to registered_plants
--farming.registered_plants["farming:blueberries"] = {
-- crop = "farming:blueberry",
-- seed = "farming:blueberries",
-- minlight = 13,
-- maxlight = 15,
-- steps = 4
--}

View File

@ -0,0 +1,101 @@
local S = farming.intllib
-- chili pepper
minetest.register_craftitem("farming:chili_pepper", {
description = S("Chili Pepper"),
inventory_image = "farming_chili_pepper.png",
groups = {food_chili_pepper = 1, flammable = 4},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1")
end,
on_use = minetest.item_eat(2),
})
-- bowl of chili
minetest.register_craftitem("farming:chili_bowl", {
description = S("Bowl of Chili"),
inventory_image = "farming_chili_bowl.png",
on_use = minetest.item_eat(8, "farming:bowl"),
})
minetest.register_craft({
type = "shapeless",
output = "farming:chili_bowl",
recipe = {
"group:food_chili_pepper", "group:food_barley",
"group:food_tomato", "group:food_beans", "group:food_bowl"
},
})
-- chili can be used for red dye
minetest.register_craft({
output = "dye:red",
recipe = {
{'farming:chili_pepper'},
}
})
-- chili definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_chili_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 4, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:chili_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_chili_2.png"}
minetest.register_node("farming:chili_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_chili_3.png"}
minetest.register_node("farming:chili_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_chili_4.png"}
minetest.register_node("farming:chili_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_chili_5.png"}
minetest.register_node("farming:chili_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_chili_6.png"}
minetest.register_node("farming:chili_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_chili_7.png"}
minetest.register_node("farming:chili_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.tiles = {"farming_chili_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:chili_pepper 3'}, rarity = 1},
{items = {'farming:chili_pepper 2'}, rarity = 2},
}
}
minetest.register_node("farming:chili_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:chili_pepper"] = {
crop = "farming:chili",
seed = "farming:chili_pepper",
minlight = 13,
maxlight = 15,
steps = 8
}

View File

@ -0,0 +1,124 @@
--[[
Original textures from GeMinecraft
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1440575-1-2-5-generation-minecraft-beta-1-2-farming-and
]]
local S = farming.intllib
-- corn
minetest.register_craftitem("farming:corn", {
description = S("Corn"),
inventory_image = "farming_corn.png",
groups = {food_corn = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1")
end,
on_use = minetest.item_eat(3),
})
-- corn on the cob (texture by TenPlus1)
minetest.register_craftitem("farming:corn_cob", {
description = S("Corn on the Cob"),
inventory_image = "farming_corn_cob.png",
groups = {food_corn_cooked = 1, flammable = 2},
on_use = minetest.item_eat(5),
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "farming:corn_cob",
recipe = "group:food_corn"
})
-- cornstarch
minetest.register_craftitem("farming:cornstarch", {
description = S("Cornstarch"),
inventory_image = "farming_cornstarch.png",
groups = {food_cornstarch = 1, flammable = 2},
})
minetest.register_craft({
output = "farming:cornstarch",
recipe = {
{"group:food_mortar_pestle", "group:food_corn_cooked", "group:food_baking_tray"},
{"", "group:food_bowl", ""},
},
replacements = {
{"group:food_mortar_pestle", "farming:mortar_pestle"},
{"group:food_baking_tray", "farming:baking_tray"},
}
})
-- corn definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_corn_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:corn_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_corn_2.png"}
minetest.register_node("farming:corn_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_corn_3.png"}
minetest.register_node("farming:corn_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_corn_4.png"}
minetest.register_node("farming:corn_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_corn_5.png"}
minetest.register_node("farming:corn_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_corn_6.png"}
crop_def.visual_scale = 1.9 -- 1.45
minetest.register_node("farming:corn_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_corn_7.png"}
crop_def.drop = {
items = {
{items = {'farming:corn'}, rarity = 2},
{items = {'farming:corn'}, rarity = 3},
}
}
minetest.register_node("farming:corn_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.tiles = {"farming_corn_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:corn 2'}, rarity = 1},
{items = {'farming:corn 2'}, rarity = 2},
{items = {'farming:corn 2'}, rarity = 4},
}
}
minetest.register_node("farming:corn_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:corn"] = {
crop = "farming:corn",
seed = "farming:corn",
minlight = 13,
maxlight = 15,
steps = 8
}

View File

@ -0,0 +1,157 @@
local S = farming.intllib
-- cotton seeds
minetest.register_node("farming:seed_cotton", {
description = S("Cotton Seed"),
tiles = {"farming_cotton_seed.png"},
inventory_image = "farming_cotton_seed.png",
wield_image = "farming_cotton_seed.png",
drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4},
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = farming.select,
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cotton_1")
end,
})
-- cotton / string
minetest.register_craftitem("farming:cotton", {
description = S("Cotton"),
inventory_image = "farming_cotton.png",
groups = {flammable = 4},
})
minetest.register_craftitem("farming:string", {
description = S("String"),
inventory_image = "farming_string.png",
groups = {flammable = 2},
})
-- cotton to wool
minetest.register_craft({
output = "wool:white",
recipe = {
{"farming:cotton", "farming:cotton"},
{"farming:cotton", "farming:cotton"},
}
})
-- cotton to string
minetest.register_craft({
output = "farming:string 2",
recipe = {
{"farming:cotton"},
{"farming:cotton"},
}
})
-- can be used as fuel
minetest.register_craft({
type = "fuel",
recipe = "farming:string",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "farming:cotton",
burntime = 1,
})
-- cotton definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_cotton_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 4, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:cotton_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_cotton_2.png"}
minetest.register_node("farming:cotton_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_cotton_3.png"}
minetest.register_node("farming:cotton_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_cotton_4.png"}
minetest.register_node("farming:cotton_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_cotton_5.png"}
crop_def.drop = {
items = {
{items = {"farming:seed_cotton"}, rarity = 5},
}
}
minetest.register_node("farming:cotton_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_cotton_6.png"}
crop_def.drop = {
items = {
{items = {"farming:cotton"}, rarity = 4},
}
}
minetest.register_node("farming:cotton_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_cotton_7.png"}
crop_def.drop = {
items = {
{items = {"farming:cotton"}, rarity = 1},
{items = {"farming:seed_cotton"}, rarity = 2},
}
}
minetest.register_node("farming:cotton_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.tiles = {"farming_cotton_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {"farming:cotton"}, rarity = 1},
{items = {"farming:cotton"}, rarity = 2},
{items = {"farming:cotton"}, rarity = 3},
{items = {"farming:seed_cotton"}, rarity = 1},
{items = {"farming:seed_cotton"}, rarity = 2},
{items = {"farming:seed_cotton"}, rarity = 3},
}
}
minetest.register_node("farming:cotton_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:cotton"] = {
crop = "farming:cotton",
seed = "farming:seed_cotton",
minlight = 13,
maxlight = 15,
steps = 8
}
--[[ Cotton (example, is already registered in cotton.lua)
farming.register_plant("farming:cotton", {
description = "Cotton seed",
inventory_image = "farming_cotton_seed.png",
groups = {flammable = 2},
steps = 8,
})]]

View File

@ -0,0 +1,65 @@
--[[
Original textures from DocFarming mod
https://forum.minetest.net/viewtopic.php?id=3948
]]
local S = farming.intllib
-- cucumber
minetest.register_craftitem("farming:cucumber", {
description = S("Cucumber"),
inventory_image = "farming_cucumber.png",
groups = {food_cucumber = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1")
end,
on_use = minetest.item_eat(4),
})
-- cucumber definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_cucumber_1.png"},
paramtype = "light",
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:cucumber_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_cucumber_2.png"}
minetest.register_node("farming:cucumber_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_cucumber_3.png"}
minetest.register_node("farming:cucumber_3", table.copy(crop_def))
-- stage 4 (final)
crop_def.tiles = {"farming_cucumber_4.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:cucumber 2'}, rarity = 1},
{items = {'farming:cucumber 2'}, rarity = 2},
}
}
minetest.register_node("farming:cucumber_4", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:cucumber"] = {
crop = "farming:cucumber",
seed = "farming:cucumber",
minlight = 13,
maxlight = 15,
steps = 4
}

View File

@ -0,0 +1,135 @@
--[[
Original textures from Crops Plus mod
Copyright (C) 2018 Grizzly Adam
https://forum.minetest.net/viewtopic.php?f=9&t=19488
]]
local S = farming.intllib
-- potato
minetest.register_craftitem("farming:garlic_clove", {
description = S("Garlic clove"),
inventory_image = "crops_garlic_clove.png",
groups = {food_garlic_clove = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:garlic_1")
end,
})
-- garlic bulb
minetest.register_craftitem("farming:garlic", {
description = S("Garlic"),
inventory_image = "crops_garlic.png",
on_use = minetest.item_eat(1),
groups = {food_garlic = 1, flammable = 3},
})
minetest.register_craft({
type = "shapeless",
output = "farming:garlic_clove 8",
recipe = { "farming:garlic" }
})
minetest.register_craft({
output = "farming:garlic",
recipe = {
{"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"},
{"farming:garlic_clove", "", "farming:garlic_clove"},
{"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"}
}
})
-- garlic braid
minetest.register_node("farming:garlic_braid", {
description = S("Garlic Braid"),
inventory_image = "crops_garlic_braid.png",
wield_image = "crops_garlic_braid.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {
"crops_garlic_braid_side.png","crops_garlic_braid.png",
"crops_garlic_braid_side.png^[transformFx","crops_garlic_braid_side.png",
"crops_garlic_braid.png","crops_garlic_braid.png"
},
groups = {vessel = 1, dig_immediate = 3, flammable = 3},
sounds = default.node_sound_leaves_defaults(),
node_box = {
type = "fixed",
fixed = {
{-0.13, -0.45, 0.5, 0.13, 0.45, 0.24},
},
}
})
minetest.register_craft({
output = "farming:garlic_braid",
recipe = {
{"farming:garlic", "farming:garlic", "farming:garlic"},
{"farming:garlic", "farming:garlic", "farming:garlic"},
{"farming:garlic", "farming:garlic", "farming:garlic"}
}
})
minetest.register_craft({
type = "shapeless",
output = "farming:garlic 9",
recipe = { "farming:garlic_braid" }
})
-- crop definition
local crop_def = {
drawtype = "plantlike",
tiles = {"crops_garlic_plant_1.png"},
paramtype = "light",
paramtype2 = "meshoptions",
place_param2 = 3,
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 3, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:garlic_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"crops_garlic_plant_2.png"}
minetest.register_node("farming:garlic_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"crops_garlic_plant_3.png"}
minetest.register_node("farming:garlic_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"crops_garlic_plant_4.png"}
minetest.register_node("farming:garlic_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"crops_garlic_plant_5.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:garlic 3'}, rarity = 1},
{items = {'farming:garlic'}, rarity = 2},
{items = {'farming:garlic'}, rarity = 5},
}
}
minetest.register_node("farming:garlic_5", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:garlic"] = {
crop = "farming:garlic",
seed = "farming:garlic_clove",
minlight = 13,
maxlight = 15,
steps = 5
}

View File

@ -0,0 +1,94 @@
local S = farming.intllib
-- melon
minetest.register_craftitem("farming:melon_slice", {
description = S("Melon Slice"),
inventory_image = "farming_melon_slice.png",
groups = {food_melon_slice = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1")
end,
on_use = minetest.item_eat(2),
})
minetest.register_craft({
output = "farming:melon_8",
recipe = {
{"farming:melon_slice", "farming:melon_slice"},
}
})
minetest.register_craft({
type = "shapeless",
output = "farming:melon_slice 4",
recipe = {"farming:melon_8", "farming:cutting_board"},
replacements = {{"farming:cutting_board", "farming:cutting_board"}},
})
-- melon definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_melon_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:melon_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_melon_2.png"}
minetest.register_node("farming:melon_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_melon_3.png"}
minetest.register_node("farming:melon_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_melon_4.png"}
minetest.register_node("farming:melon_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_melon_5.png"}
minetest.register_node("farming:melon_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_melon_6.png"}
minetest.register_node("farming:melon_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_melon_7.png"}
minetest.register_node("farming:melon_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.drawtype = "nodebox"
crop_def.description = S("Melon")
crop_def.tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png"}
crop_def.selection_box = {-.5, -.5, -.5, .5, .5, .5}
crop_def.walkable = true
crop_def.groups = {
food_melon = 1, snappy = 1, oddly_breakable_by_hand = 1,
flammable = 2, plant = 1
}
--crop_def.drop = "farming:melon_slice 9"
crop_def.drop = "farming:melon_8"
minetest.register_node("farming:melon_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:melon"] = {
crop = "farming:melon",
seed = "farming:melon_slice",
minlight = 13,
maxlight = 15,
steps = 8
}

View File

@ -0,0 +1,104 @@
--[[
Original textures from PixelBox texture pack
https://forum.minetest.net/viewtopic.php?id=4990
]]
local S = farming.intllib
-- carrot
minetest.register_craftitem("farming:carrot", {
description = S("Carrot"),
inventory_image = "farming_carrot.png",
groups = {food_carrot = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1")
end,
on_use = minetest.item_eat(4),
})
-- golden carrot
minetest.register_craftitem("farming:carrot_gold", {
description = S("Golden Carrot"),
inventory_image = "farming_carrot_gold.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "farming:carrot_gold",
recipe = {
{"", "default:gold_lump", ""},
{"default:gold_lump", "group:food_carrot", "default:gold_lump"},
{"", "default:gold_lump", ""},
}
})
-- carrot definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_carrot_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:carrot_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_carrot_2.png"}
minetest.register_node("farming:carrot_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_carrot_3.png"}
minetest.register_node("farming:carrot_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_carrot_4.png"}
minetest.register_node("farming:carrot_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_carrot_5.png"}
minetest.register_node("farming:carrot_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_carrot_6.png"}
minetest.register_node("farming:carrot_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_carrot_7.png"}
crop_def.drop = {
items = {
{items = {'farming:carrot'}, rarity = 2},
}
}
minetest.register_node("farming:carrot_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.tiles = {"farming_carrot_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:carrot'}, rarity = 1},
{items = {'farming:carrot 2'}, rarity = 2},
}
}
minetest.register_node("farming:carrot_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:carrot"] = {
crop = "farming:carrot",
seed = "farming:carrot",
minlight = 13,
maxlight = 15,
steps = 8
}

View File

@ -0,0 +1,244 @@
local S = farming.intllib
-- place cocoa
local function place_cocoa(itemstack, placer, pointed_thing, plantname)
local pt = pointed_thing
-- check if pointing at a node
if not pt or pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
-- return if any of the nodes are not registered
if not minetest.registered_nodes[under.name] then
return
end
-- am I right-clicking on something that has a custom on_place set?
-- thanks to Krock for helping with this issue :)
local def = minetest.registered_nodes[under.name]
if placer and def and def.on_rightclick then
return def.on_rightclick(pt.under, under, placer, itemstack)
end
-- check if pointing at jungletree
if under.name ~= "default:jungletree"
or minetest.get_node(pt.above).name ~= "air" then
return
end
-- is player planting crop?
local name = placer and placer:get_player_name() or ""
-- check for protection
if minetest.is_protected(pt.above, name) then
return
end
-- add the node and remove 1 item from the itemstack
minetest.set_node(pt.above, {name = plantname})
minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
if placer and not farming.is_creative(placer:get_player_name()) then
itemstack:take_item()
-- check for refill
if itemstack:get_count() == 0 then
minetest.after(0.20,
farming.refill_plant,
placer,
"farming:cocoa_beans",
placer:get_wield_index()
)
end
end
return itemstack
end
-- cocoa beans
minetest.register_craftitem("farming:cocoa_beans", {
description = S("Cocoa Beans"),
inventory_image = "farming_cocoa_beans.png",
groups = {food_cocoa = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1")
end,
})
minetest.register_craft( {
output = "dye:brown 2",
recipe = {
{ "farming:cocoa_beans" },
}
})
-- chocolate cookie
minetest.register_craftitem("farming:cookie", {
description = S("Cookie"),
inventory_image = "farming_cookie.png",
on_use = minetest.item_eat(2),
})
minetest.register_craft( {
output = "farming:cookie 8",
recipe = {
{"group:food_wheat", "group:food_cocoa", "group:food_wheat" },
}
})
-- bar of dark chocolate (thanks to Ice Pandora for her deviantart.com chocolate tutorial)
minetest.register_craftitem("farming:chocolate_dark", {
description = S("Bar of Dark Chocolate"),
inventory_image = "farming_chocolate_dark.png",
on_use = minetest.item_eat(3),
})
minetest.register_craft( {
output = "farming:chocolate_dark",
recipe = {
{"group:food_cocoa", "group:food_cocoa", "group:food_cocoa"},
}
})
-- chocolate block
minetest.register_node("farming:chocolate_block", {
description = S("Chocolate Block"),
tiles = {"farming_chocolate_block.png"},
is_ground_content = false,
groups = {cracky = 2, oddly_breakable_by_hand = 2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_craft({
output = "farming:chocolate_block",
recipe = {
{"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"},
{"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"},
{"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"},
}
})
minetest.register_craft({
output = "farming:chocolate_dark 9",
recipe = {
{"farming:chocolate_block"},
}
})
-- cocoa definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_cocoa_1.png"},
paramtype = "light",
walkable = false,
drop = {
items = {
{items = {'farming:cocoa_beans 1'}, rarity = 2},
}
},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
},
groups = {
snappy = 3, flammable = 2, plant = 1, growing = 1,
not_in_creative_inventory=1, leafdecay = 1, leafdecay_drop = 1
},
sounds = default.node_sound_leaves_defaults(),
growth_check = function(pos, node_name)
if minetest.find_node_near(pos, 1, {"default:jungletree"}) then
return false
end
return true
end,
}
-- stage 1
minetest.register_node("farming:cocoa_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_cocoa_2.png"}
minetest.register_node("farming:cocoa_2", table.copy(crop_def))
-- stage3
crop_def.tiles = {"farming_cocoa_3.png"}
crop_def.drop = {
items = {
{items = {'farming:cocoa_beans'}, rarity = 2},
}
}
minetest.register_node("farming:cocoa_3", table.copy(crop_def))
-- stage 4 (final)
crop_def.tiles = {"farming_cocoa_4.png"}
crop_def.groups.growing = 0
crop_def.growth_check = nil
crop_def.drop = {
items = {
{items = {'farming:cocoa_beans 2'}, rarity = 1},
{items = {'farming:cocoa_beans 1'}, rarity = 2},
{items = {'farming:cocoa_beans 1'}, rarity = 4},
}
}
minetest.register_node("farming:cocoa_4", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:cocoa_beans"] = {
crop = "farming:cocoa",
seed = "farming:cocoa_beans",
minlight = 13,
maxlight = 15,
steps = 4
}
-- add random cocoa pods to jungle tree's
minetest.register_on_generated(function(minp, maxp)
if maxp.y < 0 then
return
end
local pos, dir
local cocoa = minetest.find_nodes_in_area(minp, maxp, "default:jungletree")
for n = 1, #cocoa do
pos = cocoa[n]
if minetest.find_node_near(pos, 1,
{"default:jungleleaves", "moretrees:jungletree_leaves_green"}) then
dir = math.random(1, 80)
if dir == 1 then
pos.x = pos.x + 1
elseif dir == 2 then
pos.x = pos.x - 1
elseif dir == 3 then
pos.z = pos.z + 1
elseif dir == 4 then
pos.z = pos.z -1
end
if dir < 5
and minetest.get_node(pos).name == "air"
and minetest.get_node_light(pos) > 12 then
--print ("Cocoa Pod added at " .. minetest.pos_to_string(pos))
minetest.swap_node(pos, {
name = "farming:cocoa_" .. tostring(math.random(1, 4))
})
end
end
end
end)

View File

@ -0,0 +1,97 @@
local S = farming.intllib
-- coffee
minetest.register_craftitem("farming:coffee_beans", {
description = S("Coffee Beans"),
inventory_image = "farming_coffee_beans.png",
groups = {food_coffee = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1")
end,
})
-- cold cup of coffee
minetest.register_node("farming:coffee_cup", {
description = S("Cup of Coffee"),
drawtype = "torchlike", --"plantlike",
tiles = {"farming_coffee_cup.png"},
inventory_image = "farming_coffee_cup.png",
wield_image = "farming_coffee_cup.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25}
},
groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
on_use = minetest.item_eat(2, "vessels:drinking_glass"),
sounds = default.node_sound_glass_defaults(),
})
minetest.register_alias("farming:coffee_cup_hot", "farming:coffee_cup")
minetest.register_alias("farming:drinking_cup", "vessels:drinking_glass")
minetest.register_craft( {
output = "farming:coffee_cup",
type = "shapeless",
recipe = {"vessels:drinking_glass", "group:food_coffee",
"bucket:bucket_water", "group:food_saucepan"},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty"},
{"group:food_saucepan", "farming:saucepan"},
}
})
-- coffee definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_coffee_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:coffee_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_coffee_2.png"}
minetest.register_node("farming:coffee_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_coffee_3.png"}
minetest.register_node("farming:coffee_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_coffee_4.png"}
minetest.register_node("farming:coffee_4", table.copy(crop_def))
-- stage 5 (final)
crop_def.tiles = {"farming_coffee_5.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:coffee_beans 2'}, rarity = 1},
{items = {'farming:coffee_beans 2'}, rarity = 2},
{items = {'farming:coffee_beans 2'}, rarity = 3},
}
}
minetest.register_node("farming:coffee_5", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:coffee"] = {
crop = "farming:coffee",
seed = "farming:coffee_beans",
minlight = 13,
maxlight = 15,
steps = 5
}

View File

@ -0,0 +1,265 @@
local S = farming.intllib
-- place trellis
local function place_grapes(itemstack, placer, pointed_thing, plantname)
local pt = pointed_thing
-- check if pointing at a node
if not pt or pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
-- return if any of the nodes are not registered
if not minetest.registered_nodes[under.name] then
return
end
-- am I right-clicking on something that has a custom on_place set?
-- thanks to Krock for helping with this issue :)
local def = minetest.registered_nodes[under.name]
if placer and def and def.on_rightclick then
return def.on_rightclick(pt.under, under, placer, itemstack)
end
-- is player planting seed?
local name = placer and placer:get_player_name() or ""
-- check for protection
if minetest.is_protected(pt.under, name) then
return
end
-- check if pointing at trellis
if under.name ~= "farming:trellis" then
return
end
-- add the node and remove 1 item from the itemstack
minetest.set_node(pt.under, {name = plantname})
minetest.sound_play("default_place_node", {pos = pt.under, gain = 1.0})
if placer and not farming.is_creative(placer:get_player_name()) then
itemstack:take_item()
-- check for refill
if itemstack:get_count() == 0 then
minetest.after(0.20,
farming.refill_plant,
placer,
"farming:grapes",
placer:get_wield_index()
)
end
end
return itemstack
end
-- grapes
minetest.register_craftitem("farming:grapes", {
description = S("Grapes"),
inventory_image = "farming_grapes.png",
on_use = minetest.item_eat(2),
groups = {food_grapes = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return place_grapes(itemstack, placer, pointed_thing, "farming:grapes_1")
end,
})
-- grapes can be used for violet dye
minetest.register_craft({
output = "dye:violet",
recipe = {
{'farming:grapes'},
}
})
-- trellis
minetest.register_node("farming:trellis", {
description = S("Trellis (place on soil before planting grapes)"),
drawtype = "plantlike",
tiles = {"farming_trellis.png"},
inventory_image = "farming_trellis.png",
visual_scale = 1.9, -- 1.45,
paramtype = "light",
walkable = false,
buildable_to = true,
sunlight_propagates = true,
drop = "farming:trellis",
selection_box = farming.select,
groups = {snappy = 3, flammable = 2, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local pt = pointed_thing
-- check if pointing at a node
if not pt or pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
-- return if any of the nodes are not registered
if not minetest.registered_nodes[under.name] then
return
end
-- am I right-clicking on something that has a custom on_place set?
-- thanks to Krock for helping with this issue :)
local def = minetest.registered_nodes[under.name]
if def and def.on_rightclick then
return def.on_rightclick(pt.under, under, placer, itemstack)
end
if minetest.is_protected(pt.above, placer:get_player_name()) then
return
end
local nodename = under.name
if minetest.get_item_group(nodename, "soil") < 2 then
return
end
local top = {
x = pointed_thing.above.x,
y = pointed_thing.above.y + 1,
z = pointed_thing.above.z
}
nodename = minetest.get_node(top).name
if nodename ~= "air" then
return
end
minetest.set_node(pointed_thing.above, {name = "farming:trellis"})
if not farming.is_creative(placer:get_player_name()) then
itemstack:take_item()
end
return itemstack
end
})
minetest.register_craft({
output = "farming:trellis",
recipe = {
{'default:stick', 'default:stick', 'default:stick'},
{'default:stick', 'default:stick', 'default:stick'},
{'default:stick', 'default:stick', 'default:stick'},
}
})
minetest.register_craft({
type = "fuel",
recipe = "farming:trellis",
burntime = 15,
})
-- grapes definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_grapes_1.png"},
visual_scale = 1.9, -- 1.45,
paramtype = "light",
walkable = false,
buildable_to = true,
sunlight_propagates = true,
drop = {
items = {
{items = {'farming:trellis'}, rarity = 1},
}
},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 3, not_in_creative_inventory = 1,
attached_node = 1, growing = 1, plant = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:grapes_1", table.copy(crop_def))
-- stage2
crop_def.tiles = {"farming_grapes_2.png"}
minetest.register_node("farming:grapes_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_grapes_3.png"}
minetest.register_node("farming:grapes_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_grapes_4.png"}
minetest.register_node("farming:grapes_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_grapes_5.png"}
minetest.register_node("farming:grapes_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_grapes_6.png"}
minetest.register_node("farming:grapes_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_grapes_7.png"}
minetest.register_node("farming:grapes_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.tiles = {"farming_grapes_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:trellis'}, rarity = 1},
{items = {'farming:grapes 3'}, rarity = 1},
{items = {'farming:grapes'}, rarity = 2},
{items = {'farming:grapes'}, rarity = 3},
}
}
minetest.register_node("farming:grapes_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:grapes"] = {
crop = "farming:grapes",
seed = "farming:grapes",
minlight = 13,
maxlight = 15,
steps = 8
}
-- wild grape vine (this is what you find on the map)
minetest.register_node("farming:grapebush", {
drawtype = "plantlike",
tiles = {"farming_grapebush.png"},
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
sunlight_propagates = true,
drop = {
items = {
{items = {'farming:grapes 1'}, rarity = 1},
{items = {'farming:grapes 1'}, rarity = 2},
{items = {'farming:grapes 1'}, rarity = 3},
}
},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory=1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -0,0 +1,260 @@
local S = farming.intllib
-- hemp seeds
minetest.register_node("farming:seed_hemp", {
description = S("Hemp Seed"),
tiles = {"farming_hemp_seed.png"},
inventory_image = "farming_hemp_seed.png",
wield_image = "farming_hemp_seed.png",
drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1},
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = farming.select,
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:hemp_1")
end,
})
-- harvested hemp
minetest.register_craftitem("farming:hemp_leaf", {
description = S("Hemp Leaf"),
inventory_image = "farming_hemp_leaf.png",
})
-- hemp oil
minetest.register_node("farming:hemp_oil", {
description = S("Bottle of Hemp Oil"),
drawtype = "plantlike",
tiles = {"farming_hemp_oil.png"},
inventory_image = "farming_hemp_oil.png",
wield_image = "farming_hemp_oil.png",
paramtype = "light",
is_ground_content = false,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
},
groups = {food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_craft( {
output = "farming:hemp_oil",
recipe = {
{"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"},
{"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"},
{"", "vessels:glass_bottle", ""}
}
})
minetest.register_craft( {
output = "farming:hemp_oil",
recipe = {
{"farming:seed_hemp", "farming:seed_hemp", "farming:seed_hemp"},
{"farming:seed_hemp", "farming:seed_hemp", "farming:seed_hemp"},
{"farming:seed_hemp", "vessels:glass_bottle", "farming:seed_hemp"}
}
})
minetest.register_craft({
type = "fuel",
recipe = "farming:hemp_oil",
burntime = 20,
replacements = {{ "farming:hemp_oil", "vessels:glass_bottle"}}
})
-- hemp fibre
minetest.register_craftitem("farming:hemp_fibre", {
description = S("Hemp Fibre"),
inventory_image = "farming_hemp_fibre.png",
})
minetest.register_craft( {
output = "farming:hemp_fibre 8",
recipe = {
{"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"},
{"farming:hemp_leaf", "bucket:bucket_water", "farming:hemp_leaf"},
{"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}
},
replacements = {{ "bucket:bucket_water", "bucket:bucket_empty"}}
})
minetest.register_craft( {
output = "farming:hemp_fibre 8",
recipe = {
{"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"},
{"farming:hemp_leaf", "bucket:bucket_river_water", "farming:hemp_leaf"},
{"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}
},
replacements = {{ "bucket:bucket_river_water", "bucket:bucket_empty"}}
})
-- hemp block
minetest.register_node("farming:hemp_block", {
description = S("Hemp Block"),
tiles = {"farming_hemp_block.png"},
paramtype = "light",
groups = {snappy = 1, oddly_breakable_by_hand = 1, flammable = 2}
})
minetest.register_craft( {
output = "farming:hemp_block",
recipe = {
{"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"},
{"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"},
{"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}
},
})
-- check and register stairs
if minetest.global_exists("stairs") then
if stairs.mod and stairs.mod == "redo" then
stairs.register_all("hemp_block", "farming:hemp_block",
{snappy = 1, flammable = 2},
{"farming_hemp_block.png"},
"Hemp Block",
default.node_sound_leaves_defaults())
else
stairs.register_stair_and_slab("hemp_block", "farming:hemp_block",
{snappy = 1, flammable = 2},
{"farming_hemp_block.png"},
"Hemp Block Stair",
"Hemp Block Slab",
default.node_sound_leaves_defaults())
end
end
-- paper
minetest.register_craft( {
output = "default:paper",
recipe = {
{"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"},
}
})
-- string
minetest.register_craft( {
output = "farming:cotton",
recipe = {
{"farming:hemp_fibre"},
{"farming:hemp_fibre"},
{"farming:hemp_fibre"},
}
})
-- hemp rope
minetest.register_node("farming:hemp_rope", {
description = S("Hemp Rope"),
walkable = false,
climbable = true,
sunlight_propagates = true,
paramtype = "light",
tiles = {"farming_hemp_rope.png"},
wield_image = "farming_hemp_rope.png",
inventory_image = "farming_hemp_rope.png",
drawtype = "plantlike",
groups = {flammable = 2, choppy = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
})
-- string
minetest.register_craft( {
output = "farming:hemp_rope 6",
recipe = {
{"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"},
{"farming:cotton", "farming:cotton", "farming:cotton"},
{"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"},
}
})
-- hemp definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_hemp_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:hemp_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_hemp_2.png"}
minetest.register_node("farming:hemp_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_hemp_3.png"}
minetest.register_node("farming:hemp_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_hemp_4.png"}
minetest.register_node("farming:hemp_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_hemp_5.png"}
minetest.register_node("farming:hemp_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_hemp_6.png"}
crop_def.drop = {
items = {
{items = {'farming:hemp_leaf'}, rarity = 2},
{items = {'farming:seed_hemp'}, rarity = 1},
}
}
minetest.register_node("farming:hemp_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_hemp_7.png"}
crop_def.drop = {
items = {
{items = {'farming:hemp_leaf'}, rarity = 1},
{items = {'farming:hemp_leaf'}, rarity = 3},
{items = {'farming:seed_hemp'}, rarity = 1},
{items = {'farming:seed_hemp'}, rarity = 3},
}
}
minetest.register_node("farming:hemp_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.tiles = {"farming_hemp_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:hemp_leaf 2'}, rarity = 1},
{items = {'farming:hemp_leaf'}, rarity = 2},
{items = {'farming:seed_hemp'}, rarity = 1},
{items = {'farming:seed_hemp'}, rarity = 2},
}
}
minetest.register_node("farming:hemp_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:hemp"] = {
crop = "farming:hemp",
seed = "farming:seed_hemp",
minlight = 13,
maxlight = 15,
steps = 8
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

View File

@ -0,0 +1,76 @@
--[[
Original textures from Crops Plus mod
Copyright (C) 2018 Grizzly Adam
https://forum.minetest.net/viewtopic.php?f=9&t=19488
]]
local S = farming.intllib
-- potato
minetest.register_craftitem("farming:onion", {
description = S("Onion"),
inventory_image = "crops_onion.png",
groups = {food_onion = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1")
end,
on_use = minetest.item_eat(1),
})
-- crop definition
local crop_def = {
drawtype = "plantlike",
tiles = {"crops_onion_plant_1.png"},
paramtype = "light",
paramtype2 = "meshoptions",
place_param2 = 3,
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 3, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:onion_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"crops_onion_plant_2.png"}
minetest.register_node("farming:onion_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"crops_onion_plant_3.png"}
minetest.register_node("farming:onion_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"crops_onion_plant_4.png"}
minetest.register_node("farming:onion_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"crops_onion_plant_5.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:onion 2'}, rarity = 1},
{items = {'farming:onion'}, rarity = 2},
{items = {'farming:onion'}, rarity = 2},
{items = {'farming:onion'}, rarity = 5},
}
}
minetest.register_node("farming:onion_5", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:onion"] = {
crop = "farming:onion",
seed = "farming:onion",
minlight = 13,
maxlight = 15,
steps = 5
}

View File

@ -0,0 +1,97 @@
local S = farming.intllib
-- Textures for Pea crop and Peas were done by Andrey01
-- pea pod
minetest.register_craftitem("farming:pea_pod", {
description = S("Pea Pod"),
inventory_image = "farming_pea_pod.png",
groups = {food_pea_pod = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pea_1")
end
})
minetest.register_craftitem("farming:peas", {
description = S("Peas"),
inventory_image = "farming_pea_peas.png",
groups = {food_peas = 1, flammable = 2},
on_use = minetest.item_eat(1)
})
minetest.register_craft({
type = "shapeless",
output = "farming:peas",
recipe = {"farming:pea_pod"}
})
-- pea soup
minetest.register_craftitem("farming:pea_soup", {
description = S("Pea Soup"),
inventory_image = "farming_pea_soup.png",
groups = {flammable = 2},
on_use = minetest.item_eat(4, "farming:bowl"),
})
minetest.register_craft({
type = "shapeless",
output = "farming:pea_soup",
recipe = {"group:food_peas", "group:food_peas", "group:food_bowl"}
})
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_pea_1.png"},
paramtype = "light",
paramtype2 = "meshoptions",
place_param2 = 3,
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:pea_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_pea_2.png"}
minetest.register_node("farming:pea_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_pea_3.png"}
minetest.register_node("farming:pea_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_pea_4.png"}
minetest.register_node("farming:pea_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_pea_5.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:pea_pod'}, rarity = 1},
{items = {'farming:pea_pod'}, rarity = 2},
{items = {'farming:pea_pod'}, rarity = 4},
{items = {'farming:pea_pod'}, rarity = 5},
}
}
minetest.register_node("farming:pea_5", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:pea_pod"] = {
crop = "farming:pea",
seed = "farming:pea_pod",
minlight = 13,
maxlight = 15,
steps = 5
}

View File

@ -0,0 +1,115 @@
--[[
Original textures from Crops Plus mod
Copyright (C) 2018 Grizzly Adam
https://forum.minetest.net/viewtopic.php?f=9&t=19488
]]
local S = farming.intllib
-- peppercorn (seed)
minetest.register_craftitem("farming:peppercorn", {
description = S("Peppercorn"),
inventory_image = "crops_peppercorn.png",
groups = {food_peppercorn = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1")
end,
})
-- green pepper
minetest.register_craftitem("farming:pepper", {
description = S("Pepper"),
inventory_image = "crops_pepper.png",
on_use = minetest.item_eat(2),
groups = {food_pepper = 1, flammable = 3},
})
minetest.register_craft({
type = "shapeless",
output = "farming:peppercorn",
recipe = {"farming:pepper"}
})
-- ground pepper
minetest.register_node("farming:pepper_ground", {
description = ("Ground Pepper"),
inventory_image = "crops_pepper_ground.png",
wield_image = "crops_pepper_ground.png",
drawtype = "plantlike",
visual_scale = 0.8,
paramtype = "light",
tiles = {"crops_pepper_ground.png"},
groups = {
vessel = 1, food_pepper_ground = 1,
dig_immediate = 3, attached_node = 1
},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
},
})
minetest.register_craft( {
output = "farming:pepper_ground",
type = "shapeless",
recipe = {"group:food_peppercorn", "vessels:glass_bottle", "farming:mortar_pestle"},
replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}},
})
-- crop definition
local crop_def = {
drawtype = "plantlike",
tiles = {"crops_pepper_plant_1.png"},
paramtype = "light",
paramtype2 = "meshoptions",
place_param2 = 1,
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 3, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:pepper_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"crops_pepper_plant_2.png"}
minetest.register_node("farming:pepper_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"crops_pepper_plant_3.png"}
minetest.register_node("farming:pepper_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"crops_pepper_plant_4.png"}
minetest.register_node("farming:pepper_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"crops_pepper_plant_5.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:pepper 2'}, rarity = 1},
{items = {'farming:pepper'}, rarity = 2},
{items = {'farming:pepper'}, rarity = 3},
}
}
minetest.register_node("farming:pepper_5", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:pepper"] = {
crop = "farming:pepper",
seed = "farming:peppercorn",
minlight = 13,
maxlight = 15,
steps = 5
}

View File

@ -0,0 +1,108 @@
local S = farming.intllib
-- pineapple top
minetest.register_craftitem("farming:pineapple_top", {
description = S("Pineapple Top"),
inventory_image = "farming_pineapple_top.png",
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pineapple_1")
end,
})
-- pineapple
minetest.register_node("farming:pineapple", {
description = S("Pineapple"),
drawtype = "plantlike",
tiles = {"farming_pineapple.png"},
inventory_image = "farming_pineapple.png",
wield_image = "farming_pineapple.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
},
groups = {food_pineapple = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
})
-- pineapple
minetest.register_craftitem("farming:pineapple_ring", {
description = S("Pineapple Ring"),
inventory_image = "farming_pineapple_ring.png",
groups = {food_pineapple_ring = 1, flammable = 2},
on_use = minetest.item_eat(1),
})
minetest.register_craft( {
output = "farming:pineapple_ring 5",
type = "shapeless",
recipe = {"group:food_pineapple"},
replacements = {{"farming:pineapple", "farming:pineapple_top"}}
})
-- crop definition
local crop_def = {
drawtype = "plantlike",
visual_scale = 1.5,
tiles = {"farming_pineapple_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:pineapple_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_pineapple_2.png"}
minetest.register_node("farming:pineapple_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_pineapple_3.png"}
minetest.register_node("farming:pineapple_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_pineapple_4.png"}
minetest.register_node("farming:pineapple_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_pineapple_5.png"}
minetest.register_node("farming:pineapple_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_pineapple_6.png"}
minetest.register_node("farming:pineapple_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_pineapple_7.png"}
minetest.register_node("farming:pineapple_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.tiles = {"farming_pineapple_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:pineapple'}, rarity = 1},
{items = {'farming:pineapple'}, rarity = 15},
}
}
minetest.register_node("farming:pineapple_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:pineapple"] = {
crop = "farming:pineapple",
seed = "farming:pineapple_top",
minlight = 13,
maxlight = 15,
steps = 8
}

View File

@ -0,0 +1,111 @@
--[[
Original textures from DocFarming mod
https://forum.minetest.net/viewtopic.php?id=3948
]]
local S = farming.intllib
-- potato
minetest.register_craftitem("farming:potato", {
description = S("Potato"),
inventory_image = "farming_potato.png",
groups = {food_potato = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1")
end,
-- on_use = minetest.item_eat(1),
on_use = function(itemstack, user, pointed_thing)
if user then
if math.random(1, 3) == 1 then
return minetest.do_item_eat(-1, nil, itemstack, user, pointed_thing)
else
return minetest.do_item_eat(1, nil, itemstack, user, pointed_thing)
end
end
end,
})
-- baked potato
minetest.register_craftitem("farming:baked_potato", {
description = S("Baked Potato"),
inventory_image = "farming_baked_potato.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "farming:baked_potato",
recipe = "group:food_potato"
})
-- Potato and cucumber Salad
minetest.register_craftitem("farming:potato_salad", {
description = S("Cucumber and Potato Salad"),
inventory_image = "farming_potato_salad.png",
on_use = minetest.item_eat(10, "farming:bowl"),
})
minetest.register_craft({
output = "farming:potato_salad",
recipe = {
{"group:food_cucumber"},
{"farming:baked_potato"},
{"group:food_bowl"},
}
})
-- potato definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_potato_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:potato_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_potato_2.png"}
minetest.register_node("farming:potato_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_potato_3.png"}
crop_def.drop = {
items = {
{items = {'farming:potato'}, rarity = 5},
}
}
minetest.register_node("farming:potato_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_potato_4.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:potato 2'}, rarity = 1},
{items = {'farming:potato 3'}, rarity = 2},
}
}
minetest.register_node("farming:potato_4", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:potato"] = {
crop = "farming:potato",
seed = "farming:potato",
minlight = 13,
maxlight = 15,
steps = 4
}

View File

@ -0,0 +1,194 @@
--[[
Big thanks to PainterlyPack.net for allowing me to use these textures
]]
local S = farming.intllib
-- pumpkin slice
minetest.register_craftitem("farming:pumpkin_slice", {
description = S("Pumpkin Slice"),
inventory_image = "farming_pumpkin_slice.png",
groups = {food_pumpkin_slice = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1")
end,
on_use = minetest.item_eat(2),
})
minetest.register_craft({
output = "farming:pumpkin",
recipe = {
{"farming:pumpkin_slice", "farming:pumpkin_slice"},
}
})
minetest.register_craft({
type = "shapeless",
output = "farming:pumpkin_slice 4",
recipe = {"farming:pumpkin", "farming:cutting_board"},
replacements = {{"farming:cutting_board", "farming:cutting_board"}},
})
-- jack 'o lantern
minetest.register_node("farming:jackolantern", {
description = S("Jack 'O Lantern (punch to turn on and off)"),
tiles = {
"farming_pumpkin_top.png",
"farming_pumpkin_top.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_face_off.png"
},
paramtype2 = "facedir",
groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_punch = function(pos, node, puncher)
local name = puncher:get_player_name() or ""
if minetest.is_protected(pos, name) then return end
node.name = "farming:jackolantern_on"
minetest.swap_node(pos, node)
end,
})
minetest.register_node("farming:jackolantern_on", {
tiles = {
"farming_pumpkin_top.png",
"farming_pumpkin_top.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_face_on.png"
},
light_source = default.LIGHT_MAX - 1,
paramtype2 = "facedir",
groups = {
choppy = 1, oddly_breakable_by_hand = 1, flammable = 2,
not_in_creative_inventory = 1
},
sounds = default.node_sound_wood_defaults(),
drop = "farming:jackolantern",
on_punch = function(pos, node, puncher)
local name = puncher:get_player_name() or ""
if minetest.is_protected(pos, name) then return end
node.name = "farming:jackolantern"
minetest.swap_node(pos, node)
end,
})
minetest.register_craft({
output = "farming:jackolantern",
recipe = {
{"ethereal:candle"},
{"group:food_pumpkin"},
}
})
-- pumpkin bread
minetest.register_craftitem("farming:pumpkin_bread", {
description = S("Pumpkin Bread"),
inventory_image = "farming_pumpkin_bread.png",
on_use = minetest.item_eat(8),
groups = {food_bread = 1, flammable = 2},
})
minetest.register_craftitem("farming:pumpkin_dough", {
description = S("Pumpkin Dough"),
inventory_image = "farming_pumpkin_dough.png",
})
minetest.register_craft({
output = "farming:pumpkin_dough",
type = "shapeless",
recipe = {"group:food_flour", "group:food_pumpkin_slice", "group:food_pumpkin_slice"}
})
minetest.register_craft({
type = "cooking",
output = "farming:pumpkin_bread",
recipe = "farming:pumpkin_dough",
cooktime = 10
})
-- pumpkin definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_pumpkin_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:pumpkin_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_pumpkin_2.png"}
minetest.register_node("farming:pumpkin_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_pumpkin_3.png"}
minetest.register_node("farming:pumpkin_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_pumpkin_4.png"}
minetest.register_node("farming:pumpkin_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_pumpkin_5.png"}
minetest.register_node("farming:pumpkin_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_pumpkin_6.png"}
minetest.register_node("farming:pumpkin_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_pumpkin_7.png"}
minetest.register_node("farming:pumpkin_7", table.copy(crop_def))
-- stage 8 (final)
--[[
crop_def.tiles = {"farming_pumpkin_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:pumpkin_slice 9'}, rarity = 1},
}
}
minetest.register_node("farming:pumpkin_8", table.copy(crop_def))
]]
minetest.register_node("farming:pumpkin_8", {
description = S("Pumpkin"),
tiles = {
"farming_pumpkin_top.png",
"farming_pumpkin_top.png",
"farming_pumpkin_side.png"
},
groups = {
food_pumpkin = 1, choppy = 1, oddly_breakable_by_hand = 1,
flammable = 2, plant = 1
},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_alias("farming:pumpkin", "farming:pumpkin_8")
-- add to registered_plants
farming.registered_plants["farming:pumpkin"] = {
crop = "farming:pumpkin",
seed = "farming:pumpkin_slice",
minlight = 13,
maxlight = 15,
steps = 8
}

View File

@ -0,0 +1,62 @@
local S = farming.intllib
-- raspberries
minetest.register_craftitem("farming:raspberries", {
description = S("Raspberries"),
inventory_image = "farming_raspberries.png",
groups = {food_raspberries = 1, food_raspberry = 1, food_berry = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1")
end,
on_use = minetest.item_eat(1),
})
-- raspberries definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_raspberry_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:raspberry_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_raspberry_2.png"}
minetest.register_node("farming:raspberry_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_raspberry_3.png"}
minetest.register_node("farming:raspberry_3", table.copy(crop_def))
-- stage 4 (final)
crop_def.tiles = {"farming_raspberry_4.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:raspberries 2'}, rarity = 1},
{items = {'farming:raspberries'}, rarity = 2},
{items = {'farming:raspberries'}, rarity = 3},
}
}
minetest.register_node("farming:raspberry_4", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:raspberries"] = {
crop = "farming:raspberry",
seed = "farming:raspberries",
minlight = 13,
maxlight = 15,
steps = 4
}

View File

@ -0,0 +1,75 @@
local S = farming.intllib
-- rhubarb
minetest.register_craftitem("farming:rhubarb", {
description = S("Rhubarb"),
inventory_image = "farming_rhubarb.png",
groups = {food_rhubarb = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1")
end,
on_use = minetest.item_eat(1),
})
-- rhubarb pie
minetest.register_craftitem("farming:rhubarb_pie", {
description = S("Rhubarb Pie"),
inventory_image = "farming_rhubarb_pie.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "farming:rhubarb_pie",
recipe = {
{"farming:baking_tray", "group:food_sugar", ""},
{"group:food_rhubarb", "group:food_rhubarb", "group:food_rhubarb"},
{"group:food_wheat", "group:food_wheat", "group:food_wheat"},
},
replacements = {{"group:food_baking_tray", "farming:baking_tray"}}
})
-- rhubarb definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_rhubarb_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:rhubarb_1", table.copy(crop_def))
-- stage2
crop_def.tiles = {"farming_rhubarb_2.png"}
minetest.register_node("farming:rhubarb_2", table.copy(crop_def))
-- stage 3 (final)
crop_def.tiles = {"farming_rhubarb_3.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:rhubarb 2'}, rarity = 1},
{items = {'farming:rhubarb'}, rarity = 2},
{items = {'farming:rhubarb'}, rarity = 3},
}
}
minetest.register_node("farming:rhubarb_3", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:rhubarb"] = {
crop = "farming:rhubarb",
seed = "farming:rhubarb",
minlight = 13,
maxlight = 15,
steps = 3
}

View File

@ -0,0 +1,162 @@
local S = farming.intllib
--= A nice addition from Ademant's grain mod :)
-- Rye
farming.register_plant("farming:rye", {
description = "Rye seed",
paramtype2 = "meshoptions",
inventory_image = "farming_rye_seed.png",
steps = 8,
place_param2 = 3,
})
minetest.override_item("farming:rye", {
groups = {food_rye = 1, flammable = 4}
})
minetest.register_craft({
type = "shapeless",
output = "farming:flour",
recipe = {
"farming:rye", "farming:rye", "farming:rye", "farming:rye",
"farming:mortar_pestle"
},
replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}},
})
-- Oats
farming.register_plant("farming:oat", {
description = "Oat seed",
paramtype2 = "meshoptions",
inventory_image = "farming_oat_seed.png",
steps = 8,
place_param2 = 3,
})
minetest.override_item("farming:oat", {
groups = {food_oats = 1, flammable = 4}
})
minetest.register_craft({
type = "shapeless",
output = "farming:flour",
recipe = {
"farming:oat", "farming:oat", "farming:oat", "farming:oat",
"farming:mortar_pestle"
},
replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}},
})
-- Rice
farming.register_plant("farming:rice", {
description = "Rice grains",
paramtype2 = "meshoptions",
inventory_image = "farming_rice_seed.png",
steps = 8,
place_param2 = 3,
})
minetest.override_item("farming:rice", {
groups = {food_rice = 1, flammable = 4}
})
minetest.register_craftitem("farming:rice_bread", {
description = "Rice Bread",
inventory_image = "farming_rice_bread.png",
on_use = minetest.item_eat(5),
groups = {food_rice_bread = 1, flammable = 2},
})
minetest.register_craftitem("farming:rice_flour", {
description = "Rice Flour",
inventory_image = "farming_rice_flour.png",
groups = {food_rice_flour = 1, flammable = 1},
})
minetest.register_craft({
type = "shapeless",
output = "farming:rice_flour",
recipe = {
"farming:rice", "farming:rice", "farming:rice", "farming:rice",
"farming:mortar_pestle"
},
replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}},
})
minetest.register_craft({
type = "cooking",
cooktime = 15,
output = "farming:rice_bread",
recipe = "farming:rice_flour"
})
-- Multigrain flour
minetest.register_craftitem("farming:flour_multigrain", {
description = S("Multigrain Flour"),
inventory_image = "farming_flour_multigrain.png",
groups = {food_flour = 1, flammable = 1},
})
minetest.register_craft({
type = "shapeless",
output = "farming:flour_multigrain",
recipe = {
"farming:wheat", "farming:barley", "farming:oat",
"farming:rye", "farming:mortar_pestle"
},
replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}},
})
-- Multigrain bread
minetest.register_craftitem("farming:bread_multigrain", {
description = S("Multigrain Bread"),
inventory_image = "farming_bread_multigrain.png",
on_use = minetest.item_eat(7),
groups = {food_bread = 1, flammable = 2},
})
minetest.register_craft({
type = "cooking",
cooktime = 15,
output = "farming:bread_multigrain",
recipe = "farming:flour_multigrain"
})
-- Fuels
minetest.register_craft({
type = "fuel",
recipe = "farming:rice_bread",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "farming:bread_multigrain",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "farming:rye",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "farming:oat",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "farming:rice",
burntime = 1,
})

View File

@ -0,0 +1,88 @@
--[[
Textures edited from:
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1288375-food-plus-mod-more-food-than-you-can-imagine-v2-9)
]]
local S = farming.intllib
-- tomato
minetest.register_craftitem("farming:tomato", {
description = S("Tomato"),
inventory_image = "farming_tomato.png",
groups = {food_tomato = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1")
end,
on_use = minetest.item_eat(4),
})
-- tomato definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_tomato_1.png"},
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:tomato_1", table.copy(crop_def))
-- stage2
crop_def.tiles = {"farming_tomato_2.png"}
minetest.register_node("farming:tomato_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_tomato_3.png"}
minetest.register_node("farming:tomato_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_tomato_4.png"}
minetest.register_node("farming:tomato_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_tomato_5.png"}
minetest.register_node("farming:tomato_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_tomato_6.png"}
minetest.register_node("farming:tomato_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_tomato_7.png"}
crop_def.drop = {
items = {
{items = {'farming:tomato'}, rarity = 2},
{items = {'farming:tomato'}, rarity = 4},
}
}
minetest.register_node("farming:tomato_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.tiles = {"farming_tomato_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:tomato 3'}, rarity = 1},
{items = {'farming:tomato 3'}, rarity = 2},
}
}
minetest.register_node("farming:tomato_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:tomato"] = {
crop = "farming:tomato",
seed = "farming:tomato",
minlight = 13,
maxlight = 15,
steps = 8
}

View File

@ -0,0 +1,241 @@
local S = farming.intllib
-- wheat seeds
minetest.register_node("farming:seed_wheat", {
description = S("Wheat Seed"),
tiles = {"farming_wheat_seed.png"},
inventory_image = "farming_wheat_seed.png",
wield_image = "farming_wheat_seed.png",
drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4},
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = farming.select,
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:wheat_1")
end,
})
-- harvested wheat
minetest.register_craftitem("farming:wheat", {
description = S("Wheat"),
inventory_image = "farming_wheat.png",
groups = {food_wheat = 1, flammable = 4},
})
-- straw
minetest.register_node("farming:straw", {
description = S("Straw"),
tiles = {"farming_straw.png"},
is_ground_content = false,
groups = {snappy = 3, flammable = 4, fall_damage_add_percent = -30},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_craft({
output = "farming:straw 3",
recipe = {
{"farming:wheat", "farming:wheat", "farming:wheat"},
{"farming:wheat", "farming:wheat", "farming:wheat"},
{"farming:wheat", "farming:wheat", "farming:wheat"},
}
})
minetest.register_craft({
output = "farming:wheat 3",
recipe = {
{"farming:straw"},
}
})
-- check and register stairs
if minetest.global_exists("stairs") then
if stairs.mod and stairs.mod == "redo" then
stairs.register_all("straw", "farming:straw",
{snappy = 3, flammable = 4},
{"farming_straw.png"},
"Straw",
default.node_sound_leaves_defaults())
else
stairs.register_stair_and_slab("straw", "farming:straw",
{snappy = 3, flammable = 4},
{"farming_straw.png"},
"Straw Stair",
"Straw Slab",
default.node_sound_leaves_defaults())
end
end
-- flour
minetest.register_craftitem("farming:flour", {
description = S("Flour"),
inventory_image = "farming_flour.png",
groups = {food_flour = 1, flammable = 1},
})
minetest.register_craft({
type = "shapeless",
output = "farming:flour",
recipe = {
"farming:wheat", "farming:wheat", "farming:wheat",
"farming:wheat", "farming:mortar_pestle"
},
replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}},
})
-- bread
minetest.register_craftitem("farming:bread", {
description = S("Bread"),
inventory_image = "farming_bread.png",
on_use = minetest.item_eat(5),
groups = {food_bread = 1, flammable = 2},
})
minetest.register_craft({
type = "cooking",
cooktime = 15,
output = "farming:bread",
recipe = "farming:flour"
})
-- sliced bread
minetest.register_craftitem("farming:bread_slice", {
description = S("Sliced Bread"),
inventory_image = "farming_bread_slice.png",
on_use = minetest.item_eat(1),
groups = {food_bread_slice = 1, flammable = 2},
})
minetest.register_craft({
type = "shapeless",
output = "farming:bread_slice 5",
recipe = {"farming:bread", "group:food_cutting_board"},
replacements = {{"group:food_cutting_board", "farming:cutting_board"}},
})
-- toast
minetest.register_craftitem("farming:toast", {
description = S("Toast"),
inventory_image = "farming_toast.png",
on_use = minetest.item_eat(1),
groups = {food_toast = 1, flammable = 2},
})
minetest.register_craft({
type = "cooking",
cooktime = 3,
output = "farming:toast",
recipe = "farming:bread_slice"
})
-- toast sandwich
minetest.register_craftitem("farming:toast_sandwich", {
description = S("Toast Sandwich"),
inventory_image = "farming_toast_sandwich.png",
on_use = minetest.item_eat(4),
groups = {flammable = 2},
})
minetest.register_craft({
output = "farming:toast_sandwich",
recipe = {
{"farming:bread_slice"},
{"farming:toast"},
{"farming:bread_slice"},
}
})
-- wheat definition
local crop_def = {
drawtype = "plantlike",
tiles = {"farming_wheat_1.png"},
paramtype = "light",
paramtype2 = "meshoptions",
place_param2 = 3,
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = farming.select,
groups = {
snappy = 3, flammable = 4, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults()
}
-- stage 1
minetest.register_node("farming:wheat_1", table.copy(crop_def))
-- stage 2
crop_def.tiles = {"farming_wheat_2.png"}
minetest.register_node("farming:wheat_2", table.copy(crop_def))
-- stage 3
crop_def.tiles = {"farming_wheat_3.png"}
minetest.register_node("farming:wheat_3", table.copy(crop_def))
-- stage 4
crop_def.tiles = {"farming_wheat_4.png"}
minetest.register_node("farming:wheat_4", table.copy(crop_def))
-- stage 5
crop_def.tiles = {"farming_wheat_5.png"}
minetest.register_node("farming:wheat_5", table.copy(crop_def))
-- stage 6
crop_def.tiles = {"farming_wheat_6.png"}
minetest.register_node("farming:wheat_6", table.copy(crop_def))
-- stage 7
crop_def.tiles = {"farming_wheat_7.png"}
crop_def.drop = {
items = {
{items = {'farming:wheat'}, rarity = 2},
{items = {'farming:seed_wheat'}, rarity = 3},
}
}
minetest.register_node("farming:wheat_7", table.copy(crop_def))
-- stage 8 (final)
crop_def.tiles = {"farming_wheat_8.png"}
crop_def.groups.growing = 0
crop_def.drop = {
items = {
{items = {'farming:wheat'}, rarity = 1},
{items = {'farming:wheat'}, rarity = 3},
{items = {'farming:seed_wheat'}, rarity = 1},
{items = {'farming:seed_wheat'}, rarity = 3},
}
}
minetest.register_node("farming:wheat_8", table.copy(crop_def))
-- add to registered_plants
farming.registered_plants["farming:wheat"] = {
crop = "farming:wheat",
seed = "farming:seed_wheat",
minlight = 13,
maxlight = 15,
steps = 8
}
-- fuels
minetest.register_craft({
type = "fuel",
recipe = "farming:straw",
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "farming:wheat",
burntime = 1,
})

View File

@ -0,0 +1,5 @@
default
stairs?
intllib?
lucky_block?
toolranks?

View File

@ -0,0 +1 @@
Adds many plants and food to Minetest

View File

@ -0,0 +1,35 @@
--[[
Farming settings can be changed here and kept inside mod folder
even after the mod has been updated, or you can place inside
world folder for map specific settings.
--]]
-- true to enable crop/food in-game and on mapgen set spawn rarety
farming.carrot = 0.001
farming.potato = 0.001
farming.tomato = 0.001
farming.cucumber = 0.001
farming.corn = 0.001
farming.coffee = 0.001
farming.melon = 0.001
farming.pumpkin = 0.001
farming.cocoa = true -- true or false only
farming.raspberry = 0.001
farming.blueberry = 0.001
farming.rhubarb = 0.001
farming.beans = 0.001
farming.grapes = 0.001
farming.barley = true -- true or false only
farming.chili = 0.003
farming.hemp = 0.003
farming.garlic = 0.001
farming.onion = 0.001
farming.pepper = 0.002
farming.pineapple = 0.001
farming.peas = 0.001
farming.beetroot = 0.001
farming.grains = true -- true or false only
-- default rarety of crops on map (higher number = more crops)
farming.rarety = 0.002

View File

@ -0,0 +1,220 @@
local S = farming.intllib
--= Sugar
minetest.register_craftitem("farming:sugar", {
description = S("Sugar"),
inventory_image = "farming_sugar.png",
groups = {food_sugar = 1, flammable = 3},
})
minetest.register_craft({
type = "cooking",
cooktime = 3,
output = "farming:sugar 2",
recipe = "default:papyrus",
})
--= Salt
minetest.register_node("farming:salt", {
description = ("Salt"),
inventory_image = "farming_salt.png",
wield_image = "farming_salt.png",
drawtype = "plantlike",
visual_scale = 0.8,
paramtype = "light",
tiles = {"farming_salt.png"},
groups = {food_salt = 1, vessel = 1, dig_immediate = 3,
attached_node = 1},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
},
})
minetest.register_craft({
type = "cooking",
cooktime = 15,
output = "farming:salt",
recipe = "bucket:bucket_water",
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}
})
--= Rose Water
minetest.register_node("farming:rose_water", {
description = ("Rose Water"),
inventory_image = "farming_rose_water.png",
wield_image = "farming_rose_water.png",
drawtype = "plantlike",
visual_scale = 0.8,
paramtype = "light",
tiles = {"farming_rose_water.png"},
groups = {food_rose_water = 1, vessel = 1, dig_immediate = 3,
attached_node = 1},
sounds = default.node_sound_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
},
})
minetest.register_craft({
output = "farming:rose_water",
recipe = {
{"flowers:rose", "flowers:rose", "flowers:rose"},
{"flowers:rose", "flowers:rose", "flowers:rose"},
{"bucket:bucket_water", "group:food_pot", "vessels:glass_bottle"},
},
replacements = {
{"bucket:bucket_water", "bucket:bucket_empty"},
{"group:food_pot", "farming:pot"},
}
})
--= Turkish Delight
minetest.register_craftitem("farming:jelly_delight", {
description = S("Jelly Delight"),
inventory_image = "farming_turkish_delight.png",
groups = {flammable = 3},
on_use = minetest.item_eat(2),
})
minetest.register_craft({
output = "farming:jelly_delight 4",
recipe = {
{"group:food_gelatin", "group:food_sugar", "group:food_gelatin"},
{"group:food_sugar", "group:food_rose_water", "group:food_sugar"},
{"group:food_cornstarch", "group:food_sugar", "dye:pink"},
},
replacements = {
{"group:food_cornstarch", "ethereal:bowl"},
{"group:food_rose_water", "vessels:glass_bottle"},
},
})
--= Garlic Bread
minetest.register_craftitem("farming:garlic_bread", {
description = S("Garlic Bread"),
inventory_image = "farming_garlic_bread.png",
groups = {flammable = 3},
on_use = minetest.item_eat(2),
})
minetest.register_craft({
type = "shapeless",
output = "farming:garlic_bread",
recipe = {"group:food_toast", "group:food_garlic_clove", "group:food_garlic_clove"},
})
--= Donuts (thanks to Bockwurst for making the donut images)
minetest.register_craftitem("farming:donut", {
description = S("Donut"),
inventory_image = "farming_donut.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
output = "farming:donut 3",
recipe = {
{"", "group:food_wheat", ""},
{"group:food_wheat", "group:food_sugar", "group:food_wheat"},
{"", "group:food_wheat", ""},
}
})
minetest.register_craftitem("farming:donut_chocolate", {
description = S("Chocolate Donut"),
inventory_image = "farming_donut_chocolate.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "farming:donut_chocolate",
recipe = {
{'group:food_cocoa'},
{'farming:donut'},
}
})
minetest.register_craftitem("farming:donut_apple", {
description = S("Apple Donut"),
inventory_image = "farming_donut_apple.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "farming:donut_apple",
recipe = {
{'default:apple'},
{'farming:donut'},
}
})
--= Porridge Oats
minetest.register_craftitem("farming:porridge", {
description = S("Porridge"),
inventory_image = "farming_porridge.png",
on_use = minetest.item_eat(6, "ethereal:bowl"),
})
minetest.after(0, function()
local fluid = "bucket:bucket_water"
local fluid_return = "bucket:bucket_water"
if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then
fluid = "group:food_milk"
fluid_return = "mobs:bucket_milk"
end
minetest.register_craft({
type = "shapeless",
output = "farming:porridge",
recipe = {
"group:food_barley", "group:food_barley", "group:food_wheat",
"group:food_wheat", "group:food_bowl", fluid
},
replacements = {{fluid_return, "bucket:bucket_empty"}}
})
minetest.register_craft({
type = "shapeless",
output = "farming:porridge",
recipe = {
"group:food_oats", "group:food_oats", "group:food_oats",
"group:food_oats", "group:food_bowl", fluid
},
replacements = {{fluid_return, "bucket:bucket_empty"}}
})
end)
--= Jaffa Cake
minetest.register_craftitem("farming:jaffa_cake", {
description = S("Jaffa Cake"),
inventory_image = "farming_jaffa_cake.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
type = "shapeless",
output = "farming:jaffa_cake",
recipe = {
"farming:baking_tray", "group:food_egg", "group:food_sugar",
"group:food_flour", "group:food_cocoa", "group:food_orange",
"mobs:bucket_milk"
},
replacements = {
{"farming:baking_tray", "farming:baking_tray"},
{"mobs:bucket_milk", "bucket:bucket_empty"}
}
})

View File

@ -0,0 +1,46 @@
for i = 4, 5 do
-- Override default grass and have it drop Wheat Seeds
minetest.override_item("default:grass_" .. i, {
drop = {
max_items = 1,
items = {
{items = {'farming:seed_wheat'}, rarity = 5},
{items = {'farming:seed_oat'},rarity = 5},
{items = {'default:grass_1'}},
}
},
})
-- Override default dry grass and have it drop Barley Seeds
if minetest.registered_nodes["default:dry_grass_1"] then
minetest.override_item("default:dry_grass_" .. i, {
drop = {
max_items = 1,
items = {
{items = {'farming:seed_barley'}, rarity = 5},
{items = {'farming:seed_rye'},rarity = 5},
{items = {'default:dry_grass_1'}},
}
},
})
end
end
-- Override default Jungle Grass and have it drop Cotton Seeds
minetest.override_item("default:junglegrass", {
drop = {
max_items = 1,
items = {
{items = {'farming:seed_cotton'}, rarity = 8},
{items = {'farming:seed_rice'},rarity = 8},
{items = {'default:junglegrass'}},
}
},
})

View File

@ -0,0 +1,362 @@
local S = farming.intllib
local tr = minetest.get_modpath("toolranks")
-- Hoe registration function
farming.register_hoe = function(name, def)
-- Check for : prefix (register new hoes in your mod's namespace)
if name:sub(1,1) ~= ":" then
name = ":" .. name
end
-- Check def table
if def.description == nil then
def.description = S("Hoe")
end
if def.inventory_image == nil then
def.inventory_image = "unknown_item.png"
end
if def.max_uses == nil then
def.max_uses = 30
end
-- add hoe group
def.groups = def.groups or {}
def.groups.hoe = 1
-- Register the tool
minetest.register_tool(name, {
description = def.description,
inventory_image = def.inventory_image,
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses)
end,
groups = def.groups,
sound = {breaks = "default_tool_breaks"},
})
-- Register its recipe
if def.recipe then
minetest.register_craft({
output = name:sub(2),
recipe = def.recipe
})
elseif def.material then
minetest.register_craft({
output = name:sub(2),
recipe = {
{def.material, def.material, ""},
{"", "group:stick", ""},
{"", "group:stick", ""}
}
})
end
end
-- Turns dirt with group soil=1 into soil
function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
local pt = pointed_thing
-- check if pointing at a node
if not pt or pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local upos = pointed_thing.under
if minetest.is_protected(upos, user:get_player_name()) then
minetest.record_protection_violation(upos, user:get_player_name())
return
end
local p = {x = pt.under.x, y = pt.under.y + 1, z = pt.under.z}
local above = minetest.get_node(p)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name]
or not minetest.registered_nodes[above.name] then
return
end
-- check if the node above the pointed thing is air
if above.name ~= "air" then
return
end
-- check if pointing at dirt
if minetest.get_item_group(under.name, "soil") ~= 1 then
return
end
-- turn the node into soil, wear out item and play sound
minetest.set_node(pt.under, {name = "farming:soil"})
minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5})
local wear = 65535 / (uses -1)
if farming.is_creative(user:get_player_name()) then
if tr then
wear = 1
else
wear = 0
end
end
if tr then
itemstack = toolranks.new_afteruse(itemstack, user, under, {wear = wear})
else
itemstack:add_wear(wear)
end
return itemstack
end
-- Define Hoes
farming.register_hoe(":farming:hoe_wood", {
description = S("Wooden Hoe"),
inventory_image = "farming_tool_woodhoe.png",
max_uses = 30,
material = "group:wood"
})
minetest.register_craft({
type = "fuel",
recipe = "farming:hoe_wood",
burntime = 5,
})
farming.register_hoe(":farming:hoe_stone", {
description = S("Stone Hoe"),
inventory_image = "farming_tool_stonehoe.png",
max_uses = 90,
material = "group:stone"
})
farming.register_hoe(":farming:hoe_steel", {
description = S("Steel Hoe"),
inventory_image = "farming_tool_steelhoe.png",
max_uses = 200,
material = "default:steel_ingot"
})
farming.register_hoe(":farming:hoe_bronze", {
description = S("Bronze Hoe"),
inventory_image = "farming_tool_bronzehoe.png",
max_uses = 500,
groups = {not_in_creative_inventory = 1},
})
farming.register_hoe(":farming:hoe_mese", {
description = S("Mese Hoe"),
inventory_image = "farming_tool_mesehoe.png",
max_uses = 350,
groups = {not_in_creative_inventory = 1},
})
farming.register_hoe(":farming:hoe_diamond", {
description = S("Diamond Hoe"),
inventory_image = "farming_tool_diamondhoe.png",
max_uses = 500,
groups = {not_in_creative_inventory = 1},
})
-- Toolranks support
if tr then
minetest.override_item("farming:hoe_wood", {
original_description = "Wood Hoe",
description = toolranks.create_description("Wood Hoe")})
minetest.override_item("farming:hoe_stone", {
original_description = "Stone Hoe",
description = toolranks.create_description("Stone Hoe")})
minetest.override_item("farming:hoe_steel", {
original_description = "Steel Hoe",
description = toolranks.create_description("Steel Hoe")})
minetest.override_item("farming:hoe_bronze", {
original_description = "Bronze Hoe",
description = toolranks.create_description("Bronze Hoe")})
minetest.override_item("farming:hoe_mese", {
original_description = "Mese Hoe",
description = toolranks.create_description("Mese Hoe")})
minetest.override_item("farming:hoe_diamond", {
original_description = "Diamond Hoe",
description = toolranks.create_description("Diamond Hoe")})
end
-- hoe bomb function
local function hoe_area(pos, player)
-- check for protection
if minetest.is_protected(pos, player:get_player_name()) then
minetest.record_protection_violation(pos, player:get_player_name())
return
end
local r = 5 -- radius
-- remove flora (grass, flowers etc.)
local res = minetest.find_nodes_in_area(
{x = pos.x - r, y = pos.y - 1, z = pos.z - r},
{x = pos.x + r, y = pos.y + 2, z = pos.z + r},
{"group:flora"})
for n = 1, #res do
minetest.swap_node(res[n], {name = "air"})
end
-- replace dirt with tilled soil
res = nil
res = minetest.find_nodes_in_area_under_air(
{x = pos.x - r, y = pos.y - 1, z = pos.z - r},
{x = pos.x + r, y = pos.y + 2, z = pos.z + r},
{"group:soil"})
for n = 1, #res do
minetest.swap_node(res[n], {name = "farming:soil"})
end
end
-- throwable hoe bomb
minetest.register_entity("farming:hoebomb_entity", {
physical = true,
visual = "sprite",
visual_size = {x = 1.0, y = 1.0},
textures = {"farming_hoe_bomb.png"},
collisionbox = {0,0,0,0,0,0},
lastpos = {},
player = "",
on_step = function(self, dtime)
if not self.player then
self.object:remove()
return
end
local pos = self.object:get_pos()
if self.lastpos.x ~= nil then
local vel = self.object:getvelocity()
-- only when potion hits something physical
if vel.x == 0
or vel.y == 0
or vel.z == 0 then
if self.player ~= "" then
-- round up coords to fix glitching through doors
self.lastpos = vector.round(self.lastpos)
hoe_area(self.lastpos, self.player)
end
self.object:remove()
return
end
end
self.lastpos = pos
end
})
-- actual throwing function
local function throw_potion(itemstack, player)
local playerpos = player:get_pos()
local obj = minetest.add_entity({
x = playerpos.x,
y = playerpos.y + 1.5,
z = playerpos.z
}, "farming:hoebomb_entity")
local dir = player:get_look_dir()
local velocity = 20
obj:setvelocity({
x = dir.x * velocity,
y = dir.y * velocity,
z = dir.z * velocity
})
obj:setacceleration({
x = dir.x * -3,
y = -9.5,
z = dir.z * -3
})
obj:setyaw(player:get_look_yaw() + math.pi)
obj:get_luaentity().player = player
end
-- hoe bomb item
minetest.register_craftitem("farming:hoe_bomb", {
description = S("Hoe Bomb (use or throw on grassy areas to hoe land"),
inventory_image = "farming_hoe_bomb.png",
groups = {flammable = 2, not_in_creative_inventory = 1},
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "node" then
hoe_area(pointed_thing.above, user)
else
throw_potion(itemstack, user)
if not farming.is_creative(user:get_player_name()) then
itemstack:take_item()
return itemstack
end
end
end,
})
farming.register_hoe(":moreores:hoe_silver", {
description = S("%s Hoe"):format(S("Silver")),
inventory_image = "moreores_tool_silverhoe.png",
max_uses = 300,
material = "moreores:silver_ingot",
})
farming.register_hoe(":moreores:hoe_mithril", {
description = S("%s Hoe"):format(S("Mithril")),
inventory_image = "moreores_tool_mithrilhoe.png",
max_uses = 1000,
material = "moreores:mithril_ingot",
})
-- Toolranks support
if tr then
minetest.override_item("moreores:hoe_silver", {
original_description = S("%s Hoe"):format(S("Silver")),
description = toolranks.create_description("Silver Hoe")})
minetest.override_item("moreores:hoe_mithril", {
original_description = S("%s Hoe"):format(S("Mithril")),
description = toolranks.create_description("Mithril Hoe")})
end

View File

@ -0,0 +1,693 @@
--[[
Farming Redo Mod
by TenPlus1
NEW growing routine by prestidigitator
auto-refill by crabman77
]]
farming = {
mod = "redo",
version = "20190625",
path = minetest.get_modpath("farming"),
select = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
},
registered_plants = {}
}
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
function farming.is_creative(name)
return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
end
local statistics = dofile(farming.path .. "/statistics.lua")
-- Intllib
local S = dofile(farming.path .. "/intllib.lua")
farming.intllib = S
-- Utility Function
local time_speed = tonumber(minetest.settings:get("time_speed")) or 72
local SECS_PER_CYCLE = (time_speed > 0 and (24 * 60 * 60) / time_speed) or 0
local function clamp(x, min, max)
return (x < min and min) or (x > max and max) or x
end
-- return amount of day or night that has elapsed
-- dt is time elapsed, count_day if true counts day, otherwise night
local function day_or_night_time(dt, count_day)
local t_day = minetest.get_timeofday()
local t1_day = t_day - dt / SECS_PER_CYCLE
local t1_c, t2_c -- t1_c < t2_c and t2_c always in [0, 1)
if count_day then
if t_day < 0.25 then
t1_c = t1_day + 0.75 -- Relative to sunup, yesterday
t2_c = t_day + 0.75
else
t1_c = t1_day - 0.25 -- Relative to sunup, today
t2_c = t_day - 0.25
end
else
if t_day < 0.75 then
t1_c = t1_day + 0.25 -- Relative to sundown, yesterday
t2_c = t_day + 0.25
else
t1_c = t1_day - 0.75 -- Relative to sundown, today
t2_c = t_day - 0.75
end
end
local dt_c = clamp(t2_c, 0, 0.5) - clamp(t1_c, 0, 0.5) -- this cycle
if t1_c < -0.5 then
local nc = math.floor(-t1_c)
t1_c = t1_c + nc
dt_c = dt_c + 0.5 * nc + clamp(-t1_c - 0.5, 0, 0.5)
end
return dt_c * SECS_PER_CYCLE
end
-- Growth Logic
local STAGE_LENGTH_AVG = 6000.0 -- 20 minutes per day x 30 days per month = 36000. Average stages we'll say is 6 stages.
local STAGE_LENGTH_DEV = STAGE_LENGTH_AVG / 6
-- return plant name and stage from node provided
local function plant_name_stage(node)
local name
if type(node) == "table" then
if node.name then
name = node.name
elseif node.x and node.y and node.z then
node = minetest.get_node_or_nil(node)
name = node and node.name
end
else
name = tostring(node)
end
if not name or name == "ignore" then
return nil
end
local sep_pos = name:find("_[^_]+$")
if sep_pos and sep_pos > 1 then
local stage = tonumber(name:sub(sep_pos + 1))
if stage and stage >= 0 then
return name:sub(1, sep_pos - 1), stage
end
end
return name, 0
end
-- Map from node name to
-- { plant_name = ..., name = ..., stage = n, stages_left = { node_name, ... } }
local plant_stages = {}
farming.plant_stages = plant_stages
--- Registers the stages of growth of a (possible plant) node.
--
-- @param node
-- Node or position table, or node name.
-- @return
-- The (possibly zero) number of stages of growth the plant will go through
-- before being fully grown, or nil if not a plant.
local register_plant_node
-- Recursive helper
local function reg_plant_stages(plant_name, stage, force_last)
local node_name = plant_name and plant_name .. "_" .. stage
local node_def = node_name and minetest.registered_nodes[node_name]
if not node_def then
return nil
end
local stages = plant_stages[node_name]
if stages then
return stages
end
if minetest.get_item_group(node_name, "growing") > 0 then
local ns = reg_plant_stages(plant_name, stage + 1, true)
local stages_left = (ns and { ns.name, unpack(ns.stages_left) }) or {}
stages = {
plant_name = plant_name,
name = node_name,
stage = stage,
stages_left = stages_left
}
if #stages_left > 0 then
local old_constr = node_def.on_construct
local old_destr = node_def.on_destruct
minetest.override_item(node_name,
{
on_construct = function(pos)
if old_constr then
old_constr(pos)
end
farming.handle_growth(pos)
end,
on_destruct = function(pos)
minetest.get_node_timer(pos):stop()
if old_destr then
old_destr(pos)
end
end,
on_timer = function(pos, elapsed)
return farming.plant_growth_timer(pos, elapsed, node_name)
end,
})
end
elseif force_last then
stages = {
plant_name = plant_name,
name = node_name,
stage = stage,
stages_left = {}
}
else
return nil
end
plant_stages[node_name] = stages
return stages
end
local register_plant_node = function(node)
local plant_name, stage = plant_name_stage(node)
if plant_name then
local stages = reg_plant_stages(plant_name, stage, false)
return stages and #stages.stages_left
else
return nil
end
end
local function set_growing(pos, stages_left)
if not stages_left then
return
end
local timer = minetest.get_node_timer(pos)
if stages_left > 0 then
if not timer:is_started() then
local stage_length = statistics.normal(STAGE_LENGTH_AVG, STAGE_LENGTH_DEV)
stage_length = clamp(stage_length, 0.5 * STAGE_LENGTH_AVG, 3.0 * STAGE_LENGTH_AVG)
timer:set(stage_length, -0.5 * math.random() * STAGE_LENGTH_AVG)
end
elseif timer:is_started() then
timer:stop()
end
end
-- detects a crop at given position, starting or stopping growth timer when needed
function farming.handle_growth(pos, node)
if not pos then
return
end
local stages_left = register_plant_node(node or pos)
if stages_left then
set_growing(pos, stages_left)
end
end
minetest.after(0, function()
for _, node_def in pairs(minetest.registered_nodes) do
register_plant_node(node_def)
end
end)
-- Just in case a growing type or added node is missed (also catches existing
-- nodes added to map before timers were incorporated).
minetest.register_abm({
nodenames = { "group:growing" },
interval = 300,
chance = 1,
catch_up = false,
action = function(pos, node)
farming.handle_growth(pos, node)
end
})
-- Plant timer function that grows plants under the right conditions.
function farming.plant_growth_timer(pos, elapsed, node_name)
local stages = plant_stages[node_name]
if not stages then
return false
end
local max_growth = #stages.stages_left
if max_growth <= 0 then
return false
end
-- custom growth check
local chk = minetest.registered_nodes[node_name].growth_check
if chk then
if chk(pos, node_name) then
return true
end
-- otherwise check for wet soil beneath crop
else
local under = minetest.get_node({ x = pos.x, y = pos.y - 1, z = pos.z })
if minetest.get_item_group(under.name, "soil") < 3 then
return true
end
end
local growth
local light_pos = {x = pos.x, y = pos.y, z = pos.z}
local lambda = elapsed / STAGE_LENGTH_AVG
if lambda < 0.1 then
return true
end
local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 12
local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or 15
--print ("---", MIN_LIGHT, MAX_LIGHT)
if max_growth == 1 or lambda < 2.0 then
local light = (minetest.get_node_light(light_pos) or 0)
--print ("light level:", light)
if light < MIN_LIGHT or light > MAX_LIGHT then
return true
end
growth = 1
else
local night_light = (minetest.get_node_light(light_pos, 0) or 0)
local day_light = (minetest.get_node_light(light_pos, 0.5) or 0)
local night_growth = night_light >= MIN_LIGHT and night_light <= MAX_LIGHT
local day_growth = day_light >= MIN_LIGHT and day_light <= MAX_LIGHT
if not night_growth then
if not day_growth then
return true
end
lambda = day_or_night_time(elapsed, true) / STAGE_LENGTH_AVG
elseif not day_growth then
lambda = day_or_night_time(elapsed, false) / STAGE_LENGTH_AVG
end
growth = statistics.poisson(lambda, max_growth)
if growth < 1 then
return true
end
end
if minetest.registered_nodes[stages.stages_left[growth]] then
local p2 = minetest.registered_nodes[stages.stages_left[growth] ].place_param2 or 1
minetest.swap_node(pos, {name = stages.stages_left[growth], param2 = p2})
else
return true
end
return growth ~= max_growth
end
-- refill placed plant by crabman (26/08/2015) updated by TenPlus1
function farming.refill_plant(player, plantname, index)
local inv = player:get_inventory()
local old_stack = inv:get_stack("main", index)
if old_stack:get_name() ~= "" then
return
end
for i, stack in ipairs(inv:get_list("main")) do
if stack:get_name() == plantname and i ~= index then
inv:set_stack("main", index, stack)
stack:clear()
inv:set_stack("main", i, stack)
return
end
end
end
-- Place Seeds on Soil
function farming.place_seed(itemstack, placer, pointed_thing, plantname)
local pt = pointed_thing
-- check if pointing at a node
if not pt or pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
-- am I right-clicking on something that has a custom on_place set?
-- thanks to Krock for helping with this issue :)
local def = minetest.registered_nodes[under.name]
if placer and def and def.on_rightclick then
return def.on_rightclick(pt.under, under, placer, itemstack)
end
local above = minetest.get_node(pt.above)
-- check if pointing at the top of the node
if pt.above.y ~= pt.under.y + 1 then
return
end
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name]
or not minetest.registered_nodes[above.name] then
return
end
-- can I replace above node, and am I pointing at soil
if not minetest.registered_nodes[above.name].buildable_to
or minetest.get_item_group(under.name, "soil") < 2
-- avoid multiple seed placement bug
or minetest.get_item_group(above.name, "plant") ~= 0 then
return
end
-- is player planting seed?
local name = placer and placer:get_player_name() or ""
-- if not protected then add node and remove 1 item from the itemstack
if not minetest.is_protected(pt.above, name) then
local p2 = minetest.registered_nodes[plantname].place_param2 or 1
minetest.set_node(pt.above, {name = plantname, param2 = p2})
--minetest.get_node_timer(pt.above):start(1)
--farming.handle_growth(pt.above)--, node)
minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
if placer and not farming.is_creative(placer:get_player_name()) then
local name = itemstack:get_name()
itemstack:take_item()
-- check for refill
if itemstack:get_count() == 0 then
minetest.after(0.10,
farming.refill_plant,
placer,
name,
placer:get_wield_index()
)
end
end
return itemstack
end
end
-- Function to register plants (default farming compatibility)
farming.register_plant = function(name, def)
if not def.steps then
return nil
end
local mname = name:split(":")[1]
local pname = name:split(":")[2]
-- Check def
def.description = def.description or S("Seed")
def.inventory_image = def.inventory_image or "unknown_item.png"
def.minlight = def.minlight or 12
def.maxlight = def.maxlight or 15
-- Register seed
minetest.register_node(":" .. mname .. ":seed_" .. pname, {
description = def.description,
tiles = {def.inventory_image},
inventory_image = def.inventory_image,
wield_image = def.inventory_image,
drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 2},
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = farming.select,
place_param2 = def.place_param2 or nil,
next_plant = mname .. ":" .. pname .. "_1",
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer,
pointed_thing, mname .. ":" .. pname .. "_1")
end,
})
-- Register harvest
minetest.register_craftitem(":" .. mname .. ":" .. pname, {
description = pname:gsub("^%l", string.upper),
inventory_image = mname .. "_" .. pname .. ".png",
groups = def.groups or {flammable = 2},
})
-- Register growing steps
for i = 1, def.steps do
local base_rarity = 1
if def.steps ~= 1 then
base_rarity = 8 - (i - 1) * 7 / (def.steps - 1)
end
local drop = {
items = {
{items = {mname .. ":" .. pname}, rarity = base_rarity},
{items = {mname .. ":" .. pname}, rarity = base_rarity * 2},
{items = {mname .. ":seed_" .. pname}, rarity = base_rarity},
{items = {mname .. ":seed_" .. pname}, rarity = base_rarity * 2},
}
}
local g = {
snappy = 3, flammable = 2, plant = 1, growing = 1,
attached_node = 1, not_in_creative_inventory = 1,
}
-- Last step doesn't need growing=1 so Abm never has to check these
if i == def.steps then
g.growing = 0
end
local node_name = mname .. ":" .. pname .. "_" .. i
local next_plant = nil
if i < def.steps then
next_plant = mname .. ":" .. pname .. "_" .. (i + 1)
end
minetest.register_node(node_name, {
drawtype = "plantlike",
waving = 1,
tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"},
paramtype = "light",
paramtype2 = def.paramtype2,
place_param2 = def.place_param2,
walkable = false,
buildable_to = true,
sunlight_propagates = true,
drop = drop,
selection_box = farming.select,
groups = g,
sounds = default.node_sound_leaves_defaults(),
minlight = def.minlight,
maxlight = def.maxlight,
next_plant = next_plant,
})
end
-- add to farming.registered_plants
farming.registered_plants[mname .. ":" .. pname] = {
crop = mname .. ":" .. pname,
seed = mname .. ":seed_" .. pname,
steps = def.steps,
minlight = def.minlight,
maxlight = def.maxlight
}
--print(dump(farming.registered_plants[mname .. ":" .. pname]))
-- Return info
return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname}
end
-- default settings
farming.carrot = 0.001
farming.potato = 0.001
farming.tomato = 0.001
farming.cucumber = 0.001
farming.corn = 0.001
farming.coffee = 0.001
farming.melon = 0.001
farming.pumpkin = 0.001
farming.cocoa = true
farming.raspberry = 0.001
farming.blueberry = 0.001
farming.rhubarb = 0.001
farming.beans = 0.001
farming.grapes = 0.001
farming.barley = true
farming.chili = 0.003
--farming.hemp = 0.003
farming.garlic = 0.001
farming.onion = 0.001
farming.pepper = 0.002
farming.pineapple = 0.001
farming.peas = 0.001
farming.beetroot = 0.001
farming.grains = true
farming.rarety = 0.002
-- Load new global settings if found inside mod folder
local input = io.open(farming.path.."/farming.conf", "r")
if input then
dofile(farming.path .. "/farming.conf")
input:close()
end
-- load new world-specific settings if found inside world folder
local worldpath = minetest.get_worldpath()
input = io.open(worldpath.."/farming.conf", "r")
if input then
dofile(worldpath .. "/farming.conf")
input:close()
end
-- important items
dofile(farming.path.."/soil.lua")
dofile(farming.path.."/hoes.lua")
dofile(farming.path.."/grass.lua")
dofile(farming.path.."/utensils.lua")
-- default crops
dofile(farming.path.."/crops/wheat.lua")
dofile(farming.path.."/crops/cotton.lua")
-- helper function
local function ddoo(file, check)
if check then
dofile(farming.path .. "/crops/" .. file)
end
end
-- add additional crops and food (if enabled)
ddoo("carrot.lua", farming.carrot)
ddoo("potato.lua", farming.potato)
ddoo("tomato.lua", farming.tomato)
ddoo("cucumber.lua", farming.cucumber)
ddoo("corn.lua", farming.corn)
ddoo("coffee.lua", farming.coffee)
ddoo("melon.lua", farming.melon)
ddoo("pumpkin.lua", farming.pumpkin)
ddoo("cocoa.lua", farming.cocoa)
ddoo("raspberry.lua", farming.raspberry)
ddoo("blueberry.lua", farming.blueberry)
ddoo("rhubarb.lua", farming.rhubarb)
ddoo("beans.lua", farming.beans)
ddoo("grapes.lua", farming.grapes)
ddoo("barley.lua", farming.barley)
--ddoo("hemp.lua", farming.hemp)
ddoo("garlic.lua", farming.garlic)
ddoo("onion.lua", farming.onion)
ddoo("pepper.lua", farming.pepper)
ddoo("pineapple.lua", farming.pineapple)
ddoo("peas.lua", farming.peas)
ddoo("beetroot.lua", farming.beetroot)
ddoo("chili.lua", farming.chili)
ddoo("ryeoatrice.lua", farming.grains)
dofile(farming.path.."/food.lua")
dofile(farming.path.."/mapgen.lua")
dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility
dofile(farming.path.."/lucky_block.lua")

View File

@ -0,0 +1,45 @@
-- Fallback functions for when `intllib` is not installed.
-- Code released under Unlicense <http://unlicense.org>.
-- Get the latest version of this file at:
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
local function format(str, ...)
local args = { ... }
local function repl(escape, open, num, close)
if escape == "" then
local replacement = tostring(args[tonumber(num)])
if open == "" then
replacement = replacement..close
end
return replacement
else
return "@"..open..num..close
end
end
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
end
local gettext, ngettext
if minetest.get_modpath("intllib") then
if intllib.make_gettext_pair then
-- New method using gettext.
gettext, ngettext = intllib.make_gettext_pair()
else
-- Old method using text files.
gettext = intllib.Getter()
end
end
-- Fill in missing functions.
gettext = gettext or function(msgid, ...)
return format(msgid, ...)
end
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
return format(n==1 and msgid or msgid_plural, ...)
end
return gettext, ngettext

View File

@ -0,0 +1,144 @@
The MIT License (MIT)
Copyright (c) 2016 TenPlus1
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
License of media (textures):
----------------------------
Created by PilzAdam (License: CC BY 3.0):
farming_bread.png
farming_soil.png
farming_soil_wet.png
farming_soil_wet_side.png
farming_string.png
Created by Napiophelios (CC BY-SA 3.0):
farming_cotton.png
Created by Calinou (License: CC BY-SA):
farming_tool_bronzehoe.png
farming_tool_steelhoe.png
farming_tool_stonehoe.png
farming_tool_woodhoe.png
farming_tool_mesehoe.png
farming_tool_diamondhoe.png
Created by VanessaE (License: CC BY 3.0):
farming_cotton_seed.png
farming_wheat_seed.png
farming_flour.png
farming_wheat.png
farming_wheat_1.png
farming_wheat_2.png
farming_wheat_3.png
farming_wheat_4.png
farming_wheat_5.png
farming_wheat_5.png
farming_wheat_7.png
farming_wheat_8.png
farming_cotton_1.png
farming_cotton_2.png
farming_cotton_3.png
farming_cotton_4.png
farming_cotton_5.png
farming_cotton_6.png
farming_cotton_7.png
farming_cotton_8.png
Created by Doc (License: CC BY 3.0):
farming_cucumber.png
farming_cucumber_1.png
farming_cucumber_2.png
farming_cucumber_3.png
farming_cucumber_4.png
farming_potato.png
farming_potato_1.png
farming_potato_2.png
farming_potato_3.png
farming_potato_4.png
farming_raspberries.png
farming_raspberry_1.png
farming_raspberry_2.png
farming_raspberry_3.png
farming_raspberry_4.png
Created by Gambit (License: CC BY 3.0):
default_junglegrass.png
farming_carrot.png
farming_carrot_1.png
farming_carrot_2.png
farming_carrot_3.png
farming_carrot_4.png
farming_carrot_5.png
farming_carrot_6.png
farming_carrot_7.png
farming_carrot_8.png
Created by JoseTheCrafter and edited by TenPlus1 (CC BY 3.0):
farming_tomato.png
farming_tomato_1.png
farming_tomato_2.png
farming_tomato_3.png
farming_tomato_4.png
farming_tomato_5.png
farming_tomato_6.png
farming_tomato_7.png
farming_tomato_8.png
Created by GeMinecraft and edited by TenPlus1 (CC BY 3.0):
farming_corn.png
farming_corn_cob.png
farming_corn_1.png
farming_corn_2.png
farming_corn_3.png
farming_corn_4.png
farming_corn_5.png
farming_corn_6.png
farming_corn_7.png
farming_corn_8.png
Created by TenPlus1 (CC BY 3.0)
farming_cocoa_1.png
farming_cocoa_2.png
farming_cocoa_3.png
farming_cocoa_beans.png
farming_cookie.png
farming_raspberry_smoothie.png
farming_rhubarb_1.png
farming_rhubarb_2.png
farming_rhubarb_3.png
farming_rhubarb.png
farming_rhubarb_pie.png
farming_hemp*.png
Created by ademant (CC-BY-3.0)
farming_rye*.png
farming_oat*.png
farming_rice*.png
Created by PilzAdam and edited by SpaghettiToastBook (CC0):
farming_bread_multigrain.png
Created by VanessaE and edited by SpaghettiToastBook (CC0):
farming_flour_multigrain.png
Created by mDiyo (Natura), modified by TenPlus1 (License: CC BY-SA 3.0):
farming_barley.png

View File

@ -0,0 +1,262 @@
# German Translation for farming mod.
# Copyright (C) 2017
# This file is distributed under the same license as the farming package.
# Xanthin.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: 1.27\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-03-31 HO:MI+ZONE\n"
"PO-Revision-Date: 2016-03-31 HO:MI+ZONE\n"
"Last-Translator: Xanthin\n"
"Language-Team: \n"
"Language: German \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: barley.lua
msgid "Barley Seed"
msgstr "Gerstenkörner"
#: barley.lua
msgid "Barley"
msgstr "Gerste"
#: beanpole.lua
msgid "Green Beans"
msgstr "Grüne Bohnen"
#: beanpole.lua
msgid "Bean Pole (place on soil before planting beans)"
msgstr "Bohnenstange (vor dem Pflanzen der Bohnen auf den\nAckerboden stellen)"
#: blueberry.lua
msgid "Blueberries"
msgstr "Blaubeeren"
#: blueberry.lua
msgid "Blueberry Muffin"
msgstr "Blaubeermuffin"
#: carrot.lua
msgid "Carrot"
msgstr "Möhre"
#: carrot.lua
msgid "Golden Carrot"
msgstr "Goldene Möhre"
#: cocoa.lua
msgid "Cocoa Beans"
msgstr "Kakaobohne"
#: cocoa.lua
msgid "Cookie"
msgstr "Keks"
#: cocoa.lua
msgid "Bar of Dark Chocolate"
msgstr "Tafel Zartbitterschokolade"
#: coffee.lua
msgid "Coffee Beans"
msgstr "Kaffeebohnen"
#: coffee.lua
msgid "Drinking Cup (empty)"
msgstr "Tasse (leer)"
#: coffee.lua
msgid "Cold Cup of Coffee"
msgstr "Kalte Tasse Kaffee"
#: coffee.lua
msgid "Hot Cup of Coffee"
msgstr "Heiße Tasse Kaffee"
#: corn.lua
msgid "Corn"
msgstr "Mais"
#: corn.lua
msgid "Corn on the Cob"
msgstr "Maiskolben"
#: corn.lua
msgid "Bottle of Ethanol"
msgstr "Flasche Ethanol"
#: cotton.lua
msgid "Cotton Seed"
msgstr "Baumwollsamen"
#: cotton.lua
msgid "Cotton"
msgstr "Baumwolle"
#: cucumber.lua
msgid "Cucumber"
msgstr "Gurke"
#: donut.lua
msgid "Donut"
msgstr "Donut"
#: donut.lua
msgid "Chocolate Donut"
msgstr "Schokodonut"
#: donut.lua
msgid "Apple Donut"
msgstr "Apfeldonut"
#: grapes.lua
msgid "Grapes"
msgstr "Weintrauben"
#: grapes.lua
msgid "Trellis (place on soil before planting grapes)"
msgstr "Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen)"
#: hemp.lua
msgid "Hemp Seed"
msgstr "Hanfsamen"
#: hemp.lua
msgid "Hemp Leaf"
msgstr "Hanfblatt"
#: hemp.lua
msgid "Bottle of Hemp Oil"
msgstr "Flasche mit Hanföl"
#: hemp.lua
msgid "Hemp Fibre"
msgstr "Hanffaser"
#: hemp.lua
msgid "Hemp Rope"
msgstr "Hanfseil"
#: hoes.lua
msgid "Hoe"
msgstr "Hacke"
#: hoes.lua
msgid "Wooden Hoe"
msgstr "Holzhacke"
#: hoes.lua
msgid "Stone Hoe"
msgstr "Steinhacke"
#: hoes.lua
msgid "Steel Hoe"
msgstr "Stahlhacke"
#: hoes.lua
msgid "Bronze Hoe"
msgstr "Bronzehacke"
#: hoes.lua
msgid "Mese Hoe"
msgstr "Mesehacke"
#: hoes.lua
msgid "Diamond Hoe"
msgstr "Diamanthacke"
#: init.lua
msgid "Seed"
msgstr "Saatgut"
#: melon.lua
msgid "Melon Slice"
msgstr "Melonenscheibe"
#: melon.lua
msgid "Melon"
msgstr "Melone"
#: potato.lua
msgid "Potato"
msgstr "Kartoffel"
#: potato.lua
msgid "Baked Potato"
msgstr "Ofenkartoffel"
#: pumpkin.lua
msgid "Pumpkin"
msgstr "Kürbis"
#: pumpkin.lua
msgid "Pumpkin Slice"
msgstr "Kürbisscheibe"
#: pumpkin.lua
msgid "Jack 'O Lantern (punch to turn on and off)"
msgstr "Kürbislaterne (Punch zum Ein- und Ausschalten)"
#: pumpkin.lua
msgid "Pumpkin Bread"
msgstr "Kürbisbrot"
#: pumpkin.lua
msgid "Pumpkin Dough"
msgstr "Kürbisteig"
#: raspberry.lua
msgid "Raspberries"
msgstr "Himbeeren"
#: raspberry.lua
msgid "Raspberry Smoothie"
msgstr "Himbeersmoothie"
#: rhubarb.lua
msgid "Rhubarb"
msgstr "Rhabarber"
#: rhubarb.lua
msgid "Rhubarb Pie"
msgstr "Rhabarberkuchen"
#: soil.lua
msgid "Soil"
msgstr "Ackerboden"
#: soil.lua
msgid "Wet Soil"
msgstr "Bewässerter Ackerboden"
#: sugar.lua
msgid "Sugar"
msgstr "Zucker"
#: tomato.lua
msgid "Tomato"
msgstr "Tomate"
#: wheat.lua
msgid "Wheat Seed"
msgstr "Weizenkörner"
#: wheat.lua
msgid "Wheat"
msgstr "Weizen"
#: wheat.lua
msgid "Straw"
msgstr "Stroh"
#: wheat.lua
msgid "Flour"
msgstr "Mehl"
#: wheat.lua
msgid "Bread"
msgstr "Brot"

View File

@ -0,0 +1,25 @@
# textdomain: farming
Wooden Hoe=Holzhacke
Stone Hoe=Steinhacke
Steel Hoe=Stahlhacke
Bronze Hoe=Bronzehacke
Mese Hoe=Mesehacke
Diamond Hoe=Diamanthacke
Wheat Seed=Weizensamen
Flour=Mehl
Bread=Brot
Cotton Seed=Baumwollsamen
String=Faden
Soil=Ackerboden
Wet Soil=Nasser Ackerboden
Dry Soil=Trockener Ackerboden
Wet Dry Soil=Nasser trockener Ackerboden
Desert Sand Soil=Wüsensandackerboden
Wet Desert Sand Soil=Nasser Wüstensandackerboden
Straw=Stroh
Straw Stair=Strohtreppe
Straw Slab=Strohplatte
Inner Straw Stair=Innere Strohtreppe
Outer Straw Stair=Äußere Strohtreppe
Wheat=Weizen
Cotton=Baumwolle

View File

@ -0,0 +1,25 @@
# textdomain: farming
Wooden Hoe=Azada de madera
Stone Hoe=Azada de piedra
Steel Hoe=Azada de acero
Bronze Hoe=Azada de bronce
Mese Hoe=Azada de mese
Diamond Hoe=Azada de diamante
Wheat Seed=Semilla de trigo
Flour=Harina
Bread=Pan
Cotton Seed=Semilla de algodón
String=Hilo
Soil=Tierra de cultivo
Wet Soil=Tierra de cultivo humeda
Dry Soil=Tierra de cultivo seca
Wet Dry Soil=Tierra de cultivo seca-humeda
Desert Sand Soil=Tierra de cultivo de arena de desierto
Wet Desert Sand Soil=Tierra de cultivo de arena de desierto humeda
Straw=Paja
Straw Stair=Escalera de paja
Straw Slab=Losa de paja
Inner Straw Stair=Escalera de paja interior
Outer Straw Stair=Escalera de paja exterior
Wheat=Trigo
Cotton=Algodón

View File

@ -0,0 +1,25 @@
# textdomain: farming
Wooden Hoe=Houe en bois
Stone Hoe=Houe en pierre
Steel Hoe=Houe en acier
Bronze Hoe=Houe en bronze
Mese Hoe=Houe en Mese
Diamond Hoe=Houe en diamant
Wheat Seed=Grain de blé
Flour=Farine
Bread=Pain
Cotton Seed=Graine de coton
String=Ficelle
Soil=Sol
Wet Soil=Sol humide
Dry Soil=Sol sec
Wet Dry Soil=Sol sec et humide
Desert Sand Soil=Sol de sable du désert
Wet Desert Sand Soil=Sol de sable du désert humide
Straw=Paille
Straw Stair=Escalier de paille
Straw Slab=Dalle de paille
Inner Straw Stair=Escalier intérieur en paille
Outer Straw Stair=Escalier extérieur en paille
Wheat=Blé
Cotton=Coton

View File

@ -0,0 +1,25 @@
# textdomain: farming
Wooden Hoe=Zappa di legno
Stone Hoe=Zappa di pietra
Steel Hoe=Zappa d'acciaio
Bronze Hoe=Zappa di bronzo
Mese Hoe=Zappa di mese
Diamond Hoe=Zappa di diamante
Wheat Seed=Seme di grano
Flour=Farina
Bread=Pane
Cotton Seed=Seme di cotone
String=Filo
Soil=Terreno
Wet Soil=Terreno bagnato
Dry Soil=Terreno asciutto
Wet Dry Soil=Terreno asciutto bagnato
Desert Sand Soil=Terreno di sabbia del deserto
Wet Desert Sand Soil=Terreno bagnato di sabbia del deserto
Straw=Paglia
Straw Stair=Scala di paglia
Inner Straw Stair=Scala di paglia interna
Outer Straw Stair=Scala di paglia esterna
Straw Slab=Lastra di paglia
Wheat=Grano
Cotton=Cotone

View File

@ -0,0 +1,25 @@
# textdomain: farming
Wooden Hoe=Cangkul Kayu
Stone Hoe=Cangkul Batu
Steel Hoe=Cangkul Keluli
Bronze Hoe=Cangkul Gangsa
Mese Hoe=Cangkul Mese
Diamond Hoe=Cangkul Intan
Wheat Seed=Benih Gandum
Flour=Tepung
Bread=Roti
Cotton Seed=Benih Kapas
String=Benang
Soil=Tanih
Wet Soil=Tanih Lembap
Dry Soil=Tanih Kering
Wet Dry Soil=Tanih Kering Lembap
Desert Sand Soil=Tanih Pasir Gurun
Wet Desert Sand Soil=Tanih Pasir Gurun Lembap
Straw=Jerami
Straw Stair=Tangga Jerami
Inner Straw Stair=Tangga Jerami Dalaman
Outer Straw Stair=Tangga Jerami Luaran
Straw Slab=Papak Jerami
Wheat=Gandum
Cotton=Kapas

View File

@ -0,0 +1,25 @@
# textdomain: farming
Wooden Hoe=Деревянная Мотыга
Stone Hoe=Каменная Мотыга
Steel Hoe=Стальная Мотыга
Bronze Hoe=Бронзовая Мотыга
Mese Hoe=Месе Мотыга
Diamond Hoe=Алмазная Мотыга
Wheat Seed=Семена Пшеницы
Flour=Мука
Bread=Хлеб
Cotton Seed=Семена Хлопка
String=Нить
Soil=Почва
Wet Soil=Влажная Почва
Dry Soil=Сухая Почва
Wet Dry Soil=Влажная Сухая Почва
Desert Sand Soil=Пустынная Песчаная Почва
Wet Desert Sand Soil=Влажная Пустынная Песчаная Почва
Straw=Солома
Straw Stair=Соломенная Ступень
Inner Straw Stair=Угловая Соломенная Ступень (Внутренний Угол)
Outer Straw Stair=Угловая Соломенная Ступень (Внешний Угол)
Straw Slab=Соломенная Плита
Wheat=Пшеница
Cotton=Хлопок

View File

@ -0,0 +1,25 @@
# textdomain: farming
Wooden Hoe=Träsko
Stone Hoe=Stensko
Steel Hoe=Stålsko
Bronze Hoe=Bronssko
Mese Hoe=Mesesko
Diamond Hoe=Diamantsko
Wheat Seed=Vetefrö
Flour=Mjöl
Bread=Bröd
Cotton Seed=Bollumsfrö
String=Snöra
Soil=Odlningsmark
Wet Soil=Våt Odlningsmark
Dry Soil=Torr Odlningsmark
Wet Dry Soil=Våt Torr Odlningsmark
Desert Sand Soil=Öken Sand Odlningsmark
Wet Desert Sand Soil=Våt Öken Sand Odlningsmark
Straw=Halm
Straw Stair=Halmstrappa
Inner Straw Stair=Inre Halmstrappa
Outer Straw Stair=Yttre Halmstrappa
Straw Slab=Halmplatta
Wheat=Vete
Cotton=Bomull

View File

@ -0,0 +1,25 @@
# textdomain: farming
Wooden Hoe=木锄头
Stone Hoe=石锄头
Steel Hoe=铁锄头
Bronze Hoe=青铜锄头
Mese Hoe=黄石锄头
Diamond Hoe=钻石锄头
Wheat Seed=小麦种子
Flour=面粉
Bread=面包
Cotton Seed=棉花种子
String=线
Soil=土
Wet Soil=湿土
Dry Soil=干土
Wet Dry Soil=湿干土
Desert Sand Soil=沙漠沙土
Wet Desert Sand Soil=湿沙漠沙土
Straw=稻草
Straw Stair=稻草台阶
Inner Straw Stair=稻草内楼梯
Outer Straw Stair=稻草外楼梯
Straw Slab=稻草板
Wheat=小麦
Cotton=棉

Some files were not shown because too many files have changed in this diff Show More