From 20f827f4fbee4031aec571628c9096ea75f88fdc Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Thu, 31 May 2018 18:13:05 +0100 Subject: add protection checks --- cocoa.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cocoa.lua') 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}) -- cgit v1.2.3