mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Drop nodes as items when dugged and no room in inventory and dont remove dropped items when no room in inventory
This commit is contained in:
parent
b29834ab02
commit
ef6b8bee07
2 changed files with 13 additions and 2 deletions
|
@ -109,7 +109,10 @@ minetest.register_entity("__builtin:item", {
|
|||
|
||||
on_punch = function(self, hitter)
|
||||
if self.itemstring ~= '' then
|
||||
hitter:get_inventory():add_item("main", self.itemstring)
|
||||
local left = hitter:get_inventory():add_item("main", self.itemstring)
|
||||
if not left:is_empty() then
|
||||
return
|
||||
end
|
||||
end
|
||||
self.object:remove()
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue