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

@ -132,6 +132,11 @@ function boat.on_punch(self, puncher)
-- Drop boat as item on the ground after punching
if not minetest.settings:get_bool("creative_mode") then
minetest.add_item(self.object:get_pos(), self._itemstring)
else
local inv = puncher:get_inventory()
if not inv:contains_item("main", self._itemstring) then
inv:add_item("main", self._itemstring)
end
end
self.object:remove()
end