diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2015-10-31 10:36:08 +0000 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2015-10-31 10:36:08 +0000 |
commit | 2d55fb613b6e34d72db3e5d8b5f502dc6c9f2136 (patch) | |
tree | da5fe2350da520b97a29d3c9ae9b94918491ae47 /beanpole.lua | |
parent | 5345e6fdc59bc3afb89358446f4e2f4cb7268a26 (diff) |
grapes, trellis, beans and beanpole has protection checks added
Diffstat (limited to 'beanpole.lua')
-rw-r--r-- | beanpole.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/beanpole.lua b/beanpole.lua index 109bc2c..fa25a37 100644 --- a/beanpole.lua +++ b/beanpole.lua @@ -9,6 +9,9 @@ minetest.register_craftitem("farming:beans", { inventory_image = "farming_beans.png", on_use = minetest.item_eat(1), 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:beanpole" then minetest.set_node(pointed_thing.under, {name="farming:beanpole_1"}) @@ -63,6 +66,9 @@ minetest.register_node("farming:beanpole", { }, 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 |