MineColonies

MineColonies

57M Downloads

Multiple Farmers - Assignment issue

bob0bob opened this issue ยท 1 comments

commented

mine craft 1.12.2
mine colonies 8.5989

Once you have a mine colony with 2 farms. I have 5 fields. I try to set them up to "manual". I have one farmer hut level 4. I have a new farmer hut lvl 1.

Lvl 4 hut is assign f farms 1 - 4 and lvl 1 hut assigned farm 5.

If you go to the fields and right click on the scarecrow. It has farmer 1 (lvl 4) is assigned to every scarecrow. Even though the farmer hut shows it correctly just farms 1 - 4.

It doesn't appear that you can get it done correctly. If you remove all assignments from each hut and break the scarecrow and reassign the farmers back to fields. When it finally updates, it shows farmer (lvl4 hut) is assigned to all the fields.

commented

It appears it is a sync issue with farmerFields. Once it is out of sync, it can never get back into sync.
A quick look at syncWithColony(). It doesn't do what the name indicates. It doesn't sync because when it is going through the list. It assumes everything in the farmerFields is assigned to him.

I dont' know the correct solution but this worked.

I changed:
if (scarecrow == null)
to:
if (scarecrow == null || field.getOwner().compareTo(getMainWorker().getName()) != 0)

This also put a second check in if the sync of the fields are off. It check the owner. I assume there is a better version. Like a unique IDEA??? Because a rename of citizen would cause them to lose this field. but I can't locate a variable inside of Field that would use a unique ID to point back to the farmer. I don't see one. So this seems like the best solution.

BUT THIS SOLVES the assignment issue, When someone has gone through mod with bugs, or other issues. This will make sure it is in sync correctly.