summaryrefslogtreecommitdiff
path: root/cocoa.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2018-05-31 18:13:05 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2018-05-31 18:13:05 +0100
commit20f827f4fbee4031aec571628c9096ea75f88fdc (patch)
tree4de82fd9a8e9472b582a21dfcb62d4865ada9d53 /cocoa.lua
parenta2b9d8f4efad88452c4b7d8a510bf992f57dd388 (diff)
add protection checks
Diffstat (limited to 'cocoa.lua')
-rw-r--r--cocoa.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/cocoa.lua b/cocoa.lua
index a8491ac..71d038e 100644
--- a/cocoa.lua
+++ b/cocoa.lua
@@ -31,6 +31,11 @@ local function place_cocoa(itemstack, placer, pointed_thing, plantname)
return
end
+ -- check for protection
+ if minetest.is_protected(pt.above, placer:get_player_name()) then
+ return
+ end
+
-- add the node and remove 1 item from the itemstack
minetest.set_node(pt.above, {name = plantname})