diff --git a/common/src/main/java/io/github/axolotlclient/bridge/AxoMinecraftClient.java b/common/src/main/java/io/github/axolotlclient/bridge/AxoMinecraftClient.java index 6758af5d2..b1b51d44b 100644 --- a/common/src/main/java/io/github/axolotlclient/bridge/AxoMinecraftClient.java +++ b/common/src/main/java/io/github/axolotlclient/bridge/AxoMinecraftClient.java @@ -161,4 +161,19 @@ static int getCurrentFps() { default List br$getSidebar() { throw BridgeUtil.noImpl(); } + + @RequiresImpl + default String br$getChunkDebugInfo() { + throw BridgeUtil.noImpl(); + } + + @RequiresImpl + default String br$getEntityDebugInfo() { + throw BridgeUtil.noImpl(); + } + + @RequiresImpl + default String br$getParticleDebugInfo() { + throw BridgeUtil.noImpl(); + } } diff --git a/common/src/main/java/io/github/axolotlclient/bridge/PlatformDispatch.java b/common/src/main/java/io/github/axolotlclient/bridge/PlatformDispatch.java index de46a7cf8..4e1c6de41 100644 --- a/common/src/main/java/io/github/axolotlclient/bridge/PlatformDispatch.java +++ b/common/src/main/java/io/github/axolotlclient/bridge/PlatformDispatch.java @@ -26,7 +26,6 @@ import io.github.axolotlclient.bridge.internal.BridgeUtil; import io.github.axolotlclient.bridge.internal.RequiresImpl; -import io.github.axolotlclient.bridge.render.AxoSprite; import org.apache.commons.lang3.mutable.MutableInt; /** @@ -41,11 +40,6 @@ public class PlatformDispatch { throw BridgeUtil.noImpl(); } - @RequiresImpl - public static AxoSprite.Dynamic ipHud$getServerIcon() { - throw BridgeUtil.noImpl(); - } - @RequiresImpl public static void autoBoop$openFiltersScreen(List filters) { throw BridgeUtil.noImpl(); diff --git a/common/src/main/java/io/github/axolotlclient/modules/hud/HudManagerCommon.java b/common/src/main/java/io/github/axolotlclient/modules/hud/HudManagerCommon.java index 27b28c2b6..df93cd5e5 100644 --- a/common/src/main/java/io/github/axolotlclient/modules/hud/HudManagerCommon.java +++ b/common/src/main/java/io/github/axolotlclient/modules/hud/HudManagerCommon.java @@ -52,7 +52,6 @@ import io.github.axolotlclient.modules.hud.gui.hud.*; import io.github.axolotlclient.modules.hud.gui.hud.item.ArmorHud; import io.github.axolotlclient.modules.hud.gui.hud.item.ArrowHud; -import io.github.axolotlclient.modules.hud.gui.hud.item.ItemUpdateHud; import io.github.axolotlclient.modules.hud.gui.hud.simple.*; import io.github.axolotlclient.modules.hud.gui.hud.item.InventoryHud; import io.github.axolotlclient.modules.hud.gui.hud.vanilla.PlayerTabOverlayHud; @@ -113,12 +112,9 @@ public void init() { add(new ArmorHud()); add(new PotionsHud()); add(new ToggleSprintHud()); - add(new IPHud()); - add(new IconHud()); add(new SpeedHud()); add(new CoordsHud()); add(new ArrowHud()); - add(new ItemUpdateHud()); add(new IRLTimeHud()); add(new ReachHud()); add(new MemoryHud()); @@ -126,10 +122,7 @@ public void init() { add(new CompassHud()); add(new TPSHud()); add(new ComboHud()); - add(new MouseMovementHud()); - add(new DayCounterHud()); add(new InventoryHud()); - add(new XPHud()); add(new PlayerTabOverlayHud()); add(new SubtitlesHudHud()); diff --git a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/CoordsHud.java b/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/CoordsHud.java index 1b0740bf8..f2d7e2090 100644 --- a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/CoordsHud.java +++ b/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/CoordsHud.java @@ -1,7 +1,8 @@ /* * Copyright © 2024 moehreag & Contributors + * Copyright © 2026 DSNS * - * This file is part of AxolotlClient. + * This file is part of DolphinClient, a fork of AxolotlClient. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -68,6 +69,9 @@ public class CoordsHud extends TextHudEntry { private final StringOption separator = new StringOption("coordshud.separator", ", "); private final ColorOption separatorColor = new ColorOption("coordshud.separator.color", firstColor.getDefault()); private final BooleanOption showNetherConversions = new BooleanOption("coordshud.show_nether_conversions", false); + private final BooleanOption showCCount = new BooleanOption("debugcounters.ccount", false); + private final BooleanOption showECount = new BooleanOption("debugcounters.ecount", false); + private final BooleanOption showPCount = new BooleanOption("debugcounters.pcount", false); private DecimalFormat format = new DecimalFormat("0"); @@ -137,7 +141,7 @@ public static String getZDir(int dir) { }; } - private void doRender(AxoRenderContext context, double yaw, Vec3 playerPos, String biomeName, boolean isOverworld, boolean isNether) { + private void doRender(AxoRenderContext context, double yaw, Vec3 playerPos, String biomeName, boolean isOverworld, boolean isNether, String chunkDebug, String entityDebug, String particleDebug) { DrawPosition pos = getContentPos(); int dir = getDirection(yaw); @@ -233,6 +237,13 @@ private void doRender(AxoRenderContext context, double yaw, Vec3 playerPos, Stri height += 10; } + int[] size = {width, height}; + appendDebugLine(context, xStart, pos, size, chunkDebug); + appendDebugLine(context, xStart, pos, size, entityDebug); + appendDebugLine(context, xStart, pos, size, particleDebug); + width = size[0]; + height = size[1]; + boolean changed = false; if (getContentWidth() != width) { @@ -256,7 +267,19 @@ public void renderComponent(AxoRenderContext context, float delta) { return; } - doRender(context, client.br$getPlayer().br$getYaw() + 180, client.br$getPlayer().br$getPos(), client.br$getWorld().br$getBiomeName(client.br$getPlayer().br$getPos()), client.br$getWorld().br$isOverworld(), client.br$getWorld().br$isNether()); + doRender(context, client.br$getPlayer().br$getYaw() + 180, client.br$getPlayer().br$getPos(), client.br$getWorld().br$getBiomeName(client.br$getPlayer().br$getPos()), client.br$getWorld().br$isOverworld(), client.br$getWorld().br$isNether(), + showCCount.get() ? client.br$getChunkDebugInfo() : null, + showECount.get() ? client.br$getEntityDebugInfo() : null, + showPCount.get() ? client.br$getParticleDebugInfo() : null); + } + + private void appendDebugLine(AxoRenderContext context, int xStart, DrawPosition pos, int[] size, String line) { + if (line == null || line.isEmpty()) { + return; + } + int xEnd = context.br$drawString(line, xStart, pos.y() + size[1], secondColor.get(), shadow.get()); + size[0] = Math.max(size[0], xEnd - pos.x() + 1); + size[1] += 10; } public String getWordedDirection(int dir) { @@ -276,7 +299,10 @@ public String getWordedDirection(int dir) { @Override public void renderPlaceholderComponent(AxoRenderContext context, float delta) { - doRender(context, 180, new Vec3(109.2325, 180.8981, -5098.32698), "Plains", true, false); + doRender(context, 180, new Vec3(109.2325, 180.8981, -5098.32698), "Plains", true, false, + showCCount.get() ? "C: 186/15000 (s) D: 10, pC: 000, pU: 00, aB: 20" : null, + showECount.get() ? "E: 695/3001, SD: 12" : null, + showPCount.get() ? "P: 200" : null); } @Override @@ -289,6 +315,9 @@ public List> getConfigurationOptions() { options.add(minimal); options.add(biome); options.add(showNetherConversions); + options.add(showCCount); + options.add(showECount); + options.add(showPCount); options.add(delimiter); options.add(separator); options.add(separatorColor); diff --git a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/IPHud.java b/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/IPHud.java deleted file mode 100644 index 6bab46541..000000000 --- a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/IPHud.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright © 2024 moehreag & Contributors - * - * This file is part of AxolotlClient. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * For more information, see the LICENSE file. - */ - -package io.github.axolotlclient.modules.hud.gui.hud; - -import java.util.List; - -import io.github.axolotlclient.AxolotlClientConfig.api.options.Option; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.BooleanOption; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.IntegerOption; -import io.github.axolotlclient.bridge.PlatformDispatch; -import io.github.axolotlclient.bridge.events.Events; -import io.github.axolotlclient.bridge.render.AxoRenderContext; -import io.github.axolotlclient.bridge.render.AxoSprite; -import io.github.axolotlclient.bridge.util.AxoIdentifier; -import io.github.axolotlclient.modules.hud.gui.entry.TextHudEntry; -import io.github.axolotlclient.modules.hud.util.DrawPosition; - -/** - * This implementation of Hud modules is based on KronHUD. - * Github Link. - * - *

License: GPL-3.0

- */ -public class IPHud extends TextHudEntry { - - public static final AxoIdentifier ID = AxoIdentifier.of("kronhud", "iphud"); - private final BooleanOption showIcon = new BooleanOption("iphud.show_icon", false); - private AxoSprite.Dynamic sprite; - private final IntegerOption height = new IntegerOption("hud.height", 13, 9, 64); - - public IPHud() { - super(115, 13, true); - - Events.DISCONNECT.register(() -> { - if (sprite != null) { - sprite.close(); - sprite = null; - } - }); - - Events.CONNECTION_PLAY_READY.register(info -> { - if (showIcon.get()) { - sprite = PlatformDispatch.ipHud$getServerIcon(); - } - }); - } - - @Override - public AxoIdentifier getId() { - return ID; - } - - public String getValue() { - if (client.br$isLocalServer() || client.br$getServerAddress() == null) { - return "Singleplayer"; - } - - return client.br$getServerAddress(); - } - - private void updateSize(AxoRenderContext graphics) { - int w = getContentWidth(); - int h = getContentHeight(); - int hNew = height.get(); - boolean updated = false; - if (h != hNew) { - setContentHeight(hNew); - updated = true; - } - int req = graphics.br$getFont().br$getWidth(getValue()) + 4; - if (showIcon.get() && sprite != null) { - req += getContentHeight() + 1; - } - if (w != req) { - setContentWidth(req); - updated = true; - } - if (updated) { - onBoundsUpdate(); - } - } - - @Override - public List> getConfigurationOptions() { - var options = super.getConfigurationOptions(); - options.add(showIcon); - options.add(height); - return options; - } - - @Override - public void renderComponent(AxoRenderContext graphics, float delta) { - updateSize(graphics); - DrawPosition pos = getContentPos(); - int textX = pos.x() + getContentWidth() / 2; - - if (showIcon.get() && sprite != null) { - int imageSize = getContentHeight() - 2; - textX += imageSize / 2; - graphics.br$drawTexture(sprite, pos.x() + 1, pos.y() + 1, imageSize, imageSize); - } - - graphics.br$drawCenteredString(getValue(), textX, pos.y() + getContentHeight() / 2 - client.br$getFont().br$getFontHeight() / 2, textColor.get().toInt(), true); - } - - @Override - public void renderPlaceholderComponent(AxoRenderContext graphics, float delta) { - renderComponent(graphics, delta); - } -} diff --git a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/IconHud.java b/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/IconHud.java deleted file mode 100644 index aa41f8a78..000000000 --- a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/IconHud.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright © 2024 moehreag & Contributors - * Copyright © 2026 DSNS - * - * This file is part of DolphinClient, a fork of AxolotlClient. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * For more information, see the LICENSE file. - */ - -package io.github.axolotlclient.modules.hud.gui.hud; - -import java.util.List; -import java.util.Locale; - -import io.github.axolotlclient.DolphinClientCommon; -import io.github.axolotlclient.AxolotlClientConfig.api.options.Option; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.BooleanOption; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.EnumOption; -import io.github.axolotlclient.bridge.render.AxoRenderContext; -import io.github.axolotlclient.bridge.render.AxoSprites; -import io.github.axolotlclient.bridge.util.AxoIdentifier; -import io.github.axolotlclient.modules.hud.gui.component.DynamicallyPositionable; -import io.github.axolotlclient.modules.hud.gui.entry.BoxHudEntry; -import io.github.axolotlclient.modules.hud.gui.layout.AnchorPoint; -import io.github.axolotlclient.modules.hud.util.DefaultOptions; - -public class IconHud extends BoxHudEntry implements DynamicallyPositionable { - public static final AxoIdentifier ID = AxoIdentifier.of(DolphinClientCommon.MODID, "iconhud"); - private final EnumOption anchor = DefaultOptions.getAnchorPoint(this); - private final EnumOption mode = new EnumOption<>("iconhud.mode", Mode.class, Mode.BOTH); - - public IconHud() { - super(16, 16, true); - background = new BooleanOption("background", false); - } - - @Override - public AxoIdentifier getId() { - return ID; - } - - @Override - public void render(AxoRenderContext ctx, float delta) { - if (client.br$getScreen() == null && mode.get().showsInGame()) { - super.render(ctx, delta); - } - } - - public void renderInGui(AxoRenderContext context, float delta) { - if (mode.get().showsInGui()) { - super.render(context, delta); - } - } - - @Override - public void renderComponent(AxoRenderContext ctx, float delta) { - ctx.br$pushMatrix(); - float scale = getScale(); - ctx.br$scaleMatrix(1 / scale, 1 / scale); - ctx.br$translateMatrix(getRawTrueContentX(), getRawTrueContentY()); - ctx.br$scaleMatrix(scale, scale); - ctx.br$drawTexture(AxoSprites.BADGE, 0, 0, 16, 16); - ctx.br$popMatrix(); - } - - @Override - public void renderPlaceholderComponent(AxoRenderContext ctx, float delta) { - renderComponent(ctx, delta); - } - - @Override - public List> getConfigurationOptions() { - var options = super.getConfigurationOptions(); - options.add(anchor); - options.add(mode); - return options; - } - - @Override - public AnchorPoint getAnchor() { - return anchor.get(); - } - - private enum Mode { - IN_GAME() { - @Override - public boolean showsInGui() { - return false; - } - }, - GUI() { - @Override - public boolean showsInGame() { - return false; - } - }, - BOTH; - - public boolean showsInGame() { - return true; - } - - public boolean showsInGui() { - return true; - } - - @Override - public String toString() { - return "iconhud.mode." + super.toString().toLowerCase(Locale.ROOT); - } - } -} diff --git a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/MouseMovementHud.java b/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/MouseMovementHud.java deleted file mode 100644 index 7d277aa7c..000000000 --- a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/MouseMovementHud.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright © 2025 moehreag & Contributors - * - * This file is part of AxolotlClient. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * For more information, see the LICENSE file. - */ - -package io.github.axolotlclient.modules.hud.gui.hud; - -import java.util.List; - -import io.github.axolotlclient.AxolotlClientConfig.api.options.Option; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.EnumOption; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.GraphicsOption; -import io.github.axolotlclient.bridge.Platform; -import io.github.axolotlclient.bridge.events.Events; -import io.github.axolotlclient.bridge.events.types.PlayerDirectionChangeEvent; -import io.github.axolotlclient.bridge.render.AxoRenderContext; -import io.github.axolotlclient.bridge.util.AxoIdentifier; -import io.github.axolotlclient.modules.hud.gui.component.DynamicallyPositionable; -import io.github.axolotlclient.modules.hud.gui.entry.BoxHudEntry; -import io.github.axolotlclient.modules.hud.gui.layout.AnchorPoint; -import io.github.axolotlclient.modules.hud.util.DefaultOptions; -import io.github.axolotlclient.util.MathUtil; - -public class MouseMovementHud extends BoxHudEntry implements DynamicallyPositionable { - - public static final AxoIdentifier ID = AxoIdentifier.of("kronhud", "mousemovementhud"); - - private final EnumOption anchor = DefaultOptions.getAnchorPoint(this); - private final GraphicsOption mouseMovementIndicatorInner = new GraphicsOption("mouseMovementIndicator", new int[][]{ - new int[]{0, 0, 0, 0, 0, 0, 0}, - new int[]{0, 0, 0, 0, 0, 0, 0}, - new int[]{0, 0, 0, 0, 0, 0, 0}, - new int[]{0, 0, 0, -1, 0, 0, 0}, - new int[]{0, 0, 0, 0, 0, 0, 0}, - new int[]{0, 0, 0, 0, 0, 0, 0}, - new int[]{0, 0, 0, 0, 0, 0, 0} - }); - private final GraphicsOption mouseMovementIndicatorOuter = new GraphicsOption("mouseMovementIndicatorOuter", new int[][]{ - new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}, - new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, - new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, - new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, - new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, - new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, - new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, - new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, - new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, - new int[]{-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}, - new int[]{-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1} - }); - - private float mouseX = 0; - private float mouseY = 0; - private float lastMouseX = 0; - private float lastMouseY = 0; - - public MouseMovementHud() { - super(53, 35, true); - Events.PLAYER_DIRECTION_CHANGE.register(this::onPlayerDirectionChange); - } - - public void onPlayerDirectionChange(PlayerDirectionChangeEvent event) { - // Implementation credit goes to TheKodeToad - // This project has the author's approval to use this - // https://github.com/Sol-Client/Client/blob/main/game/src/main/java/io/github/solclient/client/mod/impl/hud/keystrokes/KeystrokesMod.java - mouseX += (event.yaw() - event.prevYaw()) / 7F; - mouseY += (event.pitch() - event.prevPitch()) / 7F; - // 0, 0 will be the center of the HUD element - float halfWidth = getContentWidth() / 2f; - var halfHeight = getContentHeight() / 2f; - mouseX = MathUtil.clamp(mouseX, -halfWidth + 2, halfWidth - 2); - mouseY = MathUtil.clamp(mouseY, -halfHeight + 2, halfHeight - 2); - } - - @Override - public void renderComponent(AxoRenderContext context, float delta) { - int spaceY = getContentY(); - int spaceX = getContentX(); - - float calculatedMouseX = (lastMouseX + ((mouseX - lastMouseX) * delta)) - 5; - float calculatedMouseY = (lastMouseY + ((mouseY - lastMouseY) * delta)) - 5; - - context.br$drawTexture(Platform.createTexture(mouseMovementIndicatorInner), spaceX + (getContentWidth() / 2) - 7 / 2 - 1, spaceY + getContentHeight() / 2 - (7 / 2), 7, 7); - // Woah KodeToad, good use of translate - context.br$translateMatrix(calculatedMouseX, calculatedMouseY); - context.br$drawTexture(Platform.createTexture(mouseMovementIndicatorOuter), spaceX + (getContentWidth() / 2) - 1, spaceY + getContentHeight() / 2, 11, 11); - } - - @Override - public void renderPlaceholderComponent(AxoRenderContext context, float delta) { - renderComponent(context, delta); - } - - @Override - public void tick() { - lastMouseX = mouseX; - lastMouseY = mouseY; - mouseX *= .75f; - mouseY *= .75f; - } - - @Override - public boolean tickable() { - return true; - } - - @Override - public AxoIdentifier getId() { - return ID; - } - - @Override - public List> getConfigurationOptions() { - List> options = super.getConfigurationOptions(); - options.add(anchor); - options.add(mouseMovementIndicatorInner); - options.add(mouseMovementIndicatorOuter); - return options; - } - - @Override - public AnchorPoint getAnchor() { - return anchor.get(); - } -} diff --git a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/item/ItemUpdateHud.java b/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/item/ItemUpdateHud.java deleted file mode 100644 index e9206c1ac..000000000 --- a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/item/ItemUpdateHud.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright © 2024 moehreag & Contributors - * - * This file is part of AxolotlClient. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * For more information, see the LICENSE file. - */ - -package io.github.axolotlclient.modules.hud.gui.hud.item; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.Supplier; - -import io.github.axolotlclient.AxolotlClientConfig.api.options.Option; -import io.github.axolotlclient.AxolotlClientConfig.api.util.Colors; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.BooleanOption; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.ColorOption; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.IntegerOption; -import io.github.axolotlclient.bridge.BridgeVersion; -import io.github.axolotlclient.bridge.item.AxoItemStack; -import io.github.axolotlclient.bridge.item.AxoItems; -import io.github.axolotlclient.bridge.render.AxoRenderContext; -import io.github.axolotlclient.bridge.util.AxoIdentifier; -import io.github.axolotlclient.bridge.util.AxoText; -import io.github.axolotlclient.modules.hud.gui.entry.TextHudEntry; -import io.github.axolotlclient.modules.hud.util.DefaultOptions; -import io.github.axolotlclient.modules.hud.util.DrawPosition; -import io.github.axolotlclient.util.ClientColors; -import io.github.axolotlclient.util.CommonUtil; -import io.github.axolotlclient.util.ItemUtil; - -/** - * This implementation of Hud modules is based on KronHUD. - * Github Link. - * - *

License: GPL-3.0

- */ -public class ItemUpdateHud extends TextHudEntry { - public static final AxoIdentifier ID = AxoIdentifier.of("kronhud", "itemupdatehud"); - - private static final Supplier> PLACEHOLDER_ADDED = CommonUtil.memoize(() -> List.of( - new ItemUtil.TimedItemStorage(AxoItemStack.of(AxoItems.DIAMOND, 2), 0) - )); - - private static final Supplier> PLACEHOLDER_REMOVED = CommonUtil.memoize(() -> List.of( - new ItemUtil.TimedItemStorage(AxoItemStack.of(AxoItems.EMERALD, 3), 0) - )); - - private final IntegerOption timeout = new IntegerOption("timeout", 6, 1, 60); - private final ColorOption bracketColor = new ColorOption("itemupdatehud.bracket_color", Colors.DARK_GRAY); - private final BooleanOption hideIfEmpty = DefaultOptions.getHideIfEmpty(); - private List oldItems = new ArrayList<>(); - private ArrayList removed; - private ArrayList added; - - public ItemUpdateHud() { - super(200, 11 * 6 - 2, true); - removed = new ArrayList<>(); - added = new ArrayList<>(); - } - - @Override - public boolean tickable() { - return true; - } - - @Override - public void tick() { - if (client.br$getWorld() != null) { - update(); - } - } - - public void update() { - this.removed = ItemUtil.removeOld(removed, timeout.get() * 1000); - this.added = ItemUtil.removeOld(added, timeout.get() * 1000); - updateAdded(); - updateRemoved(); - oldItems = ItemUtil.storageFromItem(ItemUtil.getItems(client)); - } - - private void updateAdded() { - ItemUtil.compare(ItemUtil.storageFromItem(ItemUtil.getItems(client)), oldItems).stream() - .map(ItemUtil.ItemStorage::timed) - .forEach(stack -> { - final var item = ItemUtil.getTimedItemFromItem(stack.stack, this.added); - if (item.isPresent()) { - item.get().incrementTimes(stack.times); - } else { - this.added.add(stack); - } - }); - - this.added.sort((o1, o2) -> Float.compare(o1.getPassedTime(), o2.getPassedTime())); - } - - private void updateRemoved() { - ItemUtil.compare(oldItems, ItemUtil.storageFromItem(ItemUtil.getItems(client))).stream() - .map(ItemUtil.ItemStorage::timed) - .forEach(stack -> { - final var item = ItemUtil.getTimedItemFromItem(stack.stack, this.removed); - if (item.isPresent()) { - item.get().incrementTimes(stack.times); - } else { - this.removed.add(stack); - } - }); - - this.removed.sort((o1, o2) -> Float.compare(o1.getPassedTime(), o2.getPassedTime())); - } - - private void renderInternal(AxoRenderContext context, List added, List removed) { - final AxoText openBracket = AxoText.literal("[").br$color(bracketColor.get().toInt()); - final AxoText closingBracket = AxoText.literal("]").br$color(bracketColor.get().toInt()); - final int deltaY = context.br$getFont().br$getFontHeight() + 2; - - DrawPosition pos = getContentPos(); - int lastY = 1; - int entryCount = 0; - - for (ItemUtil.ItemStorage item : added) { - if (entryCount > 5) { - return; - } - - AxoText message = AxoText.literal("+ ") - .br$append(openBracket) - .br$append(item.times) - .br$append(closingBracket) - .br$append(" ") - .br$append(item.stack.br$getHoverName()); - - context.br$drawString(message, pos.x, pos.y + lastY, ClientColors.SELECTOR_GREEN.toInt(), shadow.get()); - - lastY += deltaY; - entryCount++; - } - - for (ItemUtil.ItemStorage item : removed) { - if (entryCount > 5) { - return; - } - - AxoText message = AxoText.literal("- ") - .br$append(openBracket) - .br$append(item.times) - .br$append(closingBracket) - .br$append(" ") - .br$append(item.stack.br$getHoverName()); - - context.br$drawString(message, pos.x, pos.y + lastY, ClientColors.SELECTOR_RED.toInt(), shadow.get()); - - lastY += deltaY; - entryCount++; - } - } - - @Override - public void render(AxoRenderContext ctx, float delta) { - if (hideIfEmpty.get() && added.isEmpty() && removed.isEmpty()) { - return; - } - super.render(ctx, delta); - } - - @Override - public void renderComponent(AxoRenderContext context, float delta) { - renderInternal(context, added, removed); - } - - @Override - public void renderPlaceholderComponent(AxoRenderContext context, float delta) { - if (BridgeVersion.is26OrLater()) { - if (client.br$getWorld() == null) { - var pos = getContentPos(); - context.br$drawCenteredString(getName(), pos.x() + getContentWidth() / 2, pos.y() + getContentHeight() / 2, textColor.get()); - return; - } - } - renderInternal(context, PLACEHOLDER_ADDED.get(), PLACEHOLDER_REMOVED.get()); - } - - @Override - public List> getConfigurationOptions() { - List> options = super.getConfigurationOptions(); - options.add(hideIfEmpty); - options.add(timeout); - options.add(bracketColor); - return options; - } - - @Override - public AxoIdentifier getId() { - return ID; - } -} diff --git a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/DayCounterHud.java b/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/DayCounterHud.java deleted file mode 100644 index 310342384..000000000 --- a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/DayCounterHud.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright © 2025 moehreag & Contributors - * Copyright © 2026 DSNS - * - * This file is part of DolphinClient, a fork of AxolotlClient. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * For more information, see the LICENSE file. - */ - -package io.github.axolotlclient.modules.hud.gui.hud.simple; - -import io.github.axolotlclient.DolphinClientCommon; -import io.github.axolotlclient.bridge.util.AxoI18n; -import io.github.axolotlclient.bridge.util.AxoIdentifier; -import io.github.axolotlclient.modules.hud.gui.entry.SimpleTextHudEntry; - -public class DayCounterHud extends SimpleTextHudEntry { - - public static final AxoIdentifier ID = AxoIdentifier.of(DolphinClientCommon.MODID, "daycounterhud"); - - @Override - public String getPlaceholderValue() { - return AxoI18n.translate("daycounterhud.days", 35); - } - - @Override - public String getValue() { - if (client.br$getWorld() == null) { - return getPlaceholderValue(); - } - - return AxoI18n.translate("daycounterhud.days", client.br$getWorld().br$getTimeOfDay() / 24000); - } - - @Override - public AxoIdentifier getId() { - return ID; - } -} diff --git a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/XPHud.java b/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/XPHud.java deleted file mode 100644 index c865cdb1f..000000000 --- a/common/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/simple/XPHud.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright © 2026 moehreag & Contributors - * Copyright © 2026 DSNS - * - * This file is part of DolphinClient, a fork of AxolotlClient. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * For more information, see the LICENSE file. - */ - -package io.github.axolotlclient.modules.hud.gui.hud.simple; - -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; - -import io.github.axolotlclient.DolphinClientCommon; -import io.github.axolotlclient.AxolotlClientConfig.api.options.Option; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.BooleanOption; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.EnumOption; -import io.github.axolotlclient.bridge.AxoMinecraftClient; -import io.github.axolotlclient.bridge.render.AxoRenderContext; -import io.github.axolotlclient.bridge.util.AxoI18n; -import io.github.axolotlclient.bridge.util.AxoIdentifier; -import io.github.axolotlclient.modules.hud.gui.entry.TextHudEntry; -import io.github.axolotlclient.util.MathUtil; -import lombok.AllArgsConstructor; - -public class XPHud extends TextHudEntry { - - private static final AxoIdentifier ID = AxoIdentifier.of(DolphinClientCommon.MODID, "xphud"); - - private final EnumOption mode = new EnumOption<>("mode", Mode.class, Mode.LEVEL); - private final BooleanOption minimal = new BooleanOption("minimal", false); - private final List lines = new ArrayList<>(3); - - public XPHud() { - super(53, 13, true); - } - - @Override - public AxoIdentifier getId() { - return ID; - } - - private void renderInternal(AxoRenderContext ctx, int level, float percent) { - var mode = this.mode.get(); - lines.clear(); - if (minimal.get()) { - StringBuilder b = new StringBuilder(); - if (mode.level) { - b.append(AxoI18n.translate("xphud.level", level)); - } - if (mode.percent) { - if (b.isEmpty()) { - b.append(AxoI18n.translate("xphud.percent", "%.2f".formatted(percent * 100f) + "%")); - } else { - b.append(" / ").append("%.2f".formatted(percent * 100f)).append("%"); - } - } - if (mode.total) { - if (!b.isEmpty()) { - b.append(" "); - } - b.append(AxoI18n.translate("xphud.total", getTotalXp(level, percent))); - } - lines.add(b.toString()); - } else { - if (mode.level) { - lines.add(AxoI18n.translate("xphud.level", level)); - } - if (mode.percent) { - lines.add(AxoI18n.translate("xphud.percent", "%.2f".formatted(percent * 100f) + "%")); - } - if (mode.total) { - lines.add(AxoI18n.translate("xphud.total", getTotalXp(level, percent))); - } - } - - - var h = (ctx.br$getFont().br$getFontHeight() + 1) * lines.size() + 3; - var w = lines.stream().mapToInt(s -> ctx.br$getFont().br$getWidth(s) + 2).max().orElse(0) + 2; - - boolean updated = false; - if (w != getContentWidth()) { - setContentWidth(w); - updated = true; - } - if (h != getContentHeight()) { - setContentHeight(h); - updated = true; - } - if (updated) { - onBoundsUpdate(); - } - - var pos = getContentPos(); - var x = pos.x() + 2; - var y = pos.y() + 2; - for (var l : lines) { - ctx.br$drawString(l, x, y, textColor.get()); - y += ctx.br$getFont().br$getFontHeight() + 1; - } - } - - private int getTotalXp(int currentLevel, float percentToNext) { - int totalXp = 0; - for (int i = 0; i < currentLevel; i++) { - totalXp += getXpNeededForNextLevel(i); - } - totalXp += MathUtil.floor(getXpNeededForNextLevel(currentLevel) * percentToNext); - return totalXp; - } - - private int getXpNeededForNextLevel(int experienceLevel) { - if (experienceLevel >= 30) { - return 112 + (experienceLevel - 30) * 9; - } else { - return experienceLevel >= 15 ? 37 + (experienceLevel - 15) * 5 : 7 + experienceLevel * 2; - } - } - - @Override - public void renderComponent(AxoRenderContext ctx, float delta) { - var player = AxoMinecraftClient.getInstance().br$getPlayer(); - renderInternal(ctx, player.br$getExperienceLevel(), player.br$getExperienceProgress()); - } - - @Override - public void renderPlaceholderComponent(AxoRenderContext ctx, float delta) { - renderInternal(ctx, 45, .362f); - } - - @Override - public List> getConfigurationOptions() { - var options = super.getConfigurationOptions(); - options.add(mode); - options.add(minimal); - return options; - } - - @AllArgsConstructor - private enum Mode { - LEVEL(true, false, false), - PERCENT(false, true, false), - TOTAL(false, false, true), - LEVEL_PERCENT(true, true, false), - LEVEL_TOTAL(true, false, true), - PERCENT_TOTAL(false, true, true), - LEVEL_PERCENT_TOTAL(true, true, true); - - private final boolean level; - private final boolean percent; - private final boolean total; - - @Override - public String toString() { - return "xphud.mode." + super.toString().toLowerCase(Locale.ROOT); - } - } -} diff --git a/common/src/main/resources/assets/dolphinclient/lang/en_us.json b/common/src/main/resources/assets/dolphinclient/lang/en_us.json index f8197fc90..2de81ec4f 100644 --- a/common/src/main/resources/assets/dolphinclient/lang/en_us.json +++ b/common/src/main/resources/assets/dolphinclient/lang/en_us.json @@ -216,7 +216,6 @@ "hud.clientOptions": "Client Options", "hud.snapping": "Snapping", "hypixel-mods": "Hypixel", - "iconhud": "Icon", "iconsonly": "Icons Only", "imageSaved": "Saved!", "imageViewer": "Image Viewer", @@ -224,9 +223,7 @@ "inverse": "Inverse", "invert": "Invert", "invert_direction": "Invert Direction", - "iphud": "IP", "irltimehud": "Real Time", - "itemupdatehud": "Item Updates", "justification": "Justification", "key.freelook": "Free Look", "key.openHud": "Open Client Menu", @@ -266,9 +263,6 @@ "minwidth": "Minimum Width", "mode": "Mode", "motionBlur": "Motion Blur", - "mouseMovementIndicator": "Mouse Movement Indicator (static)", - "mouseMovementIndicatorOuter": "Mouse Movement Indicator (moving)", - "mousemovement": "Show Mouse Movement", "nametagBackground": "Name Tag Background", "nametagOptions": "Name Tags", "nickhider": "Nick Hider", @@ -310,7 +304,7 @@ "printGG": "Print GG", "printGLHF": "Print GLHF", "randomPlaceholder": "Random Placeholder", - "reachhud": "Reach", + "reachhud": "Reach Display", "refreshTime": "Refresh Delay", "removeVignette": "Remove Vignette", "rendering": "Rendering", @@ -484,13 +478,10 @@ "keystrokes.stroke.key": "Selected Key: %s (%s)", "keystrokes.stroke.label.synchronize_with_key": "Synchronize with Key Name: %s", "keystrokes.stroke.add.special": "Add Special Stroke", - "mousemovementhud": "Mouse Movement", - "iphud.show_icon": "Show Server Icon", "hud.height": "HUD Height", "coordshud.delimiter": "Delimiter", "coordshud.separator": "Separator (Minimal Mode)", "coordshud.separator.color": "Separator Color (Minimal Mode)", - "debugcountershud": "Debug Counters", "debugcounters.ccount": "Chunk Debug Info", "debugcounters.ecount": "Entity Debug Info", "debugcounters.pcount": "Particle Debug Info", @@ -498,8 +489,6 @@ "bedwars_resources": "Resources HUD", "levelhead.enabled.tooltip": "Level Head is currently unavailable.
It required DolphinClient's online features to fetch Hypixel levels.", "bedwars.enabled.tooltip": "Whether this module is enabled or not.
Some functions of this module require DolphinClient's online features
in order to communicate with the backend and the Hypixel API.", - "daycounterhud": "Day Counter", - "daycounterhud.days": "%s Days", "keystrokes.animation_time": "Animation Time (Milliseconds)", "autoboop.filters.configure": "Configure Filters", "autoboop.filterlist.configure": "Configure Filters", @@ -548,7 +537,6 @@ "playerstats.duels.uhc_duel": "UHC (Duel)", "playerstats.duels.uhc_four": "UHC (Fours)", "playerstats.duels.mode_title": "Stats in %s:", - "itemupdatehud.bracket_color": "Separator (Bracket) Color", "armorhud.durability_num_color": "Durability Number Color", "armorhud.custom_durability_num_color": "Custom Durability Number Color", "crosshairhud.custom_attack_indicator": "Custom Attack Indicator", @@ -623,10 +611,6 @@ "profiles.profile.import.notification.success.desc.more": "Imported %s profiles", "gallery.error.loading": "Failed to load Gallery", "gallery.reload": "Reload", - "iconhud.mode": "Icon Display Mode", - "iconhud.mode.in_game": "Only in-game", - "iconhud.mode.gui": "Only in GUIs", - "iconhud.mode.both": "In-game and in GUIs", "hud.hide": "Hide HUD", "hud.hide.tooltip": "Prevents this HUD from rendering completely.", "keystrokes.stroke.move": "Edit Keystroke Positions", @@ -684,17 +668,6 @@ "hud.hide_if_empty": "Hide If Empty", "togglesprint.hide_instead_of_placeholder": "Hide Instead of Placeholder", "pinghud.hide_in_singleplayer": "Hide in Singleplayer", - "xphud.level": "Level: %s", - "xphud.percent": "Next Level: %s", - "xphud.total": "Total: %s", - "xphud.mode.level": "Level", - "xphud.mode.percent": "Percentage to next Level", - "xphud.mode.total": "Total XP Points", - "xphud.mode.level_percent": "Level, Percentage to next Level", - "xphud.mode.level_total": "Level, Total XP Points", - "xphud.mode.percent_total": "Percentage to next Level, Total XP Points", - "xphud.mode.level_percent_total": "Level, Percentage to next Level, Total XP Points", - "xphud": "XP", "screenshot_utils.mode": "Display Mode", "screenshot_utils.mode.chat": "Chat", "screenshot_utils.mode.toast": "Toast", diff --git a/versions/1.8.9/src/main/java/io/github/axolotlclient/bridge/mixin/MinecraftClientMixin.java b/versions/1.8.9/src/main/java/io/github/axolotlclient/bridge/mixin/MinecraftClientMixin.java index f2a64916f..fececc95e 100644 --- a/versions/1.8.9/src/main/java/io/github/axolotlclient/bridge/mixin/MinecraftClientMixin.java +++ b/versions/1.8.9/src/main/java/io/github/axolotlclient/bridge/mixin/MinecraftClientMixin.java @@ -39,6 +39,7 @@ import io.github.axolotlclient.bridge.util.AxoText; import io.github.axolotlclient.bridge.world.AxoWorld; import net.minecraft.client.Minecraft; +import net.minecraft.client.ParticleManager; import net.minecraft.client.Session; import net.minecraft.client.entity.living.player.LocalClientPlayerEntity; import net.minecraft.client.gui.GameGui; @@ -93,6 +94,9 @@ public abstract class MinecraftClientMixin implements AxoMinecraftClient { @Shadow public WorldRenderer worldRenderer; + @Shadow + public ParticleManager particleManager; + @Shadow private Entity camera; @@ -244,4 +248,19 @@ public abstract class MinecraftClientMixin implements AxoMinecraftClient { return lines; } + + @Override + public String br$getChunkDebugInfo() { + return worldRenderer != null ? worldRenderer.getChunkDebugInfo() : ""; + } + + @Override + public String br$getEntityDebugInfo() { + return worldRenderer != null ? worldRenderer.getEntityDebugInfo() : ""; + } + + @Override + public String br$getParticleDebugInfo() { + return particleManager != null ? "P: " + particleManager.getDebugInfo() : ""; + } } diff --git a/versions/1.8.9/src/main/java/io/github/axolotlclient/bridge/mixin/PlatformDispatchMixin.java b/versions/1.8.9/src/main/java/io/github/axolotlclient/bridge/mixin/PlatformDispatchMixin.java index d20af4e4c..dae97d644 100644 --- a/versions/1.8.9/src/main/java/io/github/axolotlclient/bridge/mixin/PlatformDispatchMixin.java +++ b/versions/1.8.9/src/main/java/io/github/axolotlclient/bridge/mixin/PlatformDispatchMixin.java @@ -23,25 +23,16 @@ package io.github.axolotlclient.bridge.mixin; import java.net.InetAddress; -import java.util.Base64; import java.util.List; -import com.google.common.hash.Hashing; -import io.github.axolotlclient.AxolotlClientConfig.impl.util.GraphicsImpl; import io.github.axolotlclient.bridge.PlatformDispatch; -import io.github.axolotlclient.bridge.impl.AxoSpriteImpl; -import io.github.axolotlclient.bridge.render.AxoSprite; import io.github.axolotlclient.mixin.MinecraftClientAccessor; import io.github.axolotlclient.modules.hypixel.autoboop.FilterListConfigurationScreen; import io.github.axolotlclient.modules.hypixel.bedwars.SessionStatsHudEntryConfigScreen; -import io.github.axolotlclient.util.ClientColors; import io.github.axolotlclient.util.ThreadExecuter; -import io.github.axolotlclient.util.Util; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiElement; import net.minecraft.client.network.ServerAddress; import net.minecraft.client.network.handler.ClientQueryPacketHandler; -import net.minecraft.client.render.platform.GlStateManager; import net.minecraft.network.Connection; import net.minecraft.network.NetworkProtocol; import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket; @@ -111,39 +102,6 @@ public void handlePing(PingS2CPacket pingS2CPacket) { } } - /** - * @author Flowey - * @reason Implement bridge. - */ - @SuppressWarnings("UnstableApiUsage") - @Overwrite - public static AxoSprite.Dynamic ipHud$getServerIcon() { - final var minecraft = Minecraft.getInstance(); - - var graphics = new GraphicsImpl(0, 0); - var serverEntry = minecraft.getCurrentServerEntry(); - if (serverEntry == null) return null; // 1.8.9 does not store singleplayer world icons - graphics.setPixelData(Base64.getDecoder().decode(serverEntry.getIcon())); - final var icon = Util.getTexture(graphics, "servers/" + Hashing.sha1().hashUnencodedChars(serverEntry.ip) + "/icon"); - - class Impl implements AxoSprite.Dynamic, AxoSpriteImpl { - @Override - public void draw(Minecraft client, int sX, int sY, int sW, int sH, int color) { - client.getTextureManager().bind(icon); - GlStateManager.color4f(ClientColors.ARGB.redFloat(color), ClientColors.ARGB.greenFloat(color), ClientColors.ARGB.blueFloat(color), ClientColors.ARGB.alphaFloat(color)); - GuiElement.drawTexture(sX, sY, 0, 0, sW, sH, 16, 16); - GlStateManager.color4f(1, 1, 1, 1); - } - - @Override - public void close() { - minecraft.executeTask(() -> minecraft.getTextureManager().close(icon)); - } - } - - return new Impl(); - } - /** * @author moehreag * @reason Implement bridge. diff --git a/versions/1.8.9/src/main/java/io/github/axolotlclient/mixin/HandledScreenMixin.java b/versions/1.8.9/src/main/java/io/github/axolotlclient/mixin/HandledScreenMixin.java index 603788500..efcbdbed4 100644 --- a/versions/1.8.9/src/main/java/io/github/axolotlclient/mixin/HandledScreenMixin.java +++ b/versions/1.8.9/src/main/java/io/github/axolotlclient/mixin/HandledScreenMixin.java @@ -22,9 +22,6 @@ package io.github.axolotlclient.mixin; -import io.github.axolotlclient.bridge.impl.AxoRenderContextImpl; -import io.github.axolotlclient.modules.hud.HudManager; -import io.github.axolotlclient.modules.hud.gui.hud.IconHud; import io.github.axolotlclient.modules.scrollableTooltips.ScrollableTooltips; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screen.inventory.menu.InventoryMenuScreen; @@ -67,12 +64,4 @@ public abstract class HandledScreenMixin { private void axolotlclient$mouseClickedTail(int mouseX, int mouseY, int mouseButton, CallbackInfo ci) { moveHoveredSlotToHotbar(mouseButton - 100); } - - @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/inventory/menu/InventoryMenuScreen;renderMenuBackground(FII)V")) - private void renderIcon(int i, int j, float f, CallbackInfo ci) { - var hud = (IconHud) HudManager.getInstance().get(IconHud.ID); - if (hud != null && hud.isEnabled()) { - hud.renderInGui(AxoRenderContextImpl.getInstance(), f); - } - } } diff --git a/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java b/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java index 647dea061..d9d8b287b 100644 --- a/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java +++ b/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/HudManager.java @@ -61,7 +61,6 @@ protected void addExtraHud() { add(new ActionBarHud()); add(new BossBarHud()); add(new CrosshairHud()); - add(new DebugCountersHud()); add(new HotbarHud()); add(new ScoreboardHud()); add(new KeystrokeHud()); diff --git a/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/ModsMenuIcons.java b/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/ModsMenuIcons.java index fc2bc5b11..730493654 100644 --- a/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/ModsMenuIcons.java +++ b/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/ModsMenuIcons.java @@ -54,12 +54,9 @@ final class ModsMenuIcons { put("armorhud", Items.IRON_CHESTPLATE); put("potionshud", Items.POTION); put("togglesprint", Items.IRON_BOOTS); - put("iphud", Items.SIGN); - put("iconhud", Items.NETHER_STAR); put("speedhud", Items.SUGAR); put("coordshud", Items.COMPASS); put("arrowhud", Items.ARROW); - put("itemupdatehud", Item.byBlock(Blocks.HOPPER)); put("irltimehud", Items.CLOCK); put("reachhud", Items.DIAMOND_SWORD); put("memoryhud", Items.REDSTONE); @@ -67,15 +64,11 @@ final class ModsMenuIcons { put("compasshud", Items.COMPASS); put("tpshud", Items.REDSTONE); put("combohud", Items.IRON_SWORD); - put("mousemovementhud", Items.FISHING_ROD); - put("daycounterhud", Items.CLOCK); put("inventoryhud", Item.byBlock(Blocks.CHEST)); - put("xphud", Items.EXPERIENCE_BOTTLE); put("subtitleshud", Items.BOOK); put("actionbarhud", Items.SIGN); put("bossbarhud", Items.NETHER_STAR); put("crosshairhud", Items.ARROW); - put("debugcountershud", Items.REDSTONE); put("hotbarhud", Items.DIAMOND); put("scoreboardhud", Items.PAPER); put("keystrokehud", Items.BOOK); diff --git a/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/DebugCountersHud.java b/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/DebugCountersHud.java deleted file mode 100644 index ab0434782..000000000 --- a/versions/1.8.9/src/main/java/io/github/axolotlclient/modules/hud/gui/hud/vanilla/DebugCountersHud.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright © 2025 moehreag & Contributors - * Copyright © 2026 DSNS - * - * This file is part of DolphinClient, a fork of AxolotlClient. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * For more information, see the LICENSE file. - */ - -package io.github.axolotlclient.modules.hud.gui.hud.vanilla; - -import java.util.List; - -import io.github.axolotlclient.DolphinClientCommon; -import io.github.axolotlclient.AxolotlClientConfig.api.options.Option; -import io.github.axolotlclient.AxolotlClientConfig.impl.options.BooleanOption; -import io.github.axolotlclient.bridge.render.AxoRenderContext; -import io.github.axolotlclient.modules.hud.gui.entry.TextHudEntry; -import io.github.axolotlclient.modules.hud.util.DrawPosition; -import io.github.axolotlclient.util.DrawUtil; -import net.minecraft.client.Minecraft; -import net.minecraft.resource.Identifier; - -public class DebugCountersHud extends TextHudEntry { - public static final Identifier ID = new Identifier(DolphinClientCommon.MODID, "debugcountershud"); - private final BooleanOption showCCount = new BooleanOption("debugcounters.ccount", true); - private final BooleanOption showECount = new BooleanOption("debugcounters.ecount", false); - private final BooleanOption showPCount = new BooleanOption("debugcounters.pcount", false); - - private final Minecraft client = (Minecraft) super.client; - - public DebugCountersHud() { - super(115, 32, true); - } - - @Override - public void renderComponent(AxoRenderContext context, float delta) { - if (client.world == null) { - renderPlaceholderComponent(context, delta); - } - DrawPosition pos = getContentPos(); - int lineY = pos.y() + 2; - int lineX = pos.x() + 1; - - int xEnd = lineX + 50; - if (showCCount.get()) { - xEnd = Math.max(xEnd, DrawUtil.drawString(client.worldRenderer.getChunkDebugInfo(), lineX, lineY, textColor.get().toInt(), shadow.get())); - lineY += 10; - } - if (showECount.get()) { - xEnd = Math.max(xEnd, DrawUtil.drawString(client.worldRenderer.getEntityDebugInfo(), lineX, lineY, textColor.get().toInt(), shadow.get())); - lineY += 10; - } - if (showPCount.get()) { - xEnd = Math.max(xEnd, DrawUtil.drawString("P: " + client.particleManager.getDebugInfo(), lineX, lineY, textColor.get().toInt(), shadow.get())); - lineY += 10; - } - - boolean boundsChanged = false; - if (lineY != getContentHeight() + pos.y()) { - boundsChanged = true; - setContentHeight(lineY - pos.y()); - } - if (xEnd != pos.x() + getContentWidth()) { - boundsChanged = true; - setContentWidth(xEnd - pos.x()); - } - if (boundsChanged) { - onBoundsUpdate(); - } - } - - @Override - public void renderPlaceholderComponent(AxoRenderContext context, float delta) { - DrawPosition pos = getContentPos(); - int lineY = pos.y() + 2; - int lineX = pos.x() + 1; - - int xEnd = lineX + 50; - if (showCCount.get()) { - xEnd = Math.max(xEnd, DrawUtil.drawString("C: 186/15000 (s) D: 10, pC: 000, pU: 00, aB: 20", lineX, lineY, textColor.get().toInt(), shadow.get())); - lineY += 10; - } - if (showECount.get()) { - xEnd = Math.max(xEnd, DrawUtil.drawString("E: 695/3001, SD: 12", lineX, lineY, textColor.get().toInt(), shadow.get())); - lineY += 10; - } - if (showPCount.get()) { - xEnd = Math.max(xEnd, DrawUtil.drawString("P: 200", lineX, lineY, textColor.get().toInt(), shadow.get())); - lineY += 10; - } - - boolean boundsChanged = false; - if (lineY != getContentHeight() + pos.y()) { - boundsChanged = true; - setContentHeight(lineY - pos.y()); - } - if (xEnd != pos.x() + getContentWidth()) { - boundsChanged = true; - setContentWidth(xEnd - pos.x()); - } - if (boundsChanged) { - onBoundsUpdate(); - } - } - - @Override - public Identifier getId() { - return ID; - } - - - @Override - public List> getConfigurationOptions() { - List> options = super.getConfigurationOptions(); - options.add(hide); - options.add(showCCount); - options.add(showECount); - options.add(showPCount); - return options; - } -}