Tweak drop behavior of ocean plants
This commit is contained in:
parent
40e681a566
commit
2e9efe51e8
3 changed files with 11 additions and 3 deletions
|
@ -254,7 +254,13 @@ function minetest.handle_node_drops(pos, drops, digger)
|
|||
local drop_item = ItemStack(item)
|
||||
drop_item:set_count(1)
|
||||
for i=1,count do
|
||||
local obj = core.add_item(pos, drop_item)
|
||||
local dpos = table.copy(pos)
|
||||
-- Apply offset for plantlike_rooted nodes because of their special shape
|
||||
if nodedef and nodedef.drawtype == "plantlike_rooted" and nodedef.walkable then
|
||||
dpos.y = dpos.y + 1
|
||||
end
|
||||
-- Spawn item and apply random speed
|
||||
local obj = core.add_item(dpos, drop_item)
|
||||
if obj ~= nil then
|
||||
local x = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue