They've been supporting Ukraine since the first day and been encouraging peace talks. China is one of their biggest trading partners and it's in their interest. China hasn't been sending weapons because that's just putting fuel into the fire. And they also didn't do sanctions against Russia, because those haven't been decided by the UN.
The right to resistance does not make occupation illegal. China is simply saying that Ukraine should be allowed to fight back just as Palestine should be allowed to fight back.
They kinda pretend to play both sides, kinda not. Left hand says peace talks (without action and on Russia's terms), right hand helps Russia with resources.