Board Thread:LotR Mod Technical Support/@comment-28687263-20170302212026/@comment-25101089-20170303031059

Campinator wrote:

LOTRMod wrote: This is the crash that was fixed in LOTR version 31.3. This question has been on my mind for a bit, so I may have already asked on FB, but how was this fixed?

So the problem was that the Shaders Mod was crashing because it requires a 'resource location' (a file) for each block texture, whereas in the normal game this is not the case.

Gates and other connected textures in the mod do not have icon files - instead, they load the base icon files into the mod, and then generate all the icons combinatorially. There is a 'base' icon, a 'left side' icon, a 'top right' icon, and so on, and by overlaying these all the possibilities are generated. Why? It's much easier to create and maintain a few base icon parts than several hundred for each block.

Now, when the game loads the block icons, it uses their resource locations only in loading the icons, and does not use them afterwards (because it stitches all the icons together into one big atlas). But Forge also gives you the option to create a custom icon loader, which does not necessarily need a resource location. I implemented this to create an icon loader that works with the combinatiorially-generated connected-texture icons, which are made dynamically by the mod, and thus do not have file locations.

That's all fine (else it would have crashed when the mod was loading!) but the Shaders Mod, for reasons I'm not quite sure of, requires an actual resource location for every icon regardless of how it was loaded. So to fix this, I had to make each custom icon loader create a 'dummy resource location' that doesn't point to a real file location, and register it in the game - which, even though it is not used in loading the icon, is enough to satisfy the Shaders Mod.

So it was crashing because the Shaders Mod changed a part of how the game works, not entirely dissimilar to Cauldron server problems, and I had to make the mod account for this possibility.