fix extended blocks destruction particles spawn spread, offset

This commit is contained in:
MihailRis 2025-08-20 23:49:18 +03:00
parent a8f2de967f
commit 6cae75e02f

View File

@ -1,6 +1,11 @@
function on_block_broken(id, x, y, z, playerid) function on_block_broken(id, x, y, z, playerid)
if gfx then if gfx then
gfx.particles.emit({x+0.5, y+0.5, z+0.5}, 64, { local size = {block.get_size(id)}
gfx.particles.emit({
x + size[1] * 0.5,
y + size[1] * 0.5,
z + size[1] * 0.5
}, 64, {
lifetime=1.0, lifetime=1.0,
spawn_interval=0.0001, spawn_interval=0.0001,
explosion={4, 4, 4}, explosion={4, 4, 4},
@ -8,7 +13,7 @@ function on_block_broken(id, x, y, z, playerid)
random_sub_uv=0.1, random_sub_uv=0.1,
size={0.1, 0.1, 0.1}, size={0.1, 0.1, 0.1},
spawn_shape="box", spawn_shape="box",
spawn_spread={0.4, 0.4, 0.4} spawn_spread=vec3.mul(size, 0.4)
}) })
end end