mirror of
https://github.com/MinetestForFun/fishing.git
synced 2024-11-14 18:10:18 +01:00
Check for protection before placing a worm
This commit is contained in:
parent
b73a712295
commit
2389efbc87
|
@ -17,8 +17,10 @@ minetest.register_craftitem("fishing:bait_worm", {
|
|||
inventory_image = "fishing_bait_worm.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pt = pointed_thing
|
||||
minetest.add_entity({x=pt.under.x, y=pt.under.y+0.6, z=pt.under.z}, "fishing:bait_worm_entity")
|
||||
itemstack:take_item()
|
||||
if not minetest.is_protected(pt.under, placer:get_player_name()) then
|
||||
minetest.add_entity({x=pt.under.x, y=pt.under.y+0.6, z=pt.under.z}, "fishing:bait_worm_entity")
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
on_drop = function(itemstack, dropper, pos)
|
||||
|
|
Loading…
Reference in New Issue
Block a user