Minecolonies & Better colony handling and bug fixes by raycoms

View this thread on steempeak.com
· @raycoms · (edited)
$129.79
Minecolonies & Better colony handling and bug fixes
Minecolonies & Better colony handling and bug fixes

![](https://i.imgur.com/wTf7U2c.png)

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]](https://steemit.com/utopian-io/@raycoms/minecolonies-and-pvp-system-part-1).

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.

![](https://i.imgur.com/7TlxUKd.png)

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.

![](https://i.imgur.com/svLYyBU.png)

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.

![](https://i.imgur.com/JF8F2YY.png)

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.

![](https://i.imgur.com/TrmwjD7.png)

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.

![](https://i.imgur.com/EwdJvJu.png)

Thanks for the texture to one of our artists.

![](https://i.imgur.com/wTf7U2c.png)

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

![](https://i.imgur.com/LFFtbmv.png)

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

![](https://i.imgur.com/ByTlXby.png)


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

![](https://i.imgur.com/q5fbRkx.png)

- The recipe

![](https://i.imgur.com/o41JxXN.png)

![](https://i.imgur.com/zZZhI5M.png)

- Register item and model

![](https://i.imgur.com/GOWfEU8.png)

![](https://i.imgur.com/HclYl2y.png)

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

a) The window XML.

![](https://i.imgur.com/dLwvceo.png)

and b) The window class

![](https://i.imgur.com/7vH6JPm.png)


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.

![](https://i.imgur.com/uDgRSrX.png)

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

![](https://i.imgur.com/5KaB7lY.png)

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!
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 96 others
properties (23)
post_id58,801,219
authorraycoms
permlinkminecolonies-and-better-colony-handling-and-bug-fixes
categoryutopian-io
json_metadata{"image":["https:\/\/i.imgur.com\/wTf7U2c.png"],"app":"steemit\/0.1","links":["https:\/\/steemit.com\/utopian-io\/@raycoms\/minecolonies-and-pvp-system-part-1","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"],"tags":["utopian-io","development","gaming","technology","programming"],"format":"markdown"}
created2018-08-05 13:40:24
last_update2018-08-06 02:21:39
depth0
children3
net_rshares83,503,252,361,870
last_payout2018-08-12 13:40:24
cashout_time1969-12-31 23:59:59
total_payout_value98.434 SBD
curator_payout_value31.351 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length5,432
author_reputation120,534,427,956,805
root_title"Minecolonies & Better colony handling and bug fixes"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (160)
@manisahere ·
Waiting for the new update
πŸ‘  
properties (23)
post_id58,801,600
authormanisahere
permlinkre-raycoms-minecolonies-and-better-colony-handling-and-bug-fixes-20180805t134634083z
categoryutopian-io
json_metadata{"app":"steemit\/0.1","tags":["utopian-io"]}
created2018-08-05 13:46:36
last_update2018-08-05 13:46:36
depth1
children0
net_rshares3,654,254,258
last_payout2018-08-12 13:46:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length26
author_reputation0
root_title"Minecolonies & Better colony handling and bug fixes"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@helo ·
$0.04
* Mocking would make another great tutorial on testing...


Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/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](https://review.utopian.io/result/3/1211211).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  , ,
properties (23)
post_id58,853,175
authorhelo
permlinkre-raycoms-minecolonies-and-better-colony-handling-and-bug-fixes-20180806t022754707z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https:\/\/join.utopian.io\/guidelines","https:\/\/review.utopian.io\/result\/3\/1211211","https:\/\/support.utopian.io\/","https:\/\/discord.gg\/uTyJkNm","https:\/\/join.utopian.io\/"],"app":"steemit\/0.1"}
created2018-08-06 02:27:54
last_update2018-08-06 02:27:54
depth1
children0
net_rshares26,320,740,257
last_payout2018-08-13 02:27:54
cashout_time1969-12-31 23:59:59
total_payout_value0.029 SBD
curator_payout_value0.007 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length549
author_reputation119,612,833,307,875
root_title"Minecolonies & Better colony handling and bug fixes"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (3)
@utopian-io ·
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.**

<a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
post_id59,166,128
authorutopian-io
permlinkre-minecolonies-and-better-colony-handling-and-bug-fixes-20180809t044509z
categoryutopian-io
json_metadata{"app":"beem\/0.19.42"}
created2018-08-09 04:45:09
last_update2018-08-09 04:45:09
depth1
children0
net_rshares0
last_payout2018-08-16 04:45:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length299
author_reputation152,913,012,544,965
root_title"Minecolonies & Better colony handling and bug fixes"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000