1
0
réplica de https://github.com/HybridDog/builtin_item.git sincronizado 2025-10-21 12:15:47 +02:00

Update to the "take items only if inventory is not full" behavior

Este cometimento está contido em:
Zeg9
2013-04-19 21:07:02 +02:00
ascendente 913540214c
cometimento 7c071a45f5

Ver ficheiro

@@ -171,7 +171,11 @@ 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
self.itemstring = left:to_string()
return
end
end
self.object:remove()
end,