Patchouli

Patchouli

167M Downloads

Putting a conditionally-loaded entry in a conditionally-loaded category fails

LemmaEOF opened this issue ยท 2 comments

commented

Mod loader

Fabric

Minecraft version

1.18.2

Patchouli version

1.18.2-71

Modloader version

Quilt Loader 0.17.0

Modpack info

No response

The latest.log file

https://cdn.discordapp.com/attachments/950847275549229086/989277373453205564/message.txt

Issue description

We've run into an issue in the Hexcasting discord related to conditional-loading flags for Patchouli categories and entries. The setup is as such:

  • Hexcasting adds the category hexcasting:interop, based on the flag hexcasting:any_interop which returns true if any of the interop-supported mods are loaded
  • Hexcasting adds the entry hexcasting:interop/pehkui, inside the category hexcasting:interop and based on the flag mod:pehkui
  • When none of the interop-supported mods are loaded, Patchouli doesn't load the hexcasting:interop category, because its flag condition isn't met
  • However, when trying to load the entry hexcasting:interop/pehkui, it deserializes and checks the category it should be added to before checking the entry's load flag, causing it to throw a RuntimeException due to having an invalid category

The quickest solution for this would be to check an entry's flag before determining the category for it to load into. A more complex (and complete) solution could involve marking which categories have been skipped due to flags and skipping any entries meant to go in those categories.

Steps to reproduce

No response

Other information

I'm not sure where the resource reload listener for books is, so it may be a Fabric/Quilt-exclusive bug and it may not.

commented

Patched back to the old behaviour, #549 tracks the long term improvement

commented

Just ran a test to confirm that this bug was introduced between Patchouli-1.18.2-70-FABRIC and Patchouli-1.18.2-71-FABRIC: all other mods being equal, switching between those introduces or rolls back the bug.