From 4c366e34df858d98c9f8701f7cdc433b48f5369a Mon Sep 17 00:00:00 2001 From: Colton Date: Sat, 22 Jun 2024 20:44:27 -0400 Subject: [PATCH] Added new modules + module fixes. - Added ClickTP module based on LiveOverflow's ClickTP. - Added right click mouse event listeners and events. - Added HighJump - Fixed Spider - Fixed issue where block gui components would not render the selected block correctly. - Fixed issue where Vignette would be applied to Aoba HUD. - Prettied up Button component and added hover color. - Added plenty of extra module options. (AutoRespawn, CrystalAura, KillAura, MaceAura, Glide, Spider) --- .../event/events/RightMouseDownEvent.java | 59 +++++++++++++++ .../aoba/event/events/RightMouseUpEvent.java | 59 +++++++++++++++ .../listeners/RightMouseDownListener.java | 25 +++++++ .../event/listeners/RightMouseUpListener.java | 25 +++++++ .../gui/tabs/components/BlocksComponent.java | 2 +- .../gui/tabs/components/ButtonComponent.java | 11 ++- .../aoba/mixin/ClientPlayerEntityMixin.java | 15 +++- src/main/java/net/aoba/mixin/EntityMixin.java | 10 ++- .../java/net/aoba/mixin/IngameHudMixin.java | 2 +- .../net/aoba/mixin/LivingEntityMixin.java | 2 + src/main/java/net/aoba/mixin/MouseMixin.java | 19 +++++ .../java/net/aoba/module/ModuleManager.java | 4 ++ .../module/modules/combat/AutoRespawn.java | 35 ++++++++- .../aoba/module/modules/combat/AutoSoup.java | 7 +- .../module/modules/combat/CrystalAura.java | 9 +++ .../aoba/module/modules/combat/KillAura.java | 29 +++++--- .../aoba/module/modules/combat/MaceAura.java | 15 ++-- .../aoba/module/modules/movement/ClickTP.java | 71 +++++++++++++++++++ .../aoba/module/modules/movement/Glide.java | 11 ++- .../module/modules/movement/HighJump.java | 40 +++++++++++ .../aoba/module/modules/movement/Spider.java | 13 +++- 21 files changed, 430 insertions(+), 33 deletions(-) create mode 100644 src/main/java/net/aoba/event/events/RightMouseDownEvent.java create mode 100644 src/main/java/net/aoba/event/events/RightMouseUpEvent.java create mode 100644 src/main/java/net/aoba/event/listeners/RightMouseDownListener.java create mode 100644 src/main/java/net/aoba/event/listeners/RightMouseUpListener.java create mode 100644 src/main/java/net/aoba/module/modules/movement/ClickTP.java create mode 100644 src/main/java/net/aoba/module/modules/movement/HighJump.java diff --git a/src/main/java/net/aoba/event/events/RightMouseDownEvent.java b/src/main/java/net/aoba/event/events/RightMouseDownEvent.java new file mode 100644 index 0000000..c27ac83 --- /dev/null +++ b/src/main/java/net/aoba/event/events/RightMouseDownEvent.java @@ -0,0 +1,59 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.LeftMouseDownListener; +import net.aoba.event.listeners.RightMouseDownListener; + +public class RightMouseDownEvent extends AbstractEvent{ + + double mouseX; + double mouseY; + + public RightMouseDownEvent(double mouseX2, double mouseY2) { + super(); + this.mouseX = mouseX2; + this.mouseY = mouseY2; + } + + public double GetMouseX() { + return mouseX; + } + + public double GetMouseY() { + return mouseY; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + RightMouseDownListener mouseRightClickListener = (RightMouseDownListener) listener; + mouseRightClickListener.OnRightMouseDown(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return RightMouseDownListener.class; + } +} \ No newline at end of file diff --git a/src/main/java/net/aoba/event/events/RightMouseUpEvent.java b/src/main/java/net/aoba/event/events/RightMouseUpEvent.java new file mode 100644 index 0000000..a187f5f --- /dev/null +++ b/src/main/java/net/aoba/event/events/RightMouseUpEvent.java @@ -0,0 +1,59 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.events; + +import java.util.ArrayList; +import java.util.List; +import net.aoba.event.listeners.AbstractListener; +import net.aoba.event.listeners.LeftMouseUpListener; +import net.aoba.event.listeners.RightMouseUpListener; + +public class RightMouseUpEvent extends AbstractEvent{ + + double mouseX; + double mouseY; + + public RightMouseUpEvent(double mouseX2, double mouseY2) { + super(); + this.mouseX = mouseX2; + this.mouseY = mouseY2; + } + + public double GetMouseX() { + return mouseX; + } + + public double GetMouseY() { + return mouseY; + } + + @Override + public void Fire(ArrayList listeners) { + for(AbstractListener listener : List.copyOf(listeners)) { + RightMouseUpListener mouseRightClickListener = (RightMouseUpListener) listener; + mouseRightClickListener.OnRightMouseUp(this); + } + } + + @SuppressWarnings("unchecked") + @Override + public Class GetListenerClassType() { + return RightMouseUpListener.class; + } +} \ No newline at end of file diff --git a/src/main/java/net/aoba/event/listeners/RightMouseDownListener.java b/src/main/java/net/aoba/event/listeners/RightMouseDownListener.java new file mode 100644 index 0000000..19aab81 --- /dev/null +++ b/src/main/java/net/aoba/event/listeners/RightMouseDownListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.RightMouseDownEvent; + +public interface RightMouseDownListener extends AbstractListener { + public abstract void OnRightMouseDown(RightMouseDownEvent event); +} diff --git a/src/main/java/net/aoba/event/listeners/RightMouseUpListener.java b/src/main/java/net/aoba/event/listeners/RightMouseUpListener.java new file mode 100644 index 0000000..8fefe03 --- /dev/null +++ b/src/main/java/net/aoba/event/listeners/RightMouseUpListener.java @@ -0,0 +1,25 @@ +/* +* Aoba Hacked Client +* Copyright (C) 2019-2024 coltonk9043 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU 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 General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +package net.aoba.event.listeners; + +import net.aoba.event.events.RightMouseUpEvent; + +public interface RightMouseUpListener extends AbstractListener { + public abstract void OnRightMouseUp(RightMouseUpEvent event); +} diff --git a/src/main/java/net/aoba/gui/tabs/components/BlocksComponent.java b/src/main/java/net/aoba/gui/tabs/components/BlocksComponent.java index 94138cb..d4e55b0 100644 --- a/src/main/java/net/aoba/gui/tabs/components/BlocksComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/BlocksComponent.java @@ -93,7 +93,7 @@ public void draw(DrawContext drawContext, float partialTicks) { Block block = Registries.BLOCK.get(index); if(blocks.getValue().contains(block)) { - RenderUtils.drawBox(matrix4f, ((actualX + (j * 36) + 4) / 2.0f), ((actualY + ((i-scroll) * 36) + 25) / 2.0f), 16, 16, new Color(0, 255, 0, 55)); + RenderUtils.drawBox(matrix4f, ((actualX + (j * 36) + 4)), ((actualY + ((i-scroll) * 36) + 25)), 32, 32, new Color(0, 255, 0, 55)); } drawContext.drawItem(new ItemStack(block.asItem()), (int) ((actualX + (j * 36) + 6) / 2.0f), (int) ((actualY + ((i-scroll) * 36) + 25) / 2.0f) ); } diff --git a/src/main/java/net/aoba/gui/tabs/components/ButtonComponent.java b/src/main/java/net/aoba/gui/tabs/components/ButtonComponent.java index 6bef6d8..67a4d9f 100644 --- a/src/main/java/net/aoba/gui/tabs/components/ButtonComponent.java +++ b/src/main/java/net/aoba/gui/tabs/components/ButtonComponent.java @@ -34,7 +34,8 @@ public class ButtonComponent extends Component implements LeftMouseDownListener private String text; private Runnable onClick; private Color borderColor = new Color(128, 128, 128); - private Color backgroundColor = borderColor; + private Color backgroundColor = new Color(96, 96, 96); + private Color hoveredBackgroundColor = new Color(156, 156, 156); /** * Constructor for button component. @@ -48,6 +49,7 @@ public ButtonComponent(IGuiElement parent, String text, Runnable onClick) { this.setLeft(2); this.setRight(2); this.setHeight(30); + this.setBottom(10); this.text = text; this.onClick = onClick; @@ -59,6 +61,7 @@ public ButtonComponent(IGuiElement parent, String text, Runnable onClick, Color this.setLeft(2); this.setRight(2); this.setHeight(30); + this.setBottom(10); this.text = text; this.onClick = onClick; @@ -102,7 +105,11 @@ public void setBackgroundColor(Color color) { public void draw(DrawContext drawContext, float partialTicks) { MatrixStack matrixStack = drawContext.getMatrices(); Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); - RenderUtils.drawOutlinedBox(matrix4f, actualX + 2, actualY, actualWidth - 4, actualHeight - 2, borderColor, backgroundColor); + + if(this.hovered) + RenderUtils.drawOutlinedBox(matrix4f, actualX + 2, actualY, actualWidth - 4, actualHeight - 4, borderColor, hoveredBackgroundColor); + else + RenderUtils.drawOutlinedBox(matrix4f, actualX + 2, actualY, actualWidth - 4, actualHeight - 4, borderColor, backgroundColor); RenderUtils.drawString(drawContext, this.text, actualX + 8, actualY + 8, 0xFFFFFF); } diff --git a/src/main/java/net/aoba/mixin/ClientPlayerEntityMixin.java b/src/main/java/net/aoba/mixin/ClientPlayerEntityMixin.java index 342263a..9d7eee5 100644 --- a/src/main/java/net/aoba/mixin/ClientPlayerEntityMixin.java +++ b/src/main/java/net/aoba/mixin/ClientPlayerEntityMixin.java @@ -25,21 +25,25 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.aoba.Aoba; +import net.aoba.AobaClient; import net.aoba.event.events.PlayerHealthEvent; import net.aoba.gui.GuiManager; import net.aoba.misc.FakePlayerEntity; import net.aoba.module.modules.movement.Fly; import net.aoba.module.modules.movement.Freecam; +import net.aoba.module.modules.movement.HighJump; import net.aoba.module.modules.movement.Step; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.network.ClientPlayerEntity; +import net.minecraft.entity.attribute.EntityAttribute; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; +import net.minecraft.registry.entry.RegistryEntry; @Mixin(ClientPlayerEntity.class) public abstract class ClientPlayerEntityMixin extends AbstractClientPlayerEntityMixin { @Shadow private ClientPlayNetworkHandler networkHandler; - + @Inject(at = { @At("HEAD") }, method = "tick()V", cancellable = true) private void onPlayerTick(CallbackInfo ci) { if (Aoba.getInstance().moduleManager.freecam.getState()) { @@ -104,4 +108,13 @@ public void onGetStepHeight(CallbackInfoReturnable cir) { cir.setReturnValue(cir.getReturnValue()); } } + + @Override + public void onGetJumpVelocityMultiplier(CallbackInfoReturnable cir) { + AobaClient aoba = Aoba.getInstance(); + HighJump higherJump = (HighJump)aoba.moduleManager.higherjump; + if(higherJump.getState()) { + cir.setReturnValue(higherJump.getJumpHeightMultiplier()); + } + } } diff --git a/src/main/java/net/aoba/mixin/EntityMixin.java b/src/main/java/net/aoba/mixin/EntityMixin.java index 6db77da..6cc677e 100644 --- a/src/main/java/net/aoba/mixin/EntityMixin.java +++ b/src/main/java/net/aoba/mixin/EntityMixin.java @@ -52,11 +52,17 @@ private void onIsInvisibleCheck(PlayerEntity message, CallbackInfoReturnable ci) { - + return; } @Inject(at= {@At("HEAD")}, method = "getStepHeight()F", cancellable=true) public void onGetStepHeight(CallbackInfoReturnable cir) { - + return; + } + + @Inject(at= {@At("HEAD")}, method = "getJumpVelocityMultiplier()F", cancellable=true) + public void onGetJumpVelocityMultiplier(CallbackInfoReturnable cir) { + return; } + } diff --git a/src/main/java/net/aoba/mixin/IngameHudMixin.java b/src/main/java/net/aoba/mixin/IngameHudMixin.java index 4b3dca5..0dd844c 100644 --- a/src/main/java/net/aoba/mixin/IngameHudMixin.java +++ b/src/main/java/net/aoba/mixin/IngameHudMixin.java @@ -31,7 +31,7 @@ @Mixin(InGameHud.class) public class IngameHudMixin { - @Inject(at = {@At(value = "HEAD") }, method = {"render(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/client/render/RenderTickCounter;)V" }) + @Inject(at = {@At(value = "TAIL") }, method = {"render(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/client/render/RenderTickCounter;)V" }) private void onRender(DrawContext context, RenderTickCounter tickDelta, CallbackInfo ci) { Aoba.getInstance().drawHUD(context, tickDelta.getTickDelta(false)); } diff --git a/src/main/java/net/aoba/mixin/LivingEntityMixin.java b/src/main/java/net/aoba/mixin/LivingEntityMixin.java index 0863e77..5f60eb2 100644 --- a/src/main/java/net/aoba/mixin/LivingEntityMixin.java +++ b/src/main/java/net/aoba/mixin/LivingEntityMixin.java @@ -4,6 +4,8 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + import net.minecraft.entity.LivingEntity; @Mixin(LivingEntity.class) diff --git a/src/main/java/net/aoba/mixin/MouseMixin.java b/src/main/java/net/aoba/mixin/MouseMixin.java index fa09d83..b2079fe 100644 --- a/src/main/java/net/aoba/mixin/MouseMixin.java +++ b/src/main/java/net/aoba/mixin/MouseMixin.java @@ -28,6 +28,8 @@ import net.aoba.AobaClient; import net.aoba.event.events.MouseMoveEvent; import net.aoba.event.events.MouseScrollEvent; +import net.aoba.event.events.RightMouseDownEvent; +import net.aoba.event.events.RightMouseUpEvent; import net.aoba.event.events.LeftMouseDownEvent; import net.aoba.event.events.LeftMouseUpEvent; import net.minecraft.client.Mouse; @@ -62,7 +64,24 @@ private void onMouseButton(long window, int button, int action, int mods, Callba } break; case GLFW.GLFW_MOUSE_BUTTON_MIDDLE: + + break; + case GLFW.GLFW_MOUSE_BUTTON_RIGHT: + if (action == 1) { + RightMouseDownEvent event2 = new RightMouseDownEvent(x, y); + aoba.eventManager.Fire(event2); + if (event2.IsCancelled()) { + ci.cancel(); + } + } else { + RightMouseUpEvent event2 = new RightMouseUpEvent(x, y); + aoba.eventManager.Fire(event2); + + if (event2.IsCancelled()) { + ci.cancel(); + } + } break; } } diff --git a/src/main/java/net/aoba/module/ModuleManager.java b/src/main/java/net/aoba/module/ModuleManager.java index 63a2578..4ad250f 100644 --- a/src/main/java/net/aoba/module/ModuleManager.java +++ b/src/main/java/net/aoba/module/ModuleManager.java @@ -61,6 +61,7 @@ public class ModuleManager implements KeyDownListener { public Module chestesp = new ChestESP(); public Module criticals = new Criticals(); public Module crystalaura = new CrystalAura(); + public Module clickTP = new ClickTP(); public Module entityesp = new EntityESP(); public Module fastplace = new FastPlace(); public Module fastbreak = new FastBreak(); @@ -69,6 +70,7 @@ public class ModuleManager implements KeyDownListener { public Module fullbright = new Fullbright(); public Module itemesp = new ItemESP(); public Module glide = new Glide(); + public Module higherjump = new HighJump(); public Module jesus = new Jesus(); public Module jetpack = new Jetpack(); public Module killaura = new KillAura(); @@ -116,6 +118,7 @@ public ModuleManager() { addModule(chestesp); addModule(criticals); addModule(crystalaura); + addModule(clickTP); addModule(entityesp); addModule(fastplace); addModule(fastbreak); @@ -123,6 +126,7 @@ public ModuleManager() { addModule(freecam); addModule(fullbright); addModule(glide); + addModule(higherjump); addModule(itemesp); addModule(jesus); addModule(jetpack); diff --git a/src/main/java/net/aoba/module/modules/combat/AutoRespawn.java b/src/main/java/net/aoba/module/modules/combat/AutoRespawn.java index 8da7033..64174f4 100644 --- a/src/main/java/net/aoba/module/modules/combat/AutoRespawn.java +++ b/src/main/java/net/aoba/module/modules/combat/AutoRespawn.java @@ -24,24 +24,34 @@ import org.lwjgl.glfw.GLFW; import net.aoba.Aoba; import net.aoba.event.events.PlayerDeathEvent; +import net.aoba.event.events.TickEvent; import net.aoba.event.listeners.PlayerDeathListener; +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; -public class AutoRespawn extends Module implements PlayerDeathListener { +public class AutoRespawn extends Module implements PlayerDeathListener, TickListener { + + private FloatSetting respawnDelay; + + private int tick; public AutoRespawn() { super(new KeybindSetting("key.autorespawn", "AutoRespawn Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); - this.setName("AutoRespawn"); - this.setCategory(Category.Combat); this.setDescription("Automatically respawns when you die."); + + respawnDelay = new FloatSetting("autorespawn_delay", "Delay", "The delay between dying and automatically respawning.", 0.0f, 0.0f, 100.0f, 1.0f); + + this.addSetting(respawnDelay); } @Override public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); Aoba.getInstance().eventManager.RemoveListener(PlayerDeathListener.class, this); } @@ -57,7 +67,26 @@ public void onToggle() { @Override public void OnPlayerDeath(PlayerDeathEvent readPacketEvent) { + if(respawnDelay.getValue() == 0.0f) { + respawn(); + }else { + tick = 0; + Aoba.getInstance().eventManager.AddListener(TickListener.class, this); + } + } + + @Override + public void OnUpdate(TickEvent event) { + if(tick < respawnDelay.getValue()) { + tick++; + }else { + respawn(); + } + } + + private void respawn() { MC.player.requestRespawn(); MC.setScreen(null); + Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); } } diff --git a/src/main/java/net/aoba/module/modules/combat/AutoSoup.java b/src/main/java/net/aoba/module/modules/combat/AutoSoup.java index 125942c..748ed5e 100644 --- a/src/main/java/net/aoba/module/modules/combat/AutoSoup.java +++ b/src/main/java/net/aoba/module/modules/combat/AutoSoup.java @@ -111,10 +111,9 @@ public void OnHealthChanged(PlayerHealthEvent readPacketEvent) { Item item = MC.player.getInventory().getStack(i).getItem(); // Fix AutoSoup - /* - * item.getComponents().contains(FoodComponents.MUSHROOM_STEW); if(item - * instanceof StewItem) { foodSlot = i; break; } - */ + //if(item.getComponents().contains(FoodComponents.MUSHROOM_STEW)) { + // foodSlot = i; break; + //} } // If a Stew item was found, switch to it and use it. diff --git a/src/main/java/net/aoba/module/modules/combat/CrystalAura.java b/src/main/java/net/aoba/module/modules/combat/CrystalAura.java index 35b7325..72107dd 100644 --- a/src/main/java/net/aoba/module/modules/combat/CrystalAura.java +++ b/src/main/java/net/aoba/module/modules/combat/CrystalAura.java @@ -26,6 +26,7 @@ import net.aoba.event.events.TickEvent; import net.aoba.event.listeners.TickListener; import net.aoba.module.Module; +import net.aoba.settings.types.BooleanSetting; import net.aoba.settings.types.FloatSetting; import net.aoba.settings.types.KeybindSetting; import net.minecraft.block.Block; @@ -46,6 +47,7 @@ public class CrystalAura extends Module implements TickListener { private FloatSetting radius; + private BooleanSetting targetFriends; public CrystalAura() { super(new KeybindSetting("key.crystalaura", "Crystal Aura Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); @@ -55,7 +57,10 @@ public CrystalAura() { this.setDescription("Attacks anything within your personal space."); radius = new FloatSetting("crystalaura_radius", "Radius", "Radius, in blocks, that you can place/attack a crystal.", 5f, 1f, 15f, 1f); + targetFriends = new BooleanSetting("crystalaura_target_friends", "Target Friends", "Target friends.", false); + this.addSetting(radius); + this.addSetting(targetFriends); } @Override @@ -76,6 +81,10 @@ public void onToggle() { @Override public void OnUpdate(TickEvent event) { for (PlayerEntity player : MC.world.getPlayers()) { + + if(!targetFriends.getValue() && Aoba.getInstance().friendsList.contains(player)) + continue; + if (player == MC.player || MC.player.distanceTo(player) > this.radius.getValue()) { continue; } 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 2b296e0..47b0c8d 100644 --- a/src/main/java/net/aoba/module/modules/combat/KillAura.java +++ b/src/main/java/net/aoba/module/modules/combat/KillAura.java @@ -33,6 +33,8 @@ import net.minecraft.client.util.InputUtil; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.mob.Monster; +import net.minecraft.entity.passive.AnimalEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.Hand; import net.minecraft.util.math.Vec2f; @@ -47,6 +49,7 @@ private enum Priority { private BooleanSetting targetAnimals; private BooleanSetting targetMonsters; private BooleanSetting targetPlayers; + private BooleanSetting targetFriends; private BooleanSetting legit; public KillAura() { @@ -60,11 +63,14 @@ public KillAura() { targetAnimals = new BooleanSetting("killaura_target_animals", "Target Animals", "Target animals.", false); targetMonsters = new BooleanSetting("killaura_target_monsters", "Target Monsters", "Target monsters.", true); targetPlayers = new BooleanSetting("killaura_target_players", "Target Players", "Target pplayers.", true); + targetFriends = new BooleanSetting("killaura_target_friends", "Target Friends", "Target friends.", false); legit = new BooleanSetting("killaura_legit", "Legit", "Whether or not the player will gradually look at the other player.", false); + this.addSetting(radius); this.addSetting(targetAnimals); this.addSetting(targetMonsters); this.addSetting(targetPlayers); + this.addSetting(targetFriends); this.addSetting(legit); } @@ -91,19 +97,22 @@ public void OnUpdate(TickEvent event) { boolean found = false; // Add all potential entities to the 'hitlist' - //if(this.targetAnimals.getValue() || this.targetMonsters.getValue()) { - // double radiusSqr = this.radius.getValue() * this.radius.getValue(); - // for (Entity entity : MC.world.getEntities()) { - // if (MC.player.squaredDistanceTo(entity) > radiusSqr) continue; - // if((entity instanceof AnimalEntity && this.targetAnimals.getValue()) || (entity instanceof Monster && this.targetMonsters.getValue())) { - // hitList.add(entity); - // } - // } - //} - + if(this.targetAnimals.getValue() || this.targetMonsters.getValue()) { + double radiusSqr = this.radius.getValue() * this.radius.getValue(); + for (Entity entity : MC.world.getEntities()) { + if (MC.player.squaredDistanceTo(entity) > radiusSqr) continue; + if((entity instanceof AnimalEntity && this.targetAnimals.getValue()) || (entity instanceof Monster && this.targetMonsters.getValue())) { + hitList.add(entity); + } + } + } + // Add all potential players to the 'hitlist' if(this.targetPlayers.getValue()) { for (PlayerEntity player : MC.world.getPlayers()) { + if(!targetFriends.getValue() && Aoba.getInstance().friendsList.contains(player)) + continue; + if (player == MC.player || MC.player.squaredDistanceTo(player) > (this.radius.getValue()*this.radius.getValue())) { continue; } diff --git a/src/main/java/net/aoba/module/modules/combat/MaceAura.java b/src/main/java/net/aoba/module/modules/combat/MaceAura.java index 93b9d91..1790541 100644 --- a/src/main/java/net/aoba/module/modules/combat/MaceAura.java +++ b/src/main/java/net/aoba/module/modules/combat/MaceAura.java @@ -51,6 +51,7 @@ public class MaceAura extends Module implements TickListener { private BooleanSetting targetAnimals; private BooleanSetting targetMonsters; private BooleanSetting targetPlayers; + private BooleanSetting targetFriends; private MaceState state = MaceState.OnGround; private LivingEntity entityToAttack; @@ -61,14 +62,17 @@ public MaceAura() { this.setCategory(Category.Combat); this.setDescription("Attacks anything within your personal space."); - radius = new FloatSetting("killaura_radius", "Radius", "Radius", 5f, 0.1f, 10f, 0.1f); - targetAnimals = new BooleanSetting("killaura_target_animals", "Target Animals", "Target animals.", false); - targetMonsters = new BooleanSetting("killaura_target_monsters", "Target Monsters", "Target monsters.", true); - targetPlayers = new BooleanSetting("killaura_target_players", "Target Players", "Target pplayers.", true); + radius = new FloatSetting("maceaura_radius", "Radius", "Radius", 5f, 0.1f, 10f, 0.1f); + targetAnimals = new BooleanSetting("maceaura_target_animals", "Target Animals", "Target animals.", false); + targetMonsters = new BooleanSetting("maceaura_target_monsters", "Target Monsters", "Target monsters.", true); + targetPlayers = new BooleanSetting("maceaura_target_players", "Target Players", "Target pplayers.", true); + targetFriends = new BooleanSetting("maceaura_target_friends", "Target Friends", "Target friends.", false); + this.addSetting(radius); this.addSetting(targetAnimals); this.addSetting(targetMonsters); this.addSetting(targetPlayers); + this.addSetting(targetFriends); } @Override @@ -111,6 +115,9 @@ public void OnUpdate(TickEvent event) { // Add all potential players to the 'hitlist' if (this.targetPlayers.getValue()) { for (PlayerEntity player : MC.world.getPlayers()) { + if(!targetFriends.getValue() && Aoba.getInstance().friendsList.contains(player)) + continue; + if (player == MC.player || MC.player .squaredDistanceTo(player) > (this.radius.getValue() * this.radius.getValue())) { continue; diff --git a/src/main/java/net/aoba/module/modules/movement/ClickTP.java b/src/main/java/net/aoba/module/modules/movement/ClickTP.java new file mode 100644 index 0000000..c9f6b03 --- /dev/null +++ b/src/main/java/net/aoba/module/modules/movement/ClickTP.java @@ -0,0 +1,71 @@ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.Aoba; +import net.aoba.event.events.RightMouseDownEvent; +import net.aoba.event.listeners.RightMouseDownListener; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.block.BlockState; +import net.minecraft.client.util.InputUtil; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.hit.HitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.shape.VoxelShape; + +public class ClickTP extends Module implements RightMouseDownListener { + + private FloatSetting distance; + + public ClickTP() { + super(new KeybindSetting("key.clicktp", "ClickTP Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("ClickTP"); + this.setCategory(Category.Movement); + this.setDescription("Allows the user to teleport where they are looking."); + + distance = new FloatSetting("clicktp.distance", "Max Distance", "Max Distance to teleport.", 10.0f, 1.0f, 200.0f, 1.0f); + + this.addSetting(distance); + } + + @Override + public void onDisable() { + Aoba.getInstance().eventManager.RemoveListener(RightMouseDownListener.class, this); + } + + @Override + public void onEnable() { + Aoba.getInstance().eventManager.AddListener(RightMouseDownListener.class, this); + } + + @Override + public void onToggle() { + + } + + @Override + public void OnRightMouseDown(RightMouseDownEvent event) { + HitResult raycast = MC.player.raycast(distance.getValue(), MC.getRenderTickCounter().getTickDelta(false), false); + + if (raycast.getType() == HitResult.Type.BLOCK) { + BlockHitResult raycastBlock = (BlockHitResult) raycast; + BlockPos pos = raycastBlock.getBlockPos(); + Direction side = raycastBlock.getSide(); + + Vec3d newPos = new Vec3d(pos.getX() + 0.5 + side.getOffsetX(), pos.getY() + 1, pos.getZ() + 0.5 + side.getOffsetZ()); + int packetsRequired = (int) Math.ceil(MC.player.getPos().distanceTo(newPos) / 10) - 1; + + for (int i = 0; i < packetsRequired; i++) { + MC.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(true)); + } + + MC.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(newPos.x, newPos.y, newPos.z, true)); + MC.player.setPosition(newPos); + } + } +} diff --git a/src/main/java/net/aoba/module/modules/movement/Glide.java b/src/main/java/net/aoba/module/modules/movement/Glide.java index a81f7a2..8deef5b 100644 --- a/src/main/java/net/aoba/module/modules/movement/Glide.java +++ b/src/main/java/net/aoba/module/modules/movement/Glide.java @@ -26,18 +26,25 @@ import net.aoba.event.events.TickEvent; 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.network.ClientPlayerEntity; import net.minecraft.client.util.InputUtil; public class Glide extends Module implements TickListener { - private float fallSpeed = .25f; + + private FloatSetting fallSpeed; + public Glide() { super(new KeybindSetting("key.glide", "Glide Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); this.setName("Glide"); this.setCategory(Category.Movement); this.setDescription("Allows the player to glide down."); + + fallSpeed = new FloatSetting("glide_fallspeed", "Fall Speed", "The speed at which the player will fall.", 0.25f, 0.1f, 2.0f, 0.1f); + + this.addSetting(fallSpeed); } @Override @@ -59,7 +66,7 @@ public void onToggle() { public void OnUpdate(TickEvent event) { ClientPlayerEntity player = MC.player; if(player.getVelocity().y < 0 && (!player.isOnGround() || !player.isInLava() || !player.isSubmergedInWater() || !player.isHoldingOntoLadder())) { - player.setVelocity(player.getVelocity().x, Math.max(player.getVelocity().y, -this.fallSpeed), player.getVelocity().z); + player.setVelocity(player.getVelocity().x, Math.max(player.getVelocity().y, -fallSpeed.getValue()), player.getVelocity().z); } } } diff --git a/src/main/java/net/aoba/module/modules/movement/HighJump.java b/src/main/java/net/aoba/module/modules/movement/HighJump.java new file mode 100644 index 0000000..f2fbe0a --- /dev/null +++ b/src/main/java/net/aoba/module/modules/movement/HighJump.java @@ -0,0 +1,40 @@ +package net.aoba.module.modules.movement; + +import org.lwjgl.glfw.GLFW; +import net.aoba.module.Module; +import net.aoba.settings.types.FloatSetting; +import net.aoba.settings.types.KeybindSetting; +import net.minecraft.client.util.InputUtil; + +public class HighJump extends Module { + + private FloatSetting multiplier; + + public HighJump() { + super(new KeybindSetting("key.higheump", "Higher Jump Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); + + this.setName("HighJump"); + this.setCategory(Category.Movement); + this.setDescription("Allows the player to jump super high!"); + + multiplier = new FloatSetting("highjump.jumpmultiplier", "Jump Multiplier", "The height that the player will jump.", 1.5f, 0.1f, 10.0f, 0.1f); + + this.addSetting(multiplier); + } + + @Override + public void onDisable() { + } + + @Override + public void onEnable() { + } + + @Override + public void onToggle() { + } + + public float getJumpHeightMultiplier() { + return multiplier.getValue(); + } +} \ No newline at end of file diff --git a/src/main/java/net/aoba/module/modules/movement/Spider.java b/src/main/java/net/aoba/module/modules/movement/Spider.java index 385a78c..31f9e2a 100644 --- a/src/main/java/net/aoba/module/modules/movement/Spider.java +++ b/src/main/java/net/aoba/module/modules/movement/Spider.java @@ -26,6 +26,7 @@ import net.aoba.event.events.TickEvent; 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.network.ClientPlayerEntity; import net.minecraft.client.util.InputUtil; @@ -33,12 +34,18 @@ public class Spider extends Module implements TickListener { + private FloatSetting speed; + public Spider() { super(new KeybindSetting("key.spider", "Spider Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); this.setName("Spider"); this.setCategory(Category.Movement); this.setDescription("Allows players to climb up blocks."); + + speed = new FloatSetting("spider.speed", "Speed", "Speed that player goes up blocks.", 0.1f, 0.05f, 1.0f, 0.05f); + + this.addSetting(speed); } @Override @@ -59,10 +66,10 @@ public void onToggle() { @Override public void OnUpdate(TickEvent event) { ClientPlayerEntity player = MC.player; + if(player.horizontalCollision) { - player.getVelocity().multiply(new Vec3d(1,0,1)); - player.getVelocity().add(new Vec3d(0,0.2,0)); - player.setOnGround(true); + Vec3d playerVelocity = player.getVelocity(); + MC.player.setVelocity(new Vec3d(playerVelocity.getX(), speed.getValue(), playerVelocity.getZ())); } } }