BuildCraft|Factory

BuildCraft|Factory

7M Downloads

Guide images crashing

Chocohead opened this issue ยท 6 comments

commented

Changing all the parsing/loading of the guide pages to when the book is first opened has broken the loading of images on pages.

When MarkdownPageLoader parses an image, it will use loadDefaultImage or loadSizedImage, both will produce a TextureResourceHolder and register it with the ResourceRegistry. The original design looks like that would then load all the images during the resource reload after post-init. But now that the parsing of the pages is much later, ResourceRegistry will never load the images (which can be seen as TextureResourceHolder#load is never called). This causes the textures to never be given a size, which then crashes in GuideImage as it tries to scale them.

This can be caused by putting ![anything] in a page, the contents of the brackets isn't important as the texture is never loaded thus the path never followed.

commented

...dammit. Admittedly I've never actually tested images before so I'm not too surprised that they don't work.

commented

Also changing the load order was probably not a great idea either - it was done to allow facade swap recipes to load, so I'll probably have to do them differently.

commented

Looking back through it quite a few things are done oddly, I'll probably take another pass at the loader at some point.

commented

I can work around it in the mean time, if the needed TextureResourceHolders are manually added to the ResourceRegistry it seems to all load fine. It's quite loud when failing to find a translated version of the image though.

commented

Unfortunately you're going to have to wait about 2 weeks minimum for me to get back to my dev environment and release a fix for it... sorry.

Failing to find a translation of an image shouldn't really add anything to the log, I'll remove that code too...

commented

This should be properly fixed in d1a0b7b, and will be released in 7.99.7 shortly.