Apothic Attributes (AttributesLib)

Apothic Attributes (AttributesLib)

24M Downloads

CRASH [1.20.1 last version]

qVoidreaver opened this issue ยท 5 comments

commented

I don't know, I have a lot of mods, I just click on the attributes button and the game just crashes. Maybe it's an incompatibility. If it is, and you can't solve it, I'll make a point of removing each mod to check.

crashlog: https://bytebin.lucko.me/31A5LxD95u

commented

You aren't using the latest version for 1.20.1, you are using 1.3.5. The latest version for 1.20.1 is 1.3.7.

commented

Any suggestions as to what kind of mod might be causing this incompatibility? I remember that the mod didn't crash before I added some and updated others (the problem is that I forgot about the existence of this button while I was concentrating on adding other mods).

commented
commented

That's... interesting, to say the least. The code that is crashing is

int maxWidth = lines.stream().map(this.font::width).max(Integer::compareTo).get();

Which, in context, is

Component txt = Component.translatable(inst.getAttribute().getDescriptionId());
int splitWidth = 60;
List<FormattedCharSequence> lines = this.font.split(txt, splitWidth);
// We can only actually display two lines here, but we need to forcibly create two lines and then scale down.
while (lines.size() > 2) {
splitWidth += 10;
lines = this.font.split(txt, splitWidth);
}
PoseStack stack = gfx.pose();
stack.pushPose();
float scale = 1;
int maxWidth = lines.stream().map(this.font::width).max(Integer::compareTo).get();

I'm not sure what would cause the stream to be empty here - perhaps someone mapping their inst.getAttribute().getDescriptionId() to "" (an empty string)? I don't think I would consider that valid behavior, tbh.

commented

I'd recommend sorting your modlist by "most recent" and working from there.