summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2015-08-26 15:05:17 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2015-08-26 15:05:17 +0100
commite6babd6486730a0341ea3bde31c80ed920c2328c (patch)
treeb64664bde2a6a2d1a1c8c022c008b42d1117b722 /init.lua
parent5757896caaeac6f47732344f9d870fe65d9df8ce (diff)
Updated to work with 0.4.13
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/init.lua b/init.lua
index 03fc451..7d96f1d 100644
--- a/init.lua
+++ b/init.lua
@@ -1,5 +1,5 @@
--[[
- Minetest Farming Redo Mod 1.20 (5th July 2015)
+ Minetest Farming Redo Mod 1.20b (26th August 2015)
by TenPlus1
NEW growing routine by prestidigitator
]]
@@ -397,7 +397,7 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
local pt = pointed_thing
-- check if pointing at a node
- if not pt and pt.type ~= "node" then
+ if not pt or pt.type ~= "node" then
return
end
@@ -418,13 +418,14 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
-- 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
- or minetest.get_item_group(above.name, "plant") ~= 0 then -- ADDED this line for multiple seed placement bug
+ -- avoid multiple seed placement bug
+ or minetest.get_item_group(above.name, "plant") ~= 0 then
return
end
- -- add the node and remove 1 item from the itemstack
+ -- if not protected then add node and remove 1 item from the itemstack
if not minetest.is_protected(pt.above, placer:get_player_name()) then
- minetest.add_node(pt.above, {name=plantname})
+ minetest.add_node(pt.above, {name = plantname, param2 = 1})
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
@@ -474,7 +475,7 @@ farming.register_plant = function(name, def)
})
-- Register growing steps
- for i=1,def.steps do
+ for i = 1, def.steps do
local drop = {
items = {
{items = {mname .. ":" .. pname}, rarity = 9 - i},
@@ -498,7 +499,6 @@ farming.register_plant = function(name, def)
paramtype = "light",
walkable = false,
buildable_to = true,
- is_ground_content = true,
drop = drop,
selection_box = farming.select,
groups = g,