diff --git a/res/content/base/scripts/components/falling_block.lua b/res/content/base/scripts/components/falling_block.lua index f650b6f79..ee2075f4d 100644 --- a/res/content/base/scripts/components/falling_block.lua +++ b/res/content/base/scripts/components/falling_block.lua @@ -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}})