Incompatibility with IE/Enchiridion/Optifine
rigerc opened this issue ยท 10 comments
I think this is Optifine's doing but I thought I'd open a issue here anyway to make you aware of the problem:
Crash log with this issue:
http://pastebin.com/RU1R8Kv1
Seems to say nothing but I'm not very good at reading logs.
The error:
[11:57:15] [Client thread/ERROR] [FML/]: Caught exception from immersiveengineering
java.lang.StackOverflowError
at net.minecraft.client.gui.FontRenderer.func_78263_a(FontRenderer.java:745) ~[bdl.class:?]
at blusunrize.immersiveengineering.client.IEItemFontRender.getCharWidthFloat(IEItemFontRender.java:118) ~[IEItemFontRender.class:?]
at net.minecraft.client.gui.FontRenderer.func_78263_a(FontRenderer.java:745) ~[bdl.class:?]
at blusunrize.immersiveengineering.client.IEItemFontRender.getCharWidthFloat(IEItemFontRender.java:118) ~[IEItemFontRender.class:?]
at net.minecraft.client.gui.FontRenderer.func_78263_a(FontRenderer.java:745) ~[bdl.class:?]
at blusunrize.immersiveengineering.client.IEItemFontRender.getCharWidthFloat(IEItemFontRender.java:118) ~[IEItemFontRender.class:?]
at net.minecraft.client.gui.FontRenderer.func_78263_a(FontRenderer.java:745) ~[bdl.class:?]
at blusunrize.immersiveengineering.client.IEItemFontRender.getCharWidthFloat(IEItemFontRender.java:118) ~[IEItemFontRender.class:?]
It looks like IE is patching the FontRenderer to call IEItemFontRender.getCharWidthFloat(), which calls back the original method, which causes an endless loop.
Because IE and OptiFine seem to work, then most probably Enchiridion is also patching FontRenderer and causing the IE patch to generate a wrong code.
Summary:
- OptiFine changes FontRenderer (required)
- Enchiridion probably patches FontRenderer (no idea why)
- IE tries to patch the patched FontRenderer and generates invalid code causing the endless loop
Because of problems like that, the class patching should be avoided and all base class changes should be delegated to Forge. OptiFine takes care to reflect all base class changes which Forge does and to be compatible with it.
My font and ie's font don't interact at all. We're both extending FontRenderer and using our own font instances. Not patching the class. They work fine without optifine.
Then the question is why is the IE FontRenderer causing an endless loop only when Enchiridion is added to the mix?
If IE is extending the FontRenderer and overriding getCharWidth(), then there is no OptiFine code being called at all and the endless loop is caused only by IE.
This may be a total coincidence.
OptiFine is adding a private method getCharWidthFloat() which is being called at line 745. This is absolutely safe as the private method can not be overriden by a subclass.
If IE is extending the class and adding a public method with the same name AND someone else is changing the FontRenderer method signature to public via ASM then the IE method will override the OptiFine method and it will cause the problem exactly as the stack trace shows.
Is someone changing the private FontRenderer methods to public via ASM? Forge maybe?
That would explain it then. I have all things being made public in my AT. (forgot about that..) I was lazy :P. (As there was a lot of things). I should just change it to the specific things I need access to. (And I know blu has that method name).
Understandable that you can't work around every other mod out there though I'm sad to have to keep Enchiridion disabled. Can't play with this many mods without Optifine and IE just brings more to my world.
You've done a great mod though and next world I make I might go without IE.