mirror of
https://github.com/minetest-mods/item_drop.git
synced 2024-12-22 22:02:26 +01:00
Ignore items where picking failed
tested with item_helpers
This commit is contained in:
parent
8e1878d101
commit
726b5f4872
5
init.lua
5
init.lua
@ -8,6 +8,10 @@ item_drop = {
|
||||
-- It is also executed before collecting the item after it flew to
|
||||
-- the player and did not reach him/her for magnet_time seconds.
|
||||
can_pickup = function(entity, player)
|
||||
if entity.item_drop_picked then
|
||||
-- Ignore items where picking has already failed
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end,
|
||||
|
||||
@ -16,6 +20,7 @@ item_drop = {
|
||||
before_collect = function(entity, pos, player)
|
||||
end,
|
||||
after_collect = function(entity, pos, player)
|
||||
entity.item_drop_picked = true
|
||||
end,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user