Our neighbour encroached into our land.

Around 30yrs ago, a person name A(I don't wanna reveal his identity) owned a property X, and a person B owned property Y. A has illegally encroaches into Bs property without his consent and knowledge, B was financially not stable at that time and wasn't able to fight for his land legally so he left it. 10yrs before we buyed the property of B and also asked A to sell his property to us so that there will be no legal issues between us because of that encroachment. And A also accepted our request but later on sold his property X to another person named C who is our neighbour now. We even requested our new neighbour to leave the land which the ex-owner has encroached in our land, even after several requests also C didn't accepted. He also filed a suit against us claiming we have encroached into his land but the court gave judgement in our favour. And now C is renovating that building, we again requested him to renovate it by leaving the land which is in our property, but he declined the request and continuing his renovating process. We have also filed a complaint in municipality but there was no response. So, we have removed the wall which was encroached into our land by ourselves. Is it legal doing that?