Minecolonies & Better colony handling and bug fixes

in #utopian-io6 years ago (edited)

Minecolonies & Better colony handling and bug fixes

Hey everyone, my last fixathon has been a while, but, during this week I was able to add an awesome new feature and fix a handful of bugs.

Let's get started.

Fixing tests:

First of all, I had to fix the tests which broke after adding the scoreboard system [Part of this pr].

The tests failed since the scoreboard is called on init of the colony and the scoreboard was undefined in the test cases.

For that reason, I had to mock the Scoreboard.

Return the mocked board when trying to retrieve one from the world.
And then catch all possible calls on it.

Using any we expect any parameter, this way I avoid creating one case for each possible input parameter to it.

Infinite Supply chests:

Then, there was another bug that infinite supply chests didn't work anymore.

The fix was easy since we had removed the configuration variable call in a previous update and I just re-added it.

if(player.getStatFile().readStat(StatList.getObjectUseStats(ModItems.supplyChest)) > 0 && !Configurations.gameplay.allowInfiniteSupplyChests)

Better starts:

Besides that, we noticed that one of the main reasons people don't stick to minecolonies after a few minutes is that the game start is quite slow.

For that reason, I created a speed bonus for the builder over a certain y level for digging out spaces which should make the builder way more efficient early on and also make new players happy.

Additionally, people were complaining about our deliverymen being very slow so I added that they retrieve an additional item stack on each trip.

Their capacity doubles with each building level, but early on 1 stack is not enough to keep the colony running decently.

Armor request Mess:

Then, there were some issues with our armor requesting which we fixed quickly.

There were three issues we solved:

  • Some naming issues
  • Missing constants which made it difficult to understand the code
  • Overriding lists

The first was an easy fix, the second one we fixed by creating said constants and moving them to the appropriate files and the last one was a bit more tricky.

What was happening is that knights should requests shields additionally to armor.

So, previously the shield request was overriding this.
For this reason, I changed the put to a get and add which solved this issue.

Losing owner bug:

A bug we've been having for years already and never got solved was that colonies on loading sometimes were losing their owner permissions.
Our workaround for that was a refresh command which restored the owner if null, just these days I got the idea to run this command on player login automatically which hides the bug from the player.

Request list:

And last, a new feature. Players always complained that there should be a way to take a list from the builder with them so they know which resources he needs while they gather them.

Before the semester really starts I decided to give this a go.
To make this work I had to add three things:

  • An item which holds the information
  • A GUI displaying the information
  • A connection between both.

For that reason, I added the resource scroll item.

Thanks for the texture to one of our artists.

Which will, similar to the second page of the builder's hut, show the list of blocks the builder will need.

On use on the builders building block, the scroll will set the colony id and building position.

On use in the air or on another block open the window if the colony id and the position of the building are set.

Or notify the player if not so.

To make the texture work I had to create:

  • The item model

  • The recipe

  • Register item and model

For the GUI I extracted the relevant items from the builder GUI.

a) The window XML.

and b) The window class

The main changes I had to do was adapting the constructor and extracting all irrelevant functionality as in interacting with the building itself.

In the constructor, I had to set up the building handling to get the builder building from the view and message the player if not found.

At the same time, I had to make sure the GUI closes if the parameter were invalid upon being opened.

Pull requests:
https://github.com/ldtteam/minecolonies/pull/2742
https://github.com/ldtteam/minecolonies/pull/2735
https://github.com/ldtteam/minecolonies/pull/2733
https://github.com/ldtteam/minecolonies/pull/2731
https://github.com/ldtteam/minecolonies/pull/2719
https://github.com/ldtteam/minecolonies/pull/2715
https://github.com/ldtteam/minecolonies/pull/2698

I hope you guys liked the new updates, I bet our players will love them.

Until the next time!

Sort:  
  • Mocking would make another great tutorial on testing...

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


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

Waiting for the new update

Hey @raycoms
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.19
TRX 0.15
JST 0.029
BTC 63207.55
ETH 2571.17
USDT 1.00
SBD 2.82