Arboretums receiving saplings from other Arboretums (Multifarms and Managed Farms)
Steampunk-Wizard opened this issue ยท 15 comments
Possibly the weirdest bug I've ever seen in a mod -
Forestry version - 5.8.1.322 : Minecraft Version - 1.12.2 : Modpack Version - FTB Revelations 2.5.0
Presently on a multiplayer server, 3 different players have some form of Arboretum, (I'm using a 50/50 Arboretum/Orchard Multifarm, and my friends are using the single block Managed Farms) and for some strange reason, we will find saplings in our farms' output slots that shouldn't be there.
I'm harvesting Red Maple (From Binne's Extra Trees), Friend A is harvesting generic Oak trees, and friend B is harvesting Rubber saplings (From IC2) and all three of us are receiving saplings that the other is harvesting, alongside what we should be getting.
All 3 farms are presently chunkloaded, and being automated with different methods (Applied Energistics 2 and EnderIO) And these farms range from 300 to 500 blocks away from one another.
This bug appears to be infrequent, but incredibly constant, as we are each getting about 50-100 saplings from each other's farm per 24 hour period.
How did it happen that this issue was closed as completed?
As it seems to me the issue is still there, in 1.12.2 version of the mod at least
I can verify that this is happening. Forestry 5.8.2.374
I have two managed farms, one is growing giant sequoia and the other is growing blue mahoe. They are about 4-5 chunks apart from one another and have no input of items except power. Several times over the course of a day I will find both farms have stopped because they are clogged with the saplings of the other.
I can confirm this was a thing too. Our users (for Infitech 3) complained about it and I thought they were nuts til I reproduced it myself. Save us please Nedelosk :(
Here is what I think happens: I don't think the produce
field here is unique to each farm. In fact, from what I can see every arboretum uses the same FarmLogicArboreal
. So the saplings and fruit picked up by the farms are shared.
EDIT: hmm, I'm not sure. Things seem dodgy in this area though.
The logic seems to persist lots over farming cycles in order to cope with running out of inventory/power mid harvest (I would guess). So things like lastExtentsHarvest
are also shared for every arboretum as far as I can tell.
Removing all shared state from the farm logic is also a valid fix, but I think it's a lot harder to do and I think there are reasons that the shared state exists.
The shared states are useless if you have a new instance for every farm side. So it makes no difference if we remove them or if we create a new instance ๐
For lastExtentsHarvest
the shared state makes sense yes, but produce
has absolutely no function else than save it for one cycle which is not needed because if the inventory is full, it gets on a pending list anyway.
ForestryMC/src/main/java/forestry/farming/multiblock/FarmController.java
Lines 545 to 548 in 68c52f8
I agree we can return collectEntityItems
directly, but surely there's a similar bug with lastExtentsHarvest
that's just never triggered because there's a check further on for the farm somewhere