Reduce decompile API blockers
Some checks failed
Build / build (push) Failing after 6m48s

This commit is contained in:
MrSphay
2026-05-04 13:33:41 +02:00
parent e41adca82b
commit 93c8d5efae
40 changed files with 472 additions and 1083 deletions

View File

@@ -29,36 +29,36 @@ public class ScanLoadInfoHUD {
if (!isVisible) {
return;
}
Minecraft mc = Minecraft.m_91087_();
if (mc.f_91074_ == null) {
Minecraft mc = Minecraft.getInstance();
if (mc.player == null) {
return;
}
if (!mc.f_91074_.m_20310_(2) && !mc.m_91091_()) {
if (!mc.player.m_20310_(2) && !mc.hasSingleplayerServer()) {
return;
}
GuiGraphics guiGraphics = event.getGuiGraphics();
String[] infoLines = new String[]{"\u00a76\u00a7lExisting Scan Data Found", "", "\u00a7eThis world has previously scanned block data.", "\u00a7eYou have two options:", "", "\u00a7a\u00a7l[" + ModKeyMappings.ACCEPT_SCAN.m_90863_().getString() + "] Load Data \u00a7r\u00a77- Load existing scan results", "\u00a77\u2022 Instant setup - no waiting time", "\u00a77\u2022 Uses previously found block positions", "\u00a77\u2022 May miss blocks placed after last scan", "\u00a77\u2022 Recommended for established worlds", "", "\u00a7c\u00a7l[" + ModKeyMappings.DECLINE_SCAN.m_90863_().getString() + "] New Scan \u00a7r\u00a77- Perform fresh scan", "\u00a77\u2022 Scans all chunks for current blocks", "\u00a77\u2022 Takes time but finds all blocks", "\u00a77\u2022 Replaces old data with new results", "\u00a77\u2022 Recommended if world changed significantly", "", "\u00a7eNote: \u00a77Block changes are tracked automatically", "\u00a77after loading, so both options work well for", "\u00a77ongoing gameplay.", "", "\u00a7cPress [" + ModKeyMappings.INFO_SCAN.m_90863_().getString() + "] again to close this info"};
String[] infoLines = new String[]{"\u00a76\u00a7lExisting Scan Data Found", "", "\u00a7eThis world has previously scanned block data.", "\u00a7eYou have two options:", "", "\u00a7a\u00a7l[" + ModKeyMappings.ACCEPT_SCAN.getTranslatedKeyMessage().getString() + "] Load Data \u00a7r\u00a77- Load existing scan results", "\u00a77\u2022 Instant setup - no waiting time", "\u00a77\u2022 Uses previously found block positions", "\u00a77\u2022 May miss blocks placed after last scan", "\u00a77\u2022 Recommended for established worlds", "", "\u00a7c\u00a7l[" + ModKeyMappings.DECLINE_SCAN.getTranslatedKeyMessage().getString() + "] New Scan \u00a7r\u00a77- Perform fresh scan", "\u00a77\u2022 Scans all chunks for current blocks", "\u00a77\u2022 Takes time but finds all blocks", "\u00a77\u2022 Replaces old data with new results", "\u00a77\u2022 Recommended if world changed significantly", "", "\u00a7eNote: \u00a77Block changes are tracked automatically", "\u00a77after loading, so both options work well for", "\u00a77ongoing gameplay.", "", "\u00a7cPress [" + ModKeyMappings.INFO_SCAN.getTranslatedKeyMessage().getString() + "] again to close this info"};
int maxWidth = 0;
for (String line : infoLines) {
int lineWidth = mc.f_91062_.m_92895_(line);
int lineWidth = mc.font.width(line);
if (lineWidth <= maxWidth) continue;
maxWidth = lineWidth;
}
int windowWidth = maxWidth + 20;
int windowHeight = infoLines.length * 12 + 20;
int screenWidth = mc.m_91268_().m_85445_();
int screenHeight = mc.m_91268_().m_85446_();
int screenWidth = mc.getWindow().getGuiScaledWidth();
int screenHeight = mc.getWindow().getGuiScaledHeight();
int x = (screenWidth - windowWidth) / 2;
int y = (screenHeight - windowHeight) / 2;
guiGraphics.m_280509_(x - 5, y - 5, x + windowWidth, y + windowHeight, -536870912);
guiGraphics.m_280509_(x - 6, y - 6, x + windowWidth + 1, y - 5, -12303292);
guiGraphics.m_280509_(x - 6, y + windowHeight, x + windowWidth + 1, y + windowHeight + 1, -12303292);
guiGraphics.m_280509_(x - 6, y - 5, x - 5, y + windowHeight, -12303292);
guiGraphics.m_280509_(x + windowWidth, y - 5, x + windowWidth + 1, y + windowHeight, -12303292);
guiGraphics.fill(x - 5, y - 5, x + windowWidth, y + windowHeight, -536870912);
guiGraphics.fill(x - 6, y - 6, x + windowWidth + 1, y - 5, -12303292);
guiGraphics.fill(x - 6, y + windowHeight, x + windowWidth + 1, y + windowHeight + 1, -12303292);
guiGraphics.fill(x - 6, y - 5, x - 5, y + windowHeight, -12303292);
guiGraphics.fill(x + windowWidth, y - 5, x + windowWidth + 1, y + windowHeight, -12303292);
for (int i = 0; i < infoLines.length; ++i) {
String line = infoLines[i];
if (line.isEmpty()) continue;
guiGraphics.m_280488_(mc.f_91062_, line, x + 10, y + 10 + i * 12, 0xFFFFFF);
guiGraphics.drawString(mc.font, line, x + 10, y + 10 + i * 12, 0xFFFFFF);
}
}
}