Minecolonies & Huge Citizen Refactor

in utopian-io •  6 years ago 

Hey everyone, these days we had gotten a lot of complaints about citizens going missing, duplicating or becoming zombies.
For that reason, I took a look at our EntityCitizen code to take care of that.
Unfortunately, it was almost impossible to figure out what the issue was.

The EntityCitizen.java class has over 2300 lines, less documentation than most other classes and all methods are spread randomly over the class.

Therefore, I noticed that a necessary step would be to extract this completely.

Similar to previous refactor I went a twofold way:

Extract specific behavior into handlers;
Extract not colony related entity overrides in an abstract class.
This way the file should be significantly smaller and at the same time way easier to handle in the future.

image

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Hi @mubar, you can't just copy someone else's post and submit that to Utopian.io. For this reason you have been banned from contributing to Utopian.io for 10 days. I recommend you take this time to read our guidelines.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]