Some bug fixes

This commit is contained in:
IM23a-spirgif
2025-04-26 13:07:05 +02:00
parent 39078cc8cf
commit df9bf5f568
4 changed files with 54 additions and 63 deletions
@@ -14,15 +14,12 @@ public class KnockedTimeOverlay {
@SubscribeEvent
public static void onRenderOverlay(RenderGuiOverlayEvent.Post event) {
if (!ClientKnockedState.isKnocked()) return;
Minecraft mc = Minecraft.getInstance();
GuiGraphics guiGraphics = event.getGuiGraphics();
String text = "Time until recovery: " + (ClientKnockedState.getTimeLeft() / 20) + " s";
int screenWidth = mc.getWindow().getGuiScaledWidth();
int x = screenWidth / 2 - mc.font.width(text) / 2;
int y = 10; // 10 pixels from the top
int y = 10;
guiGraphics.drawString(mc.font, text, x, y, 0xFFFFFF, true);
}
}