mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2025-02-24 21:14:06 +01:00
Drop item when inventory is full (bushes_classic)
This commit is contained in:
parent
ecf175fb9c
commit
ec4f2237f3
@ -86,8 +86,13 @@ plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
|||||||
-- give the harvested result to the player
|
-- give the harvested result to the player
|
||||||
if harvested then
|
if harvested then
|
||||||
--minetest.chat_send_player("singleplayer","you would now get "..tostring( harvested ) );
|
--minetest.chat_send_player("singleplayer","you would now get "..tostring( harvested ) );
|
||||||
|
local itemstack = ItemStack(harvested)
|
||||||
local inventory = digger:get_inventory()
|
local inventory = digger:get_inventory()
|
||||||
inventory:add_item( "main", harvested );
|
if inventory:room_for_item("main", itemstack) then
|
||||||
|
inventory:add_item("main", itemstack)
|
||||||
|
else
|
||||||
|
minetest.item_drop(itemstack, digger, pos)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user