[Automate] Hoppers are being automated, breaking the Super Hoppers mod
PrincessRTFM opened this issue · 4 comments
It looks like hoppers, including super hoppers, are technically chests, so Automate isn't ignoring them properly. Using Lookup Anything, I've confirmed that super hoppers are given a mod data field named spacechase0.SuperHopper
(with a constant value of "1"
according to their source), so maybe Automate can be updated to ignore any "chest" objects that have that field?
Alternatively, maybe Automate should just ignore all hoppers? It looks like Super Hoppers has a check to only operate on hopper tiles that could probably be used by Automate to filter them out.
My log is available as requested.
I've never modded Stardew, and I'm only looking through the online source code here, but I think that MachineGroupFactory.GetEntity()
might be the place to add this check. Specifically, I think it would go in the case SObject obj
block, checking if obj is Chest { SpecialChestType: Chest.SpecialChestTypes.AutoLoader }
and returning null
in that case. It could probably go just above the call to this.GetEntityFor()
, if I'm understanding the code correctly.
My reasoning for ignoring all hoppers is that Automate basically obsoletes normal hoppers by allowing chests to perform the same function. Rather than placing a hopper, which must be specifically above a given machine, a chest can be placed anywhere in a valid machine group with it, and perform identically as well as optionally accepting output from the machine at the same time.
Hi! They're already ignored in the lower-level AutomationFactory.GetFor
, which skips any hoppers with spacechase0.SuperHopper
in their mod data. Automate isn't notified when a regular hopper becomes a super hopper though, so you may need to pick up a machine and put it back down to trigger an update.
Otherwise Automate treats regular hoppers as output-only chests, which gives them a use that's slightly distinct from default chests.
Ah! That would certainly be why my setup wasn't working. I had the groups I wanted in place, then I added a hopper and applied the iridium bar to convert it. It sounds like I need to, after doing that, place and/or remove another automatable tile of any type within the new overall group (the one including the hoppers) in order for Automate to rescan everything? I'm assuming a chest should suffice and that the entire overall joint group will be broken up, even if it consists of three or more "actual" groups separated by hoppers.
For context, I'm using the Packing Boxes and Crates mod and what I'm trying to do is process ingredients in group A, hopper them into group B where that mod's crating machines will operate on them, then hopper the crated goods into "group" C which consists of the shipping bin.
Yep. Automate will also rebuild machine groups when you reload the save, so any previous super hoppers will be ignored correctly. You can press U
in-game to show the automation overlay, so you check whether a super hopper is being ignored and your machine groups are split as you expect.