The fix was really simple:
In Foudry class in updateBlockState():
Replaced this
if (burning)
{
world.setBlock(x, y, z, AllBlocks.block_foundry_active);
}
else
{
world.setBlock(x, y, z, AllBlocks.block_foundry);
}
With this
if (burning&&(!(world.getBlock(x, y, z)==AllBlocks.block_foundry_active)))
{
world.setBlock(x, y, z, AllBlocks.block_foundry_active);
}
else if(!burning&&(!(world.getBlock(x, y, z)==AllBlocks.block_foundry)))
{
world.setBlock(x, y, z, AllBlocks.block_foundry);
}
There was a lag because on each tick the block was respawned. Now it's gone.
P.S. Thanks for help anyway