Minecraft version
1.20.1
Hex Casting version
0.11.3
Issue description
When a creative-mode Ancient Scroll tries to load the stroke order for its spell, it checks to make sure the spell exists (on line 176) but it doesn’t check to make sure that the per-world pattern for that spell has actually been calculated. If it hasn’t (ie in any situation where recalcPatterns would be necessary) then the getCanonicalStrokesPerWorld call on line 182 returns null, causing the serializeToNBT call on the following line to crash the game. Since the scroll attempts to load its pattern every inventory tick, this effectively locks you out of the world unless you edit your player data to remove the problematic scroll.
Steps to reproduce
- Create a world
- Update or install an addon such that
/hexcasting recalcPatterns is necessary
- Grab the Ancient Scroll for the new spell from the creative tab
- Observe that placing it in your inventory causes a crash
- Observe that rejoining the world instantly crashes you again### Other information
The fix for this would just be to add a second null-check after the getCanonicalStrokesPerWorld check, just like the existing one for the opID value.