Merge branch 'master' of notabug.org:ademant/minetest_farming

master
A. Demant 2018-09-28 19:39:47 +02:00
commit 03d5f335cf
2 changed files with 5 additions and 10 deletions

View File

@ -165,9 +165,7 @@ farming.register_plant = function(name, def)
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
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, seed_name)
@ -214,10 +212,7 @@ farming.register_plant = function(name, def)
end
local step_harvest = math.floor(i * grad_harvest + 0.05)
-- create drop table
local drop = {
items = {
{items = {harvest_name}},
}}
local drop = {}
-- if seeds are not crafted out of harvest, drop additional seeds
if def.groups.drop_seed ~= nil then
table.insert(drop.items,1,{items={seed_name}})
@ -225,8 +220,8 @@ farming.register_plant = function(name, def)
-- enlarge drop table only, if grain type
if def.groups.grain then
-- with higher grow levels you harvest more
if step_harvest > 1 then
for h = 2,step_harvest do
if step_harvest >= 1 then
for h = 1,step_harvest do
table.insert(drop.items,1,{items={harvest_name},rarity=base_rarity*h})
if def.groups.drop_seed ~= nil then
table.insert(drop.items,1,{items={seed_name},rarity=base_rarity*h})

View File

@ -11,7 +11,7 @@ local w1def={
minlight = 13,
maxlight = default.LIGHT_MAX,
fertility = {"grassland"},
groups = {food_wheat=1,grain = 1, flammable = 4},
groups = {food_wheat=1, grain = 1, flammable = 4},
place_param2 = 3,
min_temp=10,
max_temp=50,