Et Futurum Requiem

Et Futurum Requiem

105k Downloads

StackOverflowError Crash

DDRAIGOCH117 opened this issue ยท 7 comments

commented

Please check any boxes that apply to you and your issue

  • I use a translator application to post this issue.

  • This is a crash. Please upload, Pastebin, Gist or copypaste the whole crash report along with this issue.

  • This is a mod incompatibility. If I do this in vanilla Forge with only Et Futurum Requiem installed, it works normally.

  • This is a code problem. Please link the probably problematic lines of code in the issue and/or explain in detail what is wrong.

Version number of Et-Futurum-Requiem (IMPORTANT)

Et futurum Version: 2.4.2

Describe the issue (IMPORTANT)

The game crashes on launch when adding the new arrows with effects with a StackOverflow error. I assume that this is caused because of too many potion effects on the modpack. Game launches normally if arrows are disabled in the config.
crash-2023-01-18_19.08.46-client.txt

commented

There are a lot of mods here, would you mind narrowing down which one causes this?

commented

This is likely pure Et Futurum Requiem actually. Are you calling the Potion Helper without actually checking if it might go recursive?

commented

PotionHelper is not the issue, it's this line:

return StatCollector.translateToLocal(s1).trim() + " " + super.getItemStackDisplayName(stack);

Item#getItemStackDisplayName ends up calling getUnlocalizedName again, causing a loop.

This line is reached when the arrow has an effect that can't be mapped to a potion effect, causing the method to fall back to interpreting it as a potion prefix instead (Awkward, Thick, etc).

I can reproduce this by giving myself an Awkward arrow like so: /give @p etfuturum:tipped_arrow 1 16.

Using translateToLocal inside getUnlocalizedName makes no sense since the method is supposed to return a localization key. I'm guessing the line was meant to be

return s + s1;

which would make it return item.etfuturum.tipped_arrow.potion.prefix.awkward in the Awkward potion's case.

(But then of course, what's the point of an Awkward arrow in the first place? Maybe for these arrows we should simply return the "Uncraftable Tipped Arrow" key.)

commented

Hrrm, there is Splash Water Potions, which extinguish Fire (at least on burning Entities), unsure if Tipped Arrows can do the same.

commented

There are no water tipped arrows no.

commented

This is likely pure Et Futurum Requiem actually. Are you calling the Potion Helper without actually checking if it might go recursive?

My reason to initially suspect it as a mod conflict was because the crash was described to appear on launch. I'll push a fix to what Makamys pointed out but OP's issue may be different since it happened on launch. Although the functions in the crash report are the same so there might also be a mod grabbing the names of items on launch for some reason.

commented

Eh, yeah, it's the same crash so I'll close this now that it's fixed. I checked how vanilla handles "awkward" arrows and they just display as "Tipped Arrow". I've reflected this in the new code.