From 9b3e8805820cd59c4d9c5c433f884bfc2e24e107 Mon Sep 17 00:00:00 2001 From: PotatoOfPotato <289999293+PotatoOfPotato@users.noreply.github.com> Date: Sat, 15 Aug 2026 10:57:32 +0800 Subject: [PATCH 1/4] add config for vertical mini potion hud --- .../fr/alexdoru/mwe/config/MWEConfig.java | 7 +++++++ .../alexdoru/mwe/gui/huds/MiniPotionHUD.java | 21 +++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/alexdoru/mwe/config/MWEConfig.java b/src/main/java/fr/alexdoru/mwe/config/MWEConfig.java index b827cd95..75debc72 100644 --- a/src/main/java/fr/alexdoru/mwe/config/MWEConfig.java +++ b/src/main/java/fr/alexdoru/mwe/config/MWEConfig.java @@ -434,6 +434,13 @@ private static void onChatHeadsSetting() { + " §dregeneration§7, §8resistance§7, §bspeed§7, §cstrength§7, §finvisibility§7, §ajump boost§7, §eabsorption§7") public static final RendererPosition miniPotionHUDPosition = new RendererPosition(false, 0.5d, 7.5d / 20d); + @ConfigProperty( + category = PVP_STUFF, subCategory = "Potion HUD", + name = "Vertical Mini Potion HUD", + dependsOn = "Mini Potion HUD", + comment = "Displays the Mini Potion HUD vertically") + public static boolean verticalMiniPotionHUD; + @ConfigProperty( category = PVP_STUFF, subCategory = "Potion HUD", name = "Mini Potion HUD only in MW", diff --git a/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java b/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java index 2ef31d5d..12e99097 100644 --- a/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java +++ b/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java @@ -62,10 +62,23 @@ public void render(ScaledResolution resolution) { count++; } len -= 2; - int x = this.rendererPosition.getAbsoluteRenderX() - len / 2; - for (int i = 0; i < count; i++) { - mc.fontRendererObj.drawStringWithShadow(strings[i], x, this.rendererPosition.getAbsoluteRenderY(), colors[i]); - x += mc.fontRendererObj.getStringWidth(strings[i]) + 2; + if (MWEConfig.verticalMiniPotionHUD) { + int x = this.rendererPosition.getAbsoluteRenderX(); + int y = this.rendererPosition.getAbsoluteRenderY(); + final int maxY = resolution.getScaledHeight() - count * mc.fontRendererObj.FONT_HEIGHT; + if (y > maxY) { + y = maxY; + } + for (int i = 0; i < count; i++) { + mc.fontRendererObj.drawStringWithShadow(strings[i], x - mc.fontRendererObj.getStringWidth(strings[i]) / 2, y, colors[i]); + y += mc.fontRendererObj.FONT_HEIGHT; + } + } else { + int x = this.rendererPosition.getAbsoluteRenderX() - len / 2; + for (int i = 0; i < count; i++) { + mc.fontRendererObj.drawStringWithShadow(strings[i], x, this.rendererPosition.getAbsoluteRenderY(), colors[i]); + x += mc.fontRendererObj.getStringWidth(strings[i]) + 2; + } } } From a9eed17cbd2ed30e76138c07e7b463700099d767 Mon Sep 17 00:00:00 2001 From: PotatoOfPotato <289999293+PotatoOfPotato@users.noreply.github.com> Date: Sat, 15 Aug 2026 11:16:30 +0800 Subject: [PATCH 2/4] change fake player count color in tab to match the red star --- .../asm/hooks/mc/gui/GuiPlayerTabOverlayHook_PlayerCount.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/fr/alexdoru/mwe/asm/hooks/mc/gui/GuiPlayerTabOverlayHook_PlayerCount.java b/src/main/java/fr/alexdoru/mwe/asm/hooks/mc/gui/GuiPlayerTabOverlayHook_PlayerCount.java index 5bace046..dfbf68e8 100644 --- a/src/main/java/fr/alexdoru/mwe/asm/hooks/mc/gui/GuiPlayerTabOverlayHook_PlayerCount.java +++ b/src/main/java/fr/alexdoru/mwe/asm/hooks/mc/gui/GuiPlayerTabOverlayHook_PlayerCount.java @@ -32,7 +32,7 @@ public static List addPlayerCountInHeader(@NotNull List listIn) nicks++; } } - list.add(GREEN + "Players: " + GOLD + i + (nicks == 0 ? "" : WHITE + " (" + GOLD + nicks + WHITE + ")")); + list.add(GREEN + "Players: " + GOLD + i + (nicks == 0 ? "" : WHITE + " (" + DARK_RED + nicks + WHITE + ")")); } else { list.add(GREEN + "Players: " + GOLD + i); } From dd234cacefeffe93ce9688639ad8add6107c4d7a Mon Sep 17 00:00:00 2001 From: PotatoOfPotato <289999293+PotatoOfPotato@users.noreply.github.com> Date: Sat, 15 Aug 2026 19:24:02 +0800 Subject: [PATCH 3/4] details --- src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java b/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java index 12e99097..e4548703 100644 --- a/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java +++ b/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java @@ -65,13 +65,13 @@ public void render(ScaledResolution resolution) { if (MWEConfig.verticalMiniPotionHUD) { int x = this.rendererPosition.getAbsoluteRenderX(); int y = this.rendererPosition.getAbsoluteRenderY(); - final int maxY = resolution.getScaledHeight() - count * mc.fontRendererObj.FONT_HEIGHT; + final int maxY = resolution.getScaledHeight() - count * (mc.fontRendererObj.FONT_HEIGHT + 2); if (y > maxY) { y = maxY; } for (int i = 0; i < count; i++) { mc.fontRendererObj.drawStringWithShadow(strings[i], x - mc.fontRendererObj.getStringWidth(strings[i]) / 2, y, colors[i]); - y += mc.fontRendererObj.FONT_HEIGHT; + y += mc.fontRendererObj.FONT_HEIGHT + 2; } } else { int x = this.rendererPosition.getAbsoluteRenderX() - len / 2; From 6a81a5e034874e045f86b4d63ec1e9a2654be457 Mon Sep 17 00:00:00 2001 From: Alexdoru <57050655+Alexdoru@users.noreply.github.com> Date: Sun, 30 Aug 2026 12:11:31 +0200 Subject: [PATCH 4/4] fix --- src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java b/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java index e4548703..e754e283 100644 --- a/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java +++ b/src/main/java/fr/alexdoru/mwe/gui/huds/MiniPotionHUD.java @@ -61,22 +61,24 @@ public void render(ScaledResolution resolution) { len += mc.fontRendererObj.getStringWidth(strings[count]) + 2; count++; } + if (count == 0) return; len -= 2; if (MWEConfig.verticalMiniPotionHUD) { - int x = this.rendererPosition.getAbsoluteRenderX(); + final int x = this.rendererPosition.getAbsoluteRenderX(); int y = this.rendererPosition.getAbsoluteRenderY(); final int maxY = resolution.getScaledHeight() - count * (mc.fontRendererObj.FONT_HEIGHT + 2); if (y > maxY) { y = maxY; } for (int i = 0; i < count; i++) { - mc.fontRendererObj.drawStringWithShadow(strings[i], x - mc.fontRendererObj.getStringWidth(strings[i]) / 2, y, colors[i]); + mc.fontRendererObj.drawStringWithShadow(strings[i], x - mc.fontRendererObj.getStringWidth(strings[i]) / 2F, y, colors[i]); y += mc.fontRendererObj.FONT_HEIGHT + 2; } } else { int x = this.rendererPosition.getAbsoluteRenderX() - len / 2; + final int y = this.rendererPosition.getAbsoluteRenderY(); for (int i = 0; i < count; i++) { - mc.fontRendererObj.drawStringWithShadow(strings[i], x, this.rendererPosition.getAbsoluteRenderY(), colors[i]); + mc.fontRendererObj.drawStringWithShadow(strings[i], x, y, colors[i]); x += mc.fontRendererObj.getStringWidth(strings[i]) + 2; } }