mirror of
https://github.com/MinetestForFun/fishing.git
synced 2025-08-03 15:50:34 +02:00
Compare commits
3 Commits
v1.0.0
...
bc37d001c6
Author | SHA1 | Date | |
---|---|---|---|
bc37d001c6 | |||
26f79a8f36 | |||
2389efbc87 |
@ -16,9 +16,14 @@ minetest.register_craftitem("fishing:bait_worm", {
|
|||||||
groups = { fishing_bait=1 },
|
groups = { fishing_bait=1 },
|
||||||
inventory_image = "fishing_bait_worm.png",
|
inventory_image = "fishing_bait_worm.png",
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
if not placer then -- can happen, e.g. if placed using minetest.place_node
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
local pt = 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")
|
if not minetest.is_protected(pt.under, placer:get_player_name()) then
|
||||||
itemstack:take_item()
|
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
|
return itemstack
|
||||||
end,
|
end,
|
||||||
on_drop = function(itemstack, dropper, pos)
|
on_drop = function(itemstack, dropper, pos)
|
||||||
|
Reference in New Issue
Block a user