Immersive Engineering

Immersive Engineering

134M Downloads

[1.14] Crash with IE's font when out of bounds

NightmareTwilight opened this issue ยท 8 comments

commented

Got crashes when looking over our items that use IE's font. Managed to narrow it down, appears to happen when the text got too long. The first crash I got was due to the item not being localized yet, but managed to reproduce it with other items that use IE's font by shrinking the window and making GUI size max.

Crashlog:
https://gist.github.com/NightmareTwilight/2d4130ecd914761b0020def6cedece94

Mod list:

  • Forge 1.14.4-28.2.3
  • ImmersiveEngineering 0.14-94
  • JEI 1.14.4:6.0.0.11
  • Immersive Geology
commented

You should probably provide the text you are trying to render...

commented

Technically, the crash only happens when the text is larger than the window. The original one was "material.immersivegeology.chalcopyrite.name Chunk", though, as stated previously, any text that uses IE's font will work as long as it goes outside the screen. The example was only more noticeable because it was so long.

commented

It's mostly an edge case crash, that only affects long names and small screens.

commented

Here is the code that was used to produce the names: https://gist.github.com/NightmareTwilight/412129b8698b6c932a9b298592fef62c

commented

Where is the hexcolor if block called? We have it in the tooltip, but that does not seem to be related, as the problem occurs only when the text goes outside the window. The crash itself also mentions "index out of bounds: -5" which seem much more likely to be the culprit.

commented

...wait sorry what? You assumed that "Index out of Bounds Exception" means that the rendered stuff was outside the application window? .-.

Have you looked at the code it's crashing in? Have you actually gone to line 274 of IEFontRenderer? Have you worked with arrays before?

commented

Saying that you "have [hexcolor] in the tooltip, but that does not seem to be related" when the code is literally crashing in the hexcolor condition just means you didn't ever follow the stacktrace.

commented

Well the crash happens in the hexcol if block. I'm unsure why you're using that for item names anyway.

Your code also tells me nothing, given that it doesn't actually show your use of the font renderer, nor the localized text.