fix hud sorting
All checks were successful
/ Build BaseBand (push) Successful in 2m34s

This commit is contained in:
Daniella / Tove 2024-10-06 05:19:37 +02:00
parent 03a3716f6d
commit d17dec15b2
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -249,7 +249,7 @@ public class HUD extends Feature {
} }
int maxWidth = TextSplitter.getStringWidth(initString); int maxWidth = TextSplitter.getStringWidth(initString);
Feature[] renderFeatures = Arrays.stream(Features.features).filter(m -> m.enabled && m.category.mayDisplay && m.displayOnHUD()).sorted(Comparator.comparingDouble(value -> -Minecraft.getMinecraft().fontRenderer.getStringWidth(includeStatus ? value.text : value.toString()))).toArray(Feature[]::new); Feature[] renderFeatures = Arrays.stream(Features.features).filter(m -> m.enabled && m.category.mayDisplay && m.displayOnHUD()).sorted(Comparator.comparingDouble(value -> -Minecraft.getMinecraft().fontRenderer.getStringWidth((includeStatus ? value.text : value.getHUDText())))).toArray(Feature[]::new);
for (Feature f : renderFeatures) { for (Feature f : renderFeatures) {
maxWidth = Math.max(mc.fontRenderer.getStringWidth(f.getHUDText()), maxWidth); maxWidth = Math.max(mc.fontRenderer.getStringWidth(f.getHUDText()), maxWidth);
} }