Put boat/minecart in inv when punched in creative

This commit is contained in:
Wuzzy 2019-02-06 21:56:52 +01:00
parent 4bd9be22e0
commit d59d789c80
2 changed files with 12 additions and 0 deletions

View file

@ -85,6 +85,13 @@ local function register_entity(entity_id, mesh, textures, drop, on_rightclick)
for d=1, #drop do
minetest.add_item(self.object:get_pos(), drop[d])
end
elseif puncher and puncher:is_player() then
local inv = puncher:get_inventory()
for d=1, #drop do
if not inv:contains_item("main", drop[d]) then
inv:add_item("main", drop[d])
end
end
end
self.object:remove()