1
0
mirror of https://codeberg.org/tenplus1/farming.git synced 2025-06-29 14:50:52 +02:00

Player cannot place seeds in protected area

This commit is contained in:
tenplus1
2015-03-01 14:28:51 +00:00
parent 0937c77458
commit 459044fa19
2 changed files with 8 additions and 5 deletions

View File

@ -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