EDIT: I've updated the mod following @Pathoschild guidelines, and using the updated source code available here - My code is committed there as well.
I've updated the attached file in this post for anyone referencing it.
Changes/Fixes in this update:
-Supports SDV 1.5.1, SMAPI 3.8.2;
-Fixes Golden Walnuts issues by avoiding the collection of those - My previous version still wrongfully collected 3 Golden Walnuts (Sorry!), they where at: Captain's Room (1) and Volcano Forge (2);
-Changes the Minimal harvest formula to allow a value higher than 1, up to the established Max value for the crop - increased per Farmer Level / Max Increase parameter;
-Grabs Ginger on all Island locations - New 1.5 forage item
My Previous/Original post follows:
I'm sorry for showing up just now, I've been trying to get my account validated since yesterday hahaha.
I've been following @Strobe
and Deluxe Auto-grabber and I managed to get it to work with 1.5 without the need to replant any crops, with Global Forage set to ON and without causing issues with Golden Walnuts
, I've uploaded my version below, it uses the source from here: https://github.com/Pathoschild/smapi-mod-dump/tree/1a8bafc1b62b8cb99f59384a0e9679366339803e/source/Deluxe%20Auto-Grabber/DeluxeGrabber
-This version will not cause the DivideByZero Exception and will work 100% to collect global forage, it will not attempt to collect Golden Walnuts in the Island maps.
-This version does not yet attempt to grab new items from 1.5, if you guys could provide me a list of new item Id's of the new forageable items, I'd be glad to make this update.
I'd like to get in touch with @Strobe
to make sure I'm using the same source he's using and collaborate to fully update the Mod, if you get this, PM me plz :)
Long story/Technical details:
-The DivideByZero Exception is caused by the maxHarvestIncreasePerFarmingLevel
property of the Crop object being returned as 0 for Coffee beans and perhaps other Crops too. I don't know the previous version values (if anyone knows, let me know), so right now I've changed it so it either uses the existing value or, if it is zero, reverts to 1. This Exception literally stops the processing of the grabber on the start of each day, hence why we didn't get all the fruits from trees or forageable items, but still got a few.
-The Golden Walnuts are collected from a Bush Object, the original mod author coded Bushes to be collected when blooming, but made the types of berries static in code, so, in Sping, it collects Salmonberries, and in Fall, it collects Blackberries. However, this causes an issue with the new Golden Walnuts, because they are also collected from Bushes (the first one you get and a few others) but are neither Salmonberries nor Blackberries. If you are in either Spring or Fall, the previous code would just create the respective berry in your global grabber and delete the Walnut - So some of your Berries would actually be the Golden Walnut. - In case you already played in 1.5 with your savefile, you cannot get the Walnuts to be placed back, however, you can spawn them with CJB Item Spawner or, if you want, get a previous save from 1.4.5 and load into that one, your Golden Walnuts will be correctly in place when using this version of Deluxe Auto-Grabber.
I hope this can be helpful and I'd like to get your feedback, I plan on updating the mod to gather the new items and work better with the Islands, but for now, this will be functional.