diff --git a/Client/src/main/java/de/com/baseband/client/feature/Feature.java b/Client/src/main/java/de/com/baseband/client/feature/Feature.java index 3aa44ae..f8baa85 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/Feature.java +++ b/Client/src/main/java/de/com/baseband/client/feature/Feature.java @@ -35,7 +35,6 @@ public abstract class Feature extends ToggleButton implements SetCommand { public static final int M_ENABLED = MARKER_PREFIX + 1; protected de.com.baseband.client.Setup Setup; - protected Minecraft mc; public Category category; @@ -43,6 +42,8 @@ public abstract class Feature extends ToggleButton implements SetCommand { @Marker(M_ENABLED) public boolean enabled = defaultEnable(); + public String meta = null; + public Feature() { super("Uninit", null, "Enabled"); this.setLambda(this::updateEnabled); @@ -296,4 +297,8 @@ public abstract class Feature extends ToggleButton implements SetCommand { public boolean renderInHUD() { return true; } + + public String getHUDText() { + return text + (meta != null ? " §7[" + meta + "]" : ""); + } } diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/chat/PvpInfo.java b/Client/src/main/java/de/com/baseband/client/feature/modules/chat/PvpInfo.java index c6a6b7a..612dcec 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/chat/PvpInfo.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/chat/PvpInfo.java @@ -71,7 +71,6 @@ public class PvpInfo extends Feature { @Override public void onDisable() { - text = "PvpInfo"; names.clear(); newnames.clear(); popList.clear(); diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/client/Baritone.java b/Client/src/main/java/de/com/baseband/client/feature/modules/client/Baritone.java index ebc70cb..4d10e0a 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/client/Baritone.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/client/Baritone.java @@ -32,7 +32,7 @@ public class Baritone extends Feature { public void onTick() { IBaritoneProcess baritoneProcess = BaritoneManager.getBaritone().getPathingControlManager().mostRecentInControl().orElse(null); - text = "Baritone §7[" + (baritoneProcess == null ? "Idle" : baritoneProcess.displayName()) + "]"; + meta = (baritoneProcess == null ? "Idle" : baritoneProcess.displayName()); } public void onSelect(SelectEvent event) { diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/client/Spotify.java b/Client/src/main/java/de/com/baseband/client/feature/modules/client/Spotify.java index f16a92c..11278ea 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/client/Spotify.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/client/Spotify.java @@ -36,9 +36,10 @@ public class Spotify extends Feature { } if (api.isConnected() && api.hasPosition() && api.hasTrack() && enabled && renderInHUD) { - text = this + "§7 [" + api.getTrack().getName() + " - " + api.getTrack().getArtist() + " (" + new SimpleDateFormat("mm:ss").format(new Date(api.getPosition())) + "/" + new SimpleDateFormat("mm:ss").format(new Date(api.getTrack().getLength())) + ")]"; - } else { - text = toString(); + meta = api.getTrack().getName() + " - " + api.getTrack().getArtist() + " (" + new SimpleDateFormat("mm:ss").format(new Date(api.getPosition())) + "/" + new SimpleDateFormat("mm:ss").format(new Date(api.getTrack().getLength())) + ")"; + } + else { + meta = null; } } diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/client/Timer.java b/Client/src/main/java/de/com/baseband/client/feature/modules/client/Timer.java index d6122bb..fb2f61e 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/client/Timer.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/client/Timer.java @@ -59,7 +59,7 @@ public class Timer extends Feature { @Override public void onDisable() { setGameTimer(20); - text = "Timer"; + meta = null; multiplierLock = null; } @@ -102,7 +102,7 @@ public class Timer extends Feature { private void tickTimer() { if (timerLock) { - text = "Timer" + (enabled ? " §7[LOCKED]" : ""); + meta = (enabled ? "LOCKED" : null); if(multiplierLock != null) { setGameTimer(multiplierLock); } @@ -116,7 +116,7 @@ public class Timer extends Feature { } float t = (adjust ? tps : 20) * m; setGameTimer(t); - text = "Timer" + (enabled ? "§7 [TPS: " + (Math.round(t * 100f) / 100f) + "]" : ""); + meta = (enabled ? "TPS: " + (Math.round(t * 100f) / 100f) : null); } } diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/combat/AutoTotem.java b/Client/src/main/java/de/com/baseband/client/feature/modules/combat/AutoTotem.java index dbaed84..e62811d 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/combat/AutoTotem.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/combat/AutoTotem.java @@ -140,9 +140,9 @@ public class AutoTotem extends Feature { //Hot if(enabled && renderTotemCountModuleList && !notIngame()) { - text = this + "§7 [" + getTotemCount() + "]"; + meta = String.valueOf(getTotemCount()); } else { - text = toString(); + meta = null; } switch (mode) { diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/movement/ElytraFly.java b/Client/src/main/java/de/com/baseband/client/feature/modules/movement/ElytraFly.java index 8e5e3d8..ad84479 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/movement/ElytraFly.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/movement/ElytraFly.java @@ -115,9 +115,9 @@ public class ElytraFly extends Feature { @Override public void onEveryTick() { if (blockMovement) { - text = this + "§7 [Locked]"; + meta = "Locked"; } else { - text = toString(); + meta = null; } } diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/render/Bright.java b/Client/src/main/java/de/com/baseband/client/feature/modules/render/Bright.java index 6f5739f..e7e5db1 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/render/Bright.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/render/Bright.java @@ -21,17 +21,9 @@ public class Bright extends Feature { Gamma, } - @Override - public void onEveryTick() { - if (enabled && !notIngame()) { - text = this + "§7 [" + mode.toString() + "]"; - } else { - text = toString(); - } - } - @Override public void onTick() { + meta = mode.toString(); switch (mode) { case Gamma: mc.gameSettings.gammaSetting = 100f; diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java b/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java index 4e18956..734e2db 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/render/HUD.java @@ -227,7 +227,7 @@ public class HUD extends Feature { int maxWidth = TextSplitter.getStringWidth(initString); Feature[] renderFeatures = Arrays.stream(Features.features).filter(m -> m.enabled && m.category != Category.COMMAND && m.getClass() != Client.class && m != this && m.renderInHUD()).sorted(Comparator.comparingDouble(value -> -Minecraft.getMinecraft().fontRenderer.getStringWidth(includeStatus ? value.text : value.toString()))).toArray(Feature[]::new); for (Feature f : renderFeatures) { - maxWidth = Math.max(mc.fontRenderer.getStringWidth(f.text), maxWidth); + maxWidth = Math.max(mc.fontRenderer.getStringWidth(f.getHUDText()), maxWidth); } if(background) { @@ -237,7 +237,7 @@ public class HUD extends Feature { TextSplitter.drawString(initString, 3,3, theme.getGreenColor(), textShadow, false); int y = 3 + TextSplitter.getStringHeight(initString); for (Feature f : renderFeatures) { - mc.fontRenderer.drawString(f.text, 3, y, hashColor ? f.getHashColor() : theme.getGreenColor(), textShadow); + mc.fontRenderer.drawString(f.getHUDText(), 3, y, hashColor ? f.getHashColor() : theme.getGreenColor(), textShadow); y = y + mc.fontRenderer.FONT_HEIGHT; } @@ -333,14 +333,9 @@ public class HUD extends Feature { return false; } - @Override - public void onDisable() { - text = toString(); - } - @Override public void onTick() { - text = "ShowTPS" + (enabled ? " §7[TPS: " + (Math.round(ServerDataManager.tps * 100f) / 100f) + "]" : ""); + meta = "TPS: " + (Math.round(ServerDataManager.tps * 100f) / 100f); } @Override diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/world/AutoEat.java b/Client/src/main/java/de/com/baseband/client/feature/modules/world/AutoEat.java index f34f3fb..4d05a25 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/world/AutoEat.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/world/AutoEat.java @@ -33,17 +33,9 @@ public class AutoEat extends Feature { return "AutoEat"; } - @Override - public void onEveryTick() { - if(enabled) { - text = this + "§7 [" + (eating ? "Eating" : "Idle") + "]"; - } else { - text = toString(); - } - } - @Override public void onTick() { + meta = (eating ? "Eating" : "Idle"); if (eating && !mc.player.isHandActive()) { if (lastSlot != -1) { mc.player.inventory.currentItem = lastSlot; diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastBreak.java b/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastBreak.java index d662926..d83449a 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastBreak.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/world/FastBreak.java @@ -31,19 +31,15 @@ public class FastBreak extends Feature { } @Override - public void onEveryTick() { - //Hot - if (enabled && !notIngame()) { - if(noBreakDelay) { - ((IPlayerControllerMP) (mc.playerController)).setBlockHitDelay(0); - } - text = this + "§7 [" + mode.toString() + "]"; - } else { - text = toString(); + public void onTick() { + if(notIngame()) + return; + if(noBreakDelay) { + ((IPlayerControllerMP) (mc.playerController)).setBlockHitDelay(0); } + meta = mode.toString(); } - public void damageBlock(DamageBlockEvent event) { if(noBreakDelay) { ((IPlayerControllerMP) (mc.playerController)).setBlockHitDelay(0); diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/world/Ping.java b/Client/src/main/java/de/com/baseband/client/feature/modules/world/Ping.java index f054ad2..86e8c34 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/world/Ping.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/world/Ping.java @@ -28,7 +28,7 @@ public class Ping extends Feature { @Override public void onEveryTick() { - text = "Ping" + (enabled ? " §7[" + seconds + "s: " + totalRecieved + (holder == null ? "" : "§cH§7") + "]" : ""); + meta = seconds + "s: " + totalRecieved + (holder == null ? "" : "§cH§7"); } @Override @@ -40,7 +40,6 @@ public class Ping extends Feature { } public void onDisable() { - text = "Ping"; totalRecieved = 0; } diff --git a/Client/src/main/java/de/com/baseband/client/feature/modules/world/Select.java b/Client/src/main/java/de/com/baseband/client/feature/modules/world/Select.java index 3b4261c..a6f53ae 100644 --- a/Client/src/main/java/de/com/baseband/client/feature/modules/world/Select.java +++ b/Client/src/main/java/de/com/baseband/client/feature/modules/world/Select.java @@ -36,14 +36,9 @@ public class Select extends Feature { @Override public void onTick() { if(selection != null) - text = this + "§7 [" + selection.area() + " Blocks]"; + meta = selection.area() + " Blocks"; else - text = this + "§7 [0 Blocks]"; - } - - @Override - public void onDisable() { - text = this.toString(); + meta = "0 Blocks"; } @Override