From ac15b9c9fb42d489a66ea80b24f51353b38b86d9 Mon Sep 17 00:00:00 2001 From: Colton Date: Sun, 5 May 2024 10:41:25 -0400 Subject: [PATCH] Removed more unused imports and fixed GUI crash on mouse scroll. --- .../java/net/aoba/gui/tabs/HudOptionsTab.java | 2 - src/main/java/net/aoba/gui/tabs/HudsTab.java | 24 +-------- .../net/aoba/gui/tabs/ModuleSettingsTab.java | 52 +++++++++---------- .../java/net/aoba/gui/tabs/ToggleHudsTab.java | 3 -- .../aoba/module/modules/combat/KillAura.java | 6 +-- .../net/aoba/module/modules/misc/AutoEat.java | 3 -- .../aoba/module/modules/movement/Step.java | 3 -- .../module/modules/render/Breadcrumbs.java | 5 -- .../aoba/module/modules/render/ChestESP.java | 3 -- .../aoba/module/modules/render/EntityESP.java | 23 +------- .../module/modules/render/Trajectory.java | 1 - .../net/aoba/module/modules/render/XRay.java | 1 - .../net/aoba/module/modules/world/Nuker.java | 4 -- 13 files changed, 29 insertions(+), 101 deletions(-) diff --git a/src/main/java/net/aoba/gui/tabs/HudOptionsTab.java b/src/main/java/net/aoba/gui/tabs/HudOptionsTab.java index 31796554..efda97c7 100644 --- a/src/main/java/net/aoba/gui/tabs/HudOptionsTab.java +++ b/src/main/java/net/aoba/gui/tabs/HudOptionsTab.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.Set; import net.aoba.Aoba; -import net.aoba.event.listeners.MouseScrollListener; import net.aoba.gui.GuiManager; import net.aoba.gui.tabs.components.ColorPickerComponent; import net.aoba.gui.tabs.components.KeybindComponent; @@ -37,7 +36,6 @@ public class HudOptionsTab extends ClickGuiTab { public HudOptionsTab() { super("Hud Options", 260, 50, false); - Aoba.getInstance().eventManager.AddListener(MouseScrollListener.class, this); StackPanelComponent stackPanel = new StackPanelComponent(this); stackPanel.setTop(30); diff --git a/src/main/java/net/aoba/gui/tabs/HudsTab.java b/src/main/java/net/aoba/gui/tabs/HudsTab.java index ad7dfade..c65514fd 100644 --- a/src/main/java/net/aoba/gui/tabs/HudsTab.java +++ b/src/main/java/net/aoba/gui/tabs/HudsTab.java @@ -22,13 +22,8 @@ import java.util.HashMap; import java.util.List; import java.util.Set; - import net.aoba.Aoba; -import net.aoba.event.events.MouseScrollEvent; -import net.aoba.event.listeners.MouseScrollListener; -import net.aoba.gui.Color; import net.aoba.gui.GuiManager; -import net.aoba.gui.font.FontManager; import net.aoba.gui.hud.AbstractHud; import net.aoba.gui.tabs.components.ColorPickerComponent; import net.aoba.gui.tabs.components.HudComponent; @@ -38,18 +33,11 @@ import net.aoba.gui.tabs.components.StringComponent; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; -import net.aoba.module.Module; -import net.aoba.settings.types.StringSetting; - -public class HudsTab extends ClickGuiTab implements MouseScrollListener { - - int visibleScrollElements; - int currentScroll; +public class HudsTab extends ClickGuiTab { public HudsTab(AbstractHud[] abstractHuds) { super("Hud Options", 50, 50, false); - Aoba.getInstance().eventManager.AddListener(MouseScrollListener.class, this); StackPanelComponent stackPanel = new StackPanelComponent(this); stackPanel.setTop(30); @@ -94,16 +82,6 @@ public HudsTab(AbstractHud[] abstractHuds) { this.children.add(stackPanel); this.setWidth(300); } - - @Override - public void OnMouseScroll(MouseScrollEvent event) { - ArrayList modules = Aoba.getInstance().moduleManager.modules; - - if(event.GetVertical() > 0) - this.currentScroll = Math.min(currentScroll + 1, modules.size() - visibleScrollElements - 1); - else if(event.GetVertical() < 0) - this.currentScroll = Math.max(currentScroll - 1, 0); - } @Override public void draw(DrawContext drawContext, float partialTicks) { diff --git a/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java b/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java index f3bd75cb..cd5c62b2 100644 --- a/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java +++ b/src/main/java/net/aoba/gui/tabs/ModuleSettingsTab.java @@ -19,11 +19,7 @@ package net.aoba.gui.tabs; import org.joml.Matrix4f; - import net.aoba.Aoba; -import net.aoba.event.events.LeftMouseDownEvent; -import net.aoba.event.listeners.LeftMouseDownListener; -import net.aoba.event.listeners.MouseMoveListener; import net.aoba.gui.AbstractGui; import net.aoba.gui.GuiManager; import net.aoba.gui.colors.Color; @@ -45,7 +41,7 @@ import net.aoba.settings.types.FloatSetting; import net.aoba.utils.types.Vector2; -public class ModuleSettingsTab extends AbstractGui implements LeftMouseDownListener, MouseMoveListener { +public class ModuleSettingsTab extends AbstractGui { protected String title; protected Module module; @@ -144,27 +140,27 @@ public void draw(DrawContext drawContext, float partialTicks) { } } - @Override - public void OnLeftMouseDown(LeftMouseDownEvent event) { - double mouseX = mc.mouse.getX(); - double mouseY = mc.mouse.getY(); - Vector2 pos = position.getValue(); - - if (Aoba.getInstance().hudManager.isClickGuiOpen()) { - if (mouseX >= pos.x && mouseX <= pos.x + width) { - if (mouseY >= pos.y && mouseY <= pos.y + 24) { - this.lastClickOffsetX = mouseX - pos.x; - this.lastClickOffsetY = mouseY - pos.y; - GuiManager.currentGrabbed = this; - } - } - - if (mouseX >= (pos.x + width - 24) && mouseX <= (pos.x + width - 2)) { - if (mouseY >= (pos.y + 4) && mouseY <= (pos.y + 20)) { - GuiManager.currentGrabbed = null; - Aoba.getInstance().hudManager.RemoveHud(this, "Modules"); - } - } - } - } +// @Override +// public void OnLeftMouseDown(LeftMouseDownEvent event) { +// double mouseX = mc.mouse.getX(); +// double mouseY = mc.mouse.getY(); +// Vector2 pos = position.getValue(); +// +// if (Aoba.getInstance().hudManager.isClickGuiOpen()) { +// if (mouseX >= pos.x && mouseX <= pos.x + width) { +// if (mouseY >= pos.y && mouseY <= pos.y + 24) { +// this.lastClickOffsetX = mouseX - pos.x; +// this.lastClickOffsetY = mouseY - pos.y; +// GuiManager.currentGrabbed = this; +// } +// } +// +// if (mouseX >= (pos.x + width - 24) && mouseX <= (pos.x + width - 2)) { +// if (mouseY >= (pos.y + 4) && mouseY <= (pos.y + 20)) { +// GuiManager.currentGrabbed = null; +// Aoba.getInstance().hudManager.RemoveHud(this, "Modules"); +// } +// } +// } +// } } diff --git a/src/main/java/net/aoba/gui/tabs/ToggleHudsTab.java b/src/main/java/net/aoba/gui/tabs/ToggleHudsTab.java index ee3a2130..df524664 100644 --- a/src/main/java/net/aoba/gui/tabs/ToggleHudsTab.java +++ b/src/main/java/net/aoba/gui/tabs/ToggleHudsTab.java @@ -18,8 +18,6 @@ package net.aoba.gui.tabs; -import net.aoba.Aoba; -import net.aoba.event.listeners.MouseScrollListener; import net.aoba.gui.hud.AbstractHud; import net.aoba.gui.tabs.components.HudComponent; import net.aoba.gui.tabs.components.StackPanelComponent; @@ -29,7 +27,6 @@ public class ToggleHudsTab extends ClickGuiTab { public ToggleHudsTab(AbstractHud[] abstractHuds) { super("Toggle HUDs", 50, 50, false); - Aoba.getInstance().eventManager.AddListener(MouseScrollListener.class, this); StackPanelComponent stackPanel = new StackPanelComponent(this); stackPanel.setTop(30); diff --git a/src/main/java/net/aoba/module/modules/combat/KillAura.java b/src/main/java/net/aoba/module/modules/combat/KillAura.java index 9961af29..438d057a 100644 --- a/src/main/java/net/aoba/module/modules/combat/KillAura.java +++ b/src/main/java/net/aoba/module/modules/combat/KillAura.java @@ -135,13 +135,13 @@ public void OnUpdate(TickEvent event) { // If the entity is found, we want to attach it. if (found) { if(legit.getValue()) { - float camPitch = MC.cameraEntity.getPitch(); - float camYaw = MC.cameraEntity.getYaw(); + //float camPitch = MC.cameraEntity.getPitch(); + //float camYaw = MC.cameraEntity.getYaw(); Vec2f vec2 = new Vec2f((float)(MC.player.getX() - entityToAttack.getX()), (float)(MC.player.getZ() - entityToAttack.getZ())); vec2 = vec2.normalize(); - double angleFromPlayer = Math.atan2(vec2.y, vec2.x); + //double angleFromPlayer = Math.atan2(vec2.y, vec2.x); } MC.interactionManager.attackEntity(MC.player, entityToAttack); MC.player.swingHand(Hand.MAIN_HAND); diff --git a/src/main/java/net/aoba/module/modules/misc/AutoEat.java b/src/main/java/net/aoba/module/modules/misc/AutoEat.java index 34945e6e..7c8f6edc 100644 --- a/src/main/java/net/aoba/module/modules/misc/AutoEat.java +++ b/src/main/java/net/aoba/module/modules/misc/AutoEat.java @@ -24,16 +24,13 @@ import org.lwjgl.glfw.GLFW; import net.aoba.Aoba; import net.aoba.event.events.FoodLevelEvent; -import net.aoba.event.events.TickEvent; import net.aoba.event.listeners.FoodLevelListener; -import net.aoba.event.listeners.TickListener; import net.aoba.module.Module; import net.aoba.settings.types.FloatSetting; import net.aoba.settings.types.KeybindSetting; import net.minecraft.client.util.InputUtil; import net.minecraft.component.DataComponentTypes; import net.minecraft.component.type.FoodComponent; -import net.minecraft.component.type.FoodComponents; import net.minecraft.item.Item; public class AutoEat extends Module implements FoodLevelListener { diff --git a/src/main/java/net/aoba/module/modules/movement/Step.java b/src/main/java/net/aoba/module/modules/movement/Step.java index fac390de..13bacc6e 100644 --- a/src/main/java/net/aoba/module/modules/movement/Step.java +++ b/src/main/java/net/aoba/module/modules/movement/Step.java @@ -22,9 +22,6 @@ package net.aoba.module.modules.movement; import org.lwjgl.glfw.GLFW; - -import net.aoba.Aoba; -import net.aoba.gui.font.FontManager; import net.aoba.module.Module; import net.aoba.settings.types.FloatSetting; import net.aoba.settings.types.KeybindSetting; diff --git a/src/main/java/net/aoba/module/modules/render/Breadcrumbs.java b/src/main/java/net/aoba/module/modules/render/Breadcrumbs.java index 27a159fc..9cd9f21f 100644 --- a/src/main/java/net/aoba/module/modules/render/Breadcrumbs.java +++ b/src/main/java/net/aoba/module/modules/render/Breadcrumbs.java @@ -29,8 +29,6 @@ import net.aoba.event.listeners.RenderListener; import net.aoba.event.listeners.TickListener; import net.aoba.gui.colors.Color; -import net.aoba.gui.colors.RainbowColor; - import org.lwjgl.glfw.GLFW; import net.aoba.module.Module; import net.aoba.settings.types.BooleanSetting; @@ -45,8 +43,6 @@ public class Breadcrumbs extends Module implements RenderListener, TickListener private Color currentColor; private ColorSetting color = new ColorSetting("breadcrumbs_color", "Color", "Color", new Color(0, 1f, 1f)); - - private RainbowColor rainbowColor; public BooleanSetting rainbow = new BooleanSetting("breadcrumbs_rainbow", "Rainbow", "Rainbow", false); public FloatSetting effectSpeed = new FloatSetting("breadcrumbs_effectspeed", "Effect Spd.", "Effect Spd", 4f, 1f, 20f, 0.1f); @@ -62,7 +58,6 @@ public Breadcrumbs() { this.setCategory(Category.Render); this.setDescription("Shows breadcrumbs of where you last stepped;"); currentColor = color.getValue(); - rainbowColor = new RainbowColor(); this.addSetting(color); this.addSetting(rainbow); diff --git a/src/main/java/net/aoba/module/modules/render/ChestESP.java b/src/main/java/net/aoba/module/modules/render/ChestESP.java index a6f224f2..955993c2 100644 --- a/src/main/java/net/aoba/module/modules/render/ChestESP.java +++ b/src/main/java/net/aoba/module/modules/render/ChestESP.java @@ -26,11 +26,8 @@ import org.lwjgl.glfw.GLFW; import net.aoba.Aoba; import net.aoba.event.events.RenderEvent; -import net.aoba.event.events.TickEvent; import net.aoba.event.listeners.RenderListener; -import net.aoba.event.listeners.TickListener; import net.aoba.gui.colors.Color; -import net.aoba.gui.colors.RainbowColor; import net.aoba.misc.ModuleUtils; import net.aoba.misc.RenderUtils; import net.aoba.module.Module; diff --git a/src/main/java/net/aoba/module/modules/render/EntityESP.java b/src/main/java/net/aoba/module/modules/render/EntityESP.java index 3db51ea9..1b7effca 100644 --- a/src/main/java/net/aoba/module/modules/render/EntityESP.java +++ b/src/main/java/net/aoba/module/modules/render/EntityESP.java @@ -36,16 +36,14 @@ import net.aoba.settings.types.FloatSetting; import net.aoba.settings.types.KeybindSetting; import net.minecraft.client.util.InputUtil; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.mob.Monster; import net.minecraft.entity.passive.AnimalEntity; import net.minecraft.util.math.Box; -import net.minecraft.util.math.Vec3d; -public class EntityESP extends Module implements RenderListener, TickListener { +public class EntityESP extends Module implements RenderListener { private ColorSetting color_passive = new ColorSetting("entityesp_color_passive", "Passive Color", "Passive Color", new Color(0, 1f, 1f)); private ColorSetting color_enemies = new ColorSetting("entityesp_color_enemy", "Enemy Color", "Enemy Color", new Color(0, 1f, 1f)); private ColorSetting color_misc = new ColorSetting("entityesp_color_misc", "Misc. Color", "Misc. Color", new Color(0, 1f, 1f)); @@ -71,13 +69,11 @@ public EntityESP() { @Override public void onDisable() { Aoba.getInstance().eventManager.RemoveListener(RenderListener.class, this); - Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); } @Override public void onEnable() { Aoba.getInstance().eventManager.AddListener(RenderListener.class, this); - Aoba.getInstance().eventManager.AddListener(TickListener.class, this); } @Override @@ -88,17 +84,10 @@ public void onToggle() { @Override public void OnRender(RenderEvent event) { Matrix4f matrix4f = event.GetMatrix().peek().getPositionMatrix(); - float partialTicks = event.GetPartialTicks(); - - for (Entity entity : MC.world.getEntities()) { if (entity instanceof LivingEntity && !(entity instanceof PlayerEntity)) { - //double x = Math.lerp(partialTicks, entity.lastRenderX, entity.getX()); - //double y = Math.lerp(partialTicks, entity.lastRenderY, entity.getY()); - //double z = Math.lerp(partialTicks, entity.lastRenderZ, entity.getZ()); - Box boundingBox = entity.getBoundingBox(); //Vec3d offset = RenderUtils.getEntityPositionOffsetInterpolated(entity, partialTicks); //boundingBox = boundingBox.offset(offset); @@ -112,14 +101,4 @@ public void OnRender(RenderEvent event) { } } } - - @Override - public void OnUpdate(TickEvent event) { - /* - * if(this.rainbow.getValue()) { - * this.rainbowColor.update(this.effectSpeed.getValue().floatValue()); }else { - * - * this.color.setHSV(hue.getValue().floatValue(), 1f, 1f); } - */ - } } diff --git a/src/main/java/net/aoba/module/modules/render/Trajectory.java b/src/main/java/net/aoba/module/modules/render/Trajectory.java index f4013250..5556c160 100644 --- a/src/main/java/net/aoba/module/modules/render/Trajectory.java +++ b/src/main/java/net/aoba/module/modules/render/Trajectory.java @@ -40,7 +40,6 @@ import net.minecraft.client.render.VertexFormat; import net.minecraft.client.render.VertexFormats; import net.minecraft.client.util.InputUtil; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.BowItem; import net.minecraft.item.ItemStack; import net.minecraft.util.math.Vec3d; diff --git a/src/main/java/net/aoba/module/modules/render/XRay.java b/src/main/java/net/aoba/module/modules/render/XRay.java index 1da40c51..9c4d96a3 100644 --- a/src/main/java/net/aoba/module/modules/render/XRay.java +++ b/src/main/java/net/aoba/module/modules/render/XRay.java @@ -22,7 +22,6 @@ package net.aoba.module.modules.render; import java.util.HashSet; -import java.util.List; import org.lwjgl.glfw.GLFW; import com.google.common.collect.Lists; import net.aoba.interfaces.ISimpleOption; diff --git a/src/main/java/net/aoba/module/modules/world/Nuker.java b/src/main/java/net/aoba/module/modules/world/Nuker.java index 3cf56575..651b06c5 100644 --- a/src/main/java/net/aoba/module/modules/world/Nuker.java +++ b/src/main/java/net/aoba/module/modules/world/Nuker.java @@ -22,11 +22,7 @@ package net.aoba.module.modules.world; import java.util.HashSet; - import org.lwjgl.glfw.GLFW; - -import com.google.common.collect.Lists; - import net.aoba.Aoba; import net.aoba.event.events.BlockStateEvent; import net.aoba.event.events.RenderEvent;