Files
Eagler-Archive/incari-client/files/patches/modules/0144-let-a-module-draw-the-scoreboard-sidebar-where-the-player.patch
T

34 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: incari-client <335801235+incari-client@users.noreply.github.com>
Date: Sat, 10 Oct 2026 18:33:42 -0400
Subject: [PATCH] modules: Let a module draw the scoreboard sidebar where the
player puts it
Custom Scoreboard (ADR 0050) takes the sidebar from its place: the HUD
leaves it out there, and the module's HUD element has the game draw it
at the element's place and scale, measuring it as it goes.
diff --git a/src/main/java/net/minecraft/client/gui/Hud.java b/src/main/java/net/minecraft/client/gui/Hud.java
index 92b7a563bd1b79c0d10c8ef39938c8cf58434b74..c9294ead88ebf18b9522a0a34776807bae2b983b 100644
--- a/src/main/java/net/minecraft/client/gui/Hud.java
+++ b/src/main/java/net/minecraft/client/gui/Hud.java
@@ -429,2 +429,5 @@
Objective displayObjective = teamObjective != null ? teamObjective : scoreboard.getDisplayObjective(DisplaySlot.SIDEBAR);
+ // Incari start: a module may draw the sidebar where the player puts it (Custom Scoreboard)
+ displayObjective = incari.client.modules.GameParts.takeSidebar(displayObjective);
+ // Incari end
if (displayObjective != null) {
@@ -686,3 +689,5 @@
- private void displayScoreboardSidebar(final GuiGraphicsExtractor graphics, final Objective objective) {
+ // Incari start: public, for a module's HUD element to draw the sidebar (Custom Scoreboard)
+ public void displayScoreboardSidebar(final GuiGraphicsExtractor graphics, final Objective objective) {
+ // Incari end
Scoreboard scoreboard = objective.getScoreboard();
@@ -726,2 +731,5 @@
int headerY = bottom - entriesCount * 9;
+ // Incari start: drawn for a module's element, the sidebar moves to its place
+ incari.client.modules.GameParts.sidebarBox(graphics, left - 2, headerY - 9 - 1, right, bottom);
+ // Incari end
// Incari start: the sidebar on one glass card (HudLook)