Hey everyone, the last days I spent a lot of times on a lot of small annoying stuff.
First of all, I ported the changes of the last weeks to 1.10 and 1.11 respectively from 1.12.
Porting is quite annoying because it's 50% fiddling with git and 40% fiddling with code which changed and 10% fiddling with gradle.
Then, I create a branch at the current head of the 1.10/1.11 branch and name it port1.10/whatIamPorting.
Luckily we squash merge our pull requests so each pull requests gets merged into 1 commit in git.
Then I cherry pick the commits in order and fiddle together the merge conflicts.
Sometimes it's easy to resolve in the resolver tool of Gitkraken sometimes it requires to manually resolve them in the file.
After that is done I start up the 1.10 version, occasionally I have to reset the workspace and check out the new libraries manually since gradle messed them up.
Then, unfortunately, the real porting starts since I have to remove the errors of things which do not exist or are named differently in the other version.
Quite regular and easy to resolve are moved libraries:
Or the fact that the ItemStack handling in 1.10 is very different from 1.11 and 1.12:
Also sometimes important variables changed their names
After countless hours I was finally able to port crafting to 1.10 as well and include the most recent other changes to 1.10 and 1.11.
Nevertheless, playtesting is always necessary since several changes do not cause compile errors, only errors during runtime.
Then I finally reworked a bit of the cook code and was able to fix him after the changes crafting and other changes came which broke parts of his AI.
First of all, I fixed a request by a player, since when a worker had a full inventory the cook would try forever to give him food and fail.
So I added a player message here so the player gets messaged about it and is able to resolve it.
Then, previously the cook tried to remember when he put something in the oven, but this didn't work very reliable, so I let him now check the furnaces every now and then to check for this:
Besides this, I fixed a couple of other small bugs with the cook where his state wasn't being changed accordingly and he'd wait forever for an event to happen.
Then I cleaned up the code of our recipes in 1.10 and 1.11
Previously our code of recipes was a mess.
We had around 8x the following code in the recipe handler.
When I saw this code I saw a nice loop going through all of them and was able to replace 100 lines of code with just 10.
After:
Which is way cleaner and way less error prone.
I did the same thing for the shingle blocks I talked about 2 weeks ago which is also a cleaner way to register their recipes.
I hope you liked the post of today, to get some insight into what of time killing things minecraft modders often have to fight.
The 1.10 and 1.11 port of those two changes costs me almost as much as coding 2 medium sized new features.
Until the next time.
Posted on Utopian.io - Rewarding Open Source Contributors