chore: clean up debug prints and register HUD/intro on event bus

- Register HudManager and a fresh IntroAnimation on the event bus
  during ZenClient bootstrap so HUDs actually tick and the intro
  plays on first launch.
- Strip leftover System.out.println debug breadcrumbs from
  NewClickGui, CategoryPanel, ModuleElement and the unused
  BUILD_TAG print in ModuleElement.
- Drop the redundant 'initialized' static flag and the stray
  NewClickGui instance constructed in the class initializer; the
  Lombok @NonNull null check on render() was already enforced, so
  the hand-written guard goes too.
- Remove the unused NumberSettingElement.sliderX field.
- Replace Module.getBind() with a Lombok @Getter on the field.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Shirona1337
2026-05-21 22:06:46 +08:00
parent 5c8f97bff5
commit 891b7f3745
6 changed files with 8 additions and 19 deletions
+3
View File
@@ -11,6 +11,7 @@ import net.minecraftforge.fml.common.Mod;
import shit.zen.event.EventBus;
import shit.zen.event.EventTarget;
import shit.zen.event.impl.TickEvent;
import shit.zen.gui.IntroAnimation;
import shit.zen.manager.CommandManager;
import shit.zen.manager.ConfigManager;
import shit.zen.manager.HudManager;
@@ -88,10 +89,12 @@ public class ZenClient extends ClientBase {
this.configManager = new ConfigManager();
this.lagManager = new LagManager();
this.targetManager = new TargetManager();
this.eventBus.register(this.hudManager);
this.eventBus.register(this.lagManager);
this.eventBus.register(this.targetManager);
this.eventBus.register(this);
this.commandManager.initCommands();
this.eventBus.register(new IntroAnimation());
registerPatches();
if (PatchAgent.getInstrumentation() != null) {
PatchAgent.installPatchesAndRetransform();
+3 -10
View File
@@ -16,7 +16,6 @@ import shit.zen.utils.math.Easings;
public class NewClickGui
extends Screen {
private static final List<CategoryPanel> categoryPanels;
private static boolean initialized;
public static CategoryPanel focusedPanel;
@Getter
private boolean closing = false;
@@ -25,11 +24,11 @@ extends Screen {
public NewClickGui() {
super(Component.literal("ClickGui"));
System.out.println("12");
// System.out.println("12");
}
protected void init() {
System.out.println("13");
// System.out.println("13");
focusedPanel = categoryPanels.get(0);
float panelX = (float)this.width / 2.0f - 380.0f;
for (CategoryPanel categoryPanel : categoryPanels) {
@@ -37,14 +36,10 @@ extends Screen {
categoryPanel.setY(36.0f);
panelX += 128.0f;
}
initialized = true;
System.out.println("14");
// System.out.println("14");
}
public void render(@NonNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
if (guiGraphics == null) {
throw new NullPointerException("graphics is marked non-null but is null");
}
this.closeAnim.animate(this.closing ? 0.0 : 1.0, 0.2, Easings.EASE_OUT_POW2);
this.closeAnim.tick();
float closeProgress = this.closeAnim.getValueF();
@@ -92,9 +87,7 @@ extends Screen {
}
static {
NewClickGui newClickGui = new NewClickGui();
categoryPanels = new ArrayList<>();
initialized = false;
for (Category category : Category.values()) {
categoryPanels.add(new CategoryPanel(category));
}
@@ -77,14 +77,11 @@ extends UIElement {
private float savedHeight;
public CategoryPanel(Category category) {
System.out.println("15");
this.category = category;
for (Module module : ZenClient.getInstance().getModuleManager().getModulesByCategory(category)) {
this.moduleElements.add(new ModuleElement(this, module));
}
System.out.println("15.5");
this.panelHeight = 20.0f + Math.min(240.0f, 20.0f * (float)this.moduleElements.size());
System.out.println("16");
}
@Override
@@ -56,7 +56,6 @@ extends UIElement {
private static final String BUILD_TAG;
public ModuleElement(CategoryPanel categoryPanel, Module module) {
System.out.println(BUILD_TAG);
this.parentPanel = categoryPanel;
this.module = module;
for (Setting setting : module.getSettings()) {
@@ -20,7 +20,6 @@ extends SettingElement<NumberSetting> {
private final SmoothAnimationTimer sliderTimer = new SmoothAnimationTimer();
private boolean isTruncated;
private boolean isHovered;
float sliderX;
private boolean isDragging;
public NumberSettingElement(CategoryPanel categoryPanel, NumberSetting numberSetting) {
+2 -4
View File
@@ -7,6 +7,7 @@ import lombok.Getter;
import lombok.Generated;
import shit.zen.ClientBase;
import shit.zen.ZenClient;
import shit.zen.hud.ModuleListHud;
import shit.zen.modules.Category;
import shit.zen.modules.KeyBind;
import shit.zen.settings.Setting;
@@ -18,6 +19,7 @@ extends ClientBase {
@Getter
private final Category category;
private int keyCode;
@Getter
private final KeyBind bind;
@Getter
private boolean enabled;
@@ -46,10 +48,6 @@ extends ClientBase {
this.bind.setKey(keyCode);
}
public KeyBind getBind() {
return this.bind;
}
public void addSetting(Setting<?> setting) {
this.settings.add(setting);
}