add 'states' parameter to base:falling_block
This commit is contained in:
parent
45807fdcb1
commit
9a190acb8b
@ -3,10 +3,13 @@ local body = entity.rigidbody
|
||||
local rig = entity.skeleton
|
||||
|
||||
local blockid = ARGS.block
|
||||
local blockstates = ARGS.states or 0
|
||||
if SAVED_DATA.block then
|
||||
blockid = SAVED_DATA.block
|
||||
blockstates = SAVED_DATA.states or 0
|
||||
else
|
||||
SAVED_DATA.block = blockid
|
||||
SAVED_DATA.states = blockstates
|
||||
end
|
||||
|
||||
do -- setup visuals
|
||||
@ -22,7 +25,7 @@ function on_grounded()
|
||||
local iy = math.floor(pos[2])
|
||||
local iz = math.floor(pos[3])
|
||||
if block.is_replaceable_at(ix, iy, iz) then
|
||||
block.place(ix, iy, iz, block.index(blockid), 0)
|
||||
block.place(ix, iy, iz, block.index(blockid), blockstates)
|
||||
else
|
||||
local picking_item = block.get_picking_item(block.index(blockid))
|
||||
local drop = entities.spawn("base:drop", pos, {base__drop={id=picking_item, count=1}})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user