infobox manager: fix adding multiple infoboxes of same priority

The sort only checks infobox priority and plugin name, and is not a
uniqeness check, so we still need to insert the infobox regardless of if
it is "found" or not.
This commit is contained in:
Adam
2020-05-28 00:13:32 -04:00
parent 1bcb25f10b
commit 406c2bc7db

View File

@@ -76,10 +76,7 @@ public class InfoBoxManager
.compare(b1.getPriority(), b2.getPriority())
.compare(b1.getPlugin().getName(), b2.getPlugin().getName())
.result());
if (idx < 0)
{
infoBoxes.add(-idx - 1, infoBox);
}
infoBoxes.add(idx < 0 ? -idx - 1 : idx, infoBox);
}
BufferedImage image = infoBox.getImage();