SuperFactoryManager
SuperFactoryManager copied to clipboard
Add lint for diagnosing resources not stacking due to having same path but different namespace in resourcelocation
https://discord.com/channels/967118679370264627/967119184209264790/1417624291142406154
Consider the setup
-- Centrifuge -> fluid tank
-- sfm:fluid:bumblezone:honey -> sfm:fluid:justteamythings:honey
every 20 ticks do
input fluid:: from centrifuge
output fluid:: to tank
end
The execution trace would look like
- discover input slot 1000 fluid:bumblezone:honey
- discover output slot 1000 fluid:justteamythings:honey
- inputslot0 moveTo outputslot0
- peek extraction -> 1000 bumblezone:honey
- peek insertion -> remainder 1000 bumblezone:honey
- toMove = 1000 - 1000 = 0
https://github.com/TeamDman/SuperFactoryManager/blob/dbe4d49e947f8dcb24e1062daa0f41b2243c5572/src/main/java/ca/teamdman/sfml/ast/OutputStatement.java#L135-L160
User observes no resource movement (and no errors or warnings); a frustrating situation.
This scenario is programmatically detectable.
Potential future experience:
- User writes program and assigns labels
- Program builds with no warnings
- User expected move operation is not performed
- User activates advanced logging
- Program executes with advanced logging once
- Advanced logging automatically turns off
We already have the logger mechanism, so we could call .warn(callback -> inside which we can do the callback after checking so that the check isn't always running
we also have distance calculations available from the intellisense logic we can use to maybe check if a user has made a typo