From 20f827f4fbee4031aec571628c9096ea75f88fdc Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Thu, 31 May 2018 18:13:05 +0100 Subject: add protection checks --- grapes.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'grapes.lua') diff --git a/grapes.lua b/grapes.lua index 9a6ab9e..8b0ae2a 100644 --- a/grapes.lua +++ b/grapes.lua @@ -26,6 +26,11 @@ local function place_grapes(itemstack, placer, pointed_thing, plantname) return def.on_rightclick(pt.under, under, placer, itemstack) end + -- check for protection + if minetest.is_protected(pt.under, placer:get_player_name()) then + return + end + -- check if pointing at trellis if under.name ~= "farming:trellis" then return @@ -114,7 +119,7 @@ minetest.register_node("farming:trellis", { return def.on_rightclick(pt.under, under, placer, itemstack) end - if minetest.is_protected(pt.under, placer:get_player_name()) then + if minetest.is_protected(pt.above, placer:get_player_name()) then return end -- cgit v1.2.3