mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
parent
df2c474d19
commit
eb92bfb030
@ -200,9 +200,10 @@ core.register_entity(":__builtin:item", {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
on_punch = function(self, hitter)
|
on_punch = function(self, hitter)
|
||||||
if self.itemstring ~= '' then
|
local inv = hitter:get_inventory()
|
||||||
local left = hitter:get_inventory():add_item("main", self.itemstring)
|
if inv and self.itemstring ~= '' then
|
||||||
if not left:is_empty() then
|
local left = inv:add_item("main", self.itemstring)
|
||||||
|
if left and not left:is_empty() then
|
||||||
self.itemstring = left:to_string()
|
self.itemstring = left:to_string()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user