summaryrefslogtreecommitdiff
path: root/grapes.lua
diff options
context:
space:
mode:
Diffstat (limited to 'grapes.lua')
-rw-r--r--grapes.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/grapes.lua b/grapes.lua
index bd2a3a8..021e5da 100644
--- a/grapes.lua
+++ b/grapes.lua
@@ -5,6 +5,9 @@ minetest.register_craftitem("farming:grapes", {
inventory_image = "farming_grapes.png",
on_use = minetest.item_eat(2),
on_place = function(itemstack, placer, pointed_thing)
+ if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
+ return
+ end
local nod = minetest.get_node_or_nil(pointed_thing.under)
if nod and nod.name == "farming:trellis" then
minetest.set_node(pointed_thing.under, {name="farming:grapes_1"})
@@ -59,6 +62,9 @@ minetest.register_node("farming:trellis", {
},
sounds = default.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing)
+ if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
+ return
+ end
local nod = minetest.get_node_or_nil(pointed_thing.under)
if nod and minetest.get_item_group(nod.name, "soil") < 2 then
return