summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortenplus1 <kinsellaja@yahoo.com>2015-03-01 14:28:51 +0000
committertenplus1 <kinsellaja@yahoo.com>2015-03-01 14:28:51 +0000
commit459044fa199c7d259f5c86b8e068c5ac4f76b005 (patch)
tree3e2d1e9b18897cd00865cbbabfc975707db7f54c
parent0937c77458c7582b64b7a4a91c48721b38917976 (diff)
Player cannot place seeds in protected area
-rw-r--r--README.txt1
-rw-r--r--init.lua12
2 files changed, 8 insertions, 5 deletions
diff --git a/README.txt b/README.txt
index 85aa699..e77f9aa 100644
--- a/README.txt
+++ b/README.txt
@@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t
Changelog:
+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.
diff --git a/init.lua b/init.lua
index f63db4c..9e87403 100644
--- a/init.lua
+++ b/init.lua
@@ -1,5 +1,5 @@
--[[
- Minetest Farming Redo Mod 1.11 (20th Jan 2015)
+ Minetest Farming Redo Mod 1.12 (1st March 2015)
by TenPlus1
]]
@@ -60,11 +60,13 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
end
-- add the node and remove 1 item from the itemstack
- minetest.add_node(pt.above, {name=plantname})
- if not minetest.setting_getbool("creative_mode") then
- itemstack:take_item()
+ if not minetest.is_protected(pt.above, placer:get_player_name()) then
+ minetest.add_node(pt.above, {name=plantname})
+ if not minetest.setting_getbool("creative_mode") then
+ itemstack:take_item()
+ end
+ return itemstack
end
- return itemstack
end
-- Single ABM Handles Growing of All Plants