Minecolonies & Small Improvements on the Way
Hey everyone,
the last Minecolonies update has been a few days, I've been working on some other Projects and University kept me busy as well.
I fixed a few small issues in our code and added a few Quality improvements to the game.
First of all, we noticed that we were ticking in any of the Minecraft tick phases.
For those who don't know, Minecraft ticks 20 times a second and has several phrases.
So we changed that so it only ticks in the end phase which should improve our performance slightly.
Then, we got a crash report that the getEquipmentSlot() method was crashing on the server.
When I checked into it I noticed that it was marked as "SideOnly(Client)".
For those who don't know, Minecraft uses an ugly hack to make the server side jar smaller and removes those methods :dizzy_face:
After that, we got an issue report of a player which asked for some more info on the Builder GUI:
https://github.com/Minecolonies/minecolonies/issues/2245
For that, I had to add the info of that to the View of the Building.
Client side representation of the Building class.
And serialize them...
Since they are not stored inside a String inside the work order, I change it to a String on the way for easier use.
...and set them in the view.
And the end product then finally:
Which shows the name of the Building he is constructing and the position of it.
Then, lastly, I added a way to see where the barbarians spawn.
Similar to the previous part of the code I have to store this information somewhere and then send it to the view, and from there load it into the GUI.
For that I added two new methods to the BarbarianManager:
and
The second one will be called by the barbarian spawn code to add the method.
The first one we use in the colony view to serialize the data:
I reverse the list so the newest positions are shown at the top of the list.
Then in the View, we do some magic so we have a nice display string.
We had a similar method already for the farmer GUI to show the closest fields.
I generalized this a bit, cleaned it up and moved it to the Utility classes.
We basically compare the building position and the position of the "field" the real field or the barbarians are located and append the relative positions to it.
As an end product, this gives us this:
I added this to the Barracks GUI since it doesn't have any data yet and to motivate people to upgrade it to level 3 to obtain the ability to see this data.
I hope you liked our newest additions to the code, will see you the next time!
Did you know you can sell your vote to Minnowbooster?
You don't even need high voting power to get it sold and you will get 85% of the profits!If you register via my link you get a tip of 0.5% on your sold votes and BuildTeam puts another 1.5% on top of it for me!
https://www.minnowbooster.com/referral/49434
Posted on Utopian.io - Rewarding Open Source Contributors











Thank you for the contribution. It has been approved.
As always, you're very thorough and your post are very also educational. Love it.
You can contact us on Discord.
[utopian-moderator]
I like your job raycom cong!
God bless the programming
Hey @raycoms I am @utopian-io. I have just upvoted you!
Achievements
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
really good job, game coding is really a tough work to do , specially mentally tired word,
gamers power
the last Minecolonies update has been a few days, I've been working on some other Projects and University kept me busy as well. I fixed a few small issues in our code and added a few Quality improvements to the game.