Use of the passive in English varies with writing style and field. Some publications' style sheets discourage use of the passive voice, while others encourage it. If you are discouraged from using the passive voice then you need to pay attention to grammar checkers such as Grammarly.
When looking at passive voice there is an example where
"Caesar was stabbed by Brutus" is in the passive voice. The subject, Caesar, indicates the person acted upon. The agent is expressed here with the phrase by Brutus, but this can be omitted. The equivalent sentence in the active voice is "Brutus stabbed Caesar", in which the subject denotes the doer, or agent, Brutus.
So the sentence you have is in the passive voice as the subject is the Japanese who were warned. To change to an active (non-passive) voice you need to add who gave the warning and rearrange the first part of the sentence. If it was the Chinese who warned the Japanese, you could say
The Chinese warned the Japanese that one of their cities.....