Skip to content

Commit

Permalink
Fix #104: Crash from Tesseract while scrolling a list in Minecolonies (
Browse files Browse the repository at this point in the history
  • Loading branch information
Swedz authored Feb 2, 2025
1 parent 9be5e89 commit c03b851
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,9 @@ public MutableComponent getText()
return isTextEmpty() ? null : text.get(0);
}

@SuppressWarnings({"unchecked", "rawtypes"})
public void setTextOld(final List<Component> text)
{
setText((List<MutableComponent>)((List) text));
setText(text.stream().map(c -> c instanceof MutableComponent m ? m : c.copy()).toList());
}

public void setText(final List<MutableComponent> text)
Expand All @@ -506,7 +505,7 @@ public void setText(final List<MutableComponent> text)

public void setText(final Component text)
{
setText((MutableComponent) text);
setText(text instanceof MutableComponent m ? m : text.copy());
}

public void setText(final MutableComponent text)
Expand Down

0 comments on commit c03b851

Please sign in to comment.