Hey everyone, continuing the quest of solving as many of minor and medium-sized issues which are quite often gamebreaking I solved a bunch of other issues during this week.
First of all, the female deliveryman's arms were quite far from her body and too far behind, so I adjusted the values of that and cleaned up the model code a bit while I was at it.
The result looks much better:
Previously when we wanted to mirror decorations when placing them they would be placed with an offset.
As in the above picture, they should've been build on the same spot, but due to the mirror function, it was placed with an offset.
After some tinkering, I found out that this happens because the central position we calculate does not change when we place the structure.
To fix this, we recalculate the point when mirroring (Mirror would be making positive x to negative x and positive z to negative z) and then applying the rotation to the point.
Works perfectly now.
Besides that citizens regularly got stuck on ladders when trying to path down.
Since the Pathfinder is not able to exactly time the position as a player would.
That's why I had the pathfinder to search a position randomly close to his target which will let the worker by 80% on the first try to go down, and then he will continue pathing different distances until he is able to do it.
Then, I finally fixed that workers are able to dump their items into all chests within their building.
The fix for that was super easy since our buildings are CapabilityProviders which do provide a container (And this container is a list of all containers of the building) I had to adapt that we dump into the building and not into the building chest.
Since we allow the worker to put things in the chest we gotta allow the dman to retrieve from there as well:
So, again I replaced building tileEntity with building only.
We also fixed the random Dman gathering to be truly random by priority and not pseudo-random.
By shuffling the array of the building.
Citizens previously changed their style depending on their level, but since they only level in jobs we adapted this to them leveling depending on the housing.
So, you'll see some especially, fancy citizens over your colony.
For that, I extracted some model code to prime it on the building level into a specific method.
Which gets called on assign and unassign to and from a building and on building an upgrade for all citizens of a particular building.
Since we fixed the cook he requested infinite amounts of food which we limited to his building level:
Where we had a reachedMaxToKeep() which we check before we request any material in our superclass.
@Override
protected boolean reachedMaxToKeep()
{
return InventoryUtils.getItemCountInProvider(getOwnBuilding(), ItemStackUtils.ISFOOD) > Math.max(1, getOwnBuilding().getBuildingLevel() * getOwnBuilding().getBuildingLevel() / 2) * SLOT_PER_LINE;
}
Then we had this week our server run into a restart loop since someone built a cycle into the crafting requests.
So I had to hotfix a loop delimiter.
Doing the classic, adding the same method with a counter.
And then checking for it, while increasing it with each recursive call.
Then, we also fixed the guard getting stuck while pathing to weird places,
so I made the stuck handler available for the guard.
And then, we decide on a new control target if we are there or if we are stuck going to the current one.
We also had a bunch of players complain for a while about the lumberjack wandering off too far.
Which we fixed by letting him wander only a certain range off and then starting to search close to his hut again.
By adjusting his start position when he is too far from the hut:
And finally but not less important some small fixes:
List of Pull Requests:
https://github.com/ldtteam/minecolonies/pull/2662
https://github.com/ldtteam/minecolonies/pull/2660
https://github.com/ldtteam/minecolonies/pull/2649
https://github.com/ldtteam/minecolonies/pull/2633
https://github.com/ldtteam/minecolonies/pull/2646
https://github.com/ldtteam/minecolonies/pull/2642
https://github.com/ldtteam/minecolonies/pull/2641
https://github.com/ldtteam/minecolonies/pull/2640
https://github.com/ldtteam/minecolonies/pull/2635